[Resolved] Keep Getting Member Function Error
I’m creating my first theme with all of the files needed completed. My home.php features a featured post slideshow that I got here. I copied the code word-for-word (see below), but I keep getting the following error: Fatal error: Call to a member function have_posts() on a non-object in C:\xampp\htdocs\wordpress\wp-content\themes\sports\home.php on line 21.
<?php $featuredposts = new WP_Query(); $featuredposts->query("showposts=4&cat=5"); while ($featuredposts->have_posts()) : $featuredposts->the_post(); ?>
I can’t find any solution for my problem. Any help?
- The topic ‘[Resolved] Keep Getting Member Function Error’ is closed to new replies.