0
votes
2answers
56 views

How to get all unique categories for posts in loop?

I'm looking to get a plain list of the unique categories in a custom loop (only categories for the posts in the loop). I've been fumbling with some code for a bit and here's what I've got: <?php ...
0
votes
1answer
78 views

Loop through categories and create tab for each

I'm trying to create a page that holds all categories of my custom post type as tabs, with a tab content. I am able to display all the category names as tabs, but i need to run a query in each tab ...
0
votes
3answers
61 views

How to select posts from one category but exclude posts in another category?

I am trying to select posts that have category id 4 but exclude posts that also have category id 2 Here's what i'm trying $query = new WP_Query(array( "cat__in" => array(4), ...
0
votes
3answers
548 views

Sidebar limiting to 10 posts?

I have the following code inside my single.php page: UPDATED CODE <?php if (have_posts()) : the_post(); $post_id = get_the_ID(); if ( is_single() ) { $cats = get_the_category(); ...
0
votes
1answer
354 views

Widgets: Show Recent Posts Only if the Posts Have Both Categories X and Y

I've been trying to create a Recent Post widget where it only show/display posts that have both categories X and Y (or more). The categories X and Y is user-defined, so I'm planning to make it look ...
0
votes
1answer
1k views

Category 'pad_counts' & 'parent' conflict

Below is the current loop I have setup: <?php //start products category loop $args = array( 'hide_empty' => 0, 'parent' => 0, ...