ADVICE: QUERY_POSTS( ) WORKS BETTER THAN IN_CATEGORY( )
-
I posted something earlier titled “Simple Loop Code Not Working Properly”..where no one responded..
The issue was I was trying to display posts from a specific category by using
<?php in_category('whatever') ?>
and it was only displaying one posts from the category.The answer??
Don’t use
in_category('whatever')
when I want to display a specific category. It’s not a good function. It had absolutely no reason not to work for me because I used it for other loop files and it worked fine.Instead use
<?php query_posts('category_name=whatever'); ?>
.It won’t produce the same inconsistencies as
<?php in_category('whatever') ?>
..If anyone wants to elaborate on that and has a difference of opinion, I would appreciate it.
- The topic ‘ADVICE: QUERY_POSTS( ) WORKS BETTER THAN IN_CATEGORY( )’ is closed to new replies.