query_posts not pulling category_name.
-
I’m creating a publication plugin & theme that organizes posts into volumes and issues, like a magazine or newspaper.
My plugin sets both an active issue, and an “upcoming” issue that is only viewable by the admin. All posts receive several categories: “Live” (aka: publicly viewable), “Submitted” (offline, admin-viewable) and the volume and issue in the following format: Volume#_Issue#
So, in my admin logic, I’m querying for the next volume and issue options from my plugin:
if (current_user_can(‘manage_options’)) {
$Volume = get_option( $opt_nextVolume_name );
$Issue = get_option( $opt_nextIssue_name );and then putting them together:
$VolumeAndIssue = ‘Volume’.$Volume.’_Issue’.$Issue;
Then I look for posts with this category:
if (is_home()) { query_posts(‘category_name=’.$VolumeAndIssue); } else { query_posts(‘category_name=Live’); }
However if(have_posts()) returns false, and query_posts returns an empty array.
Spitting out the value of $VolumeAndIssue, I see that it’s set to Volume1_Issue3 (which is correct)
I have a single post with some lorem ipsum text marked with this category.
I’ve double-checked for any typos or case-sensitive errors.
Any advice on how I can better debug the problem?
- The topic ‘query_posts not pulling category_name.’ is closed to new replies.