Skip to content
Advertisement

Tag: custom-wordpress-pages

WordPress: passing $query to separate template file

I have the following code: homepage.php loop-feed-work.php But when I view my homepage, I get the following error: Fatal error: Uncaught Error: Call to a member function have_posts() on null in ******/loop-feed-work.php:1 Could this be because the query is in a different template file? Answer That’s exactly the problem. Unfortunatly get_template_part doens’t work like an include so you will lose

Advertisement