Archived topic
Archive Page Functions & Hook
1 reply · Started by Wesley on May 12, 2021
- please remove
Hi there,
1. In your generate_do_template_part_func function, you're using $query, but it's not defined in the function. That's the issue here.
2. Same issue - you're treating the generate_do_template_part_func like the pre_get_posts hook, which it isn't. You could try defining global $wp_query; at the top of the function, then replace $query with $wp_query in the function. Not 100% sure it will work.
3. I think this is because you're putting a space between <? and php. It should be like this: <?php