开发者

WordPress 3.1 WP_Query stopped working

开发者 https://www.devze.com 2023-02-13 02:50 出处:网络
upgraded to 3.1.. using the Devster theme.The slideshows and another special post query stopped working..

upgraded to 3.1.. using the Devster theme. The slideshows and another special post query stopped working..

this variable ends up empty.. even tho posts do 开发者_StackOverflow社区exist in that category..

$featured_slide = new WP_Query('category_name='.$featured_cat.'&posts_per_page='.$featured_num);

Any help? I didn't see anything that would change this behavior.


I just started learning WordPress and am a beginner php programmer. I was testing the loop examples that were given in the WP's Codex Loop section. I typed in the example code to get only one post from the "feature" category and received a fatel error that there was no valid class. I ended up just playing around with it and changed the $WP_Query to $wp_query. This gave me another error about being empty. This error had something to do with the $do_not_duplicate line, so I just deleted this one. Not sure what is empty because my category exits with 2 posts added to this category. At least it seems to be working now that I have deleted this line. It's very frustrating for a newbie. I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号