Ignoring a category in WP_Query still shows the links in next_post_link()?

You’ll have to exclude the category in your next_post_link and previous_post_link calls too, as it’s using the posts data, not your specific queries data, so, this should fix it: while ( $homepage->have_posts() ) : $homepage->the_post(); next_post_link( ‘« %link’, ‘%title’, false, ‘5’ ); previous_post_link( ‘%link »’, ‘%title’, false, ‘5’ ); endwhile; Where 5 is the excluded … Read more

How to display posts under a specific subcategory of a given category

It should be enough to do this: query_posts( ‘posts_per_page=10&paged=’.$paged.’&post_type=publication&publication_category=’.$subcat ); If you look at your original code you can see why you went wrong by looking at what you are literally asking in your arguments: I would like posts that are in the main category but are in the child category. When what you want … Read more

Problem displaying one post from each category

I’ve checked this code localy, here is the working snippet: <?php $cat_args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ); $fcategories = get_categories($cat_args); foreach($fcategories as $fcategory) { echo ‘<dl>’; echo ‘<dt> <a href=”‘ . get_category_link( $fcategory->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $fcategory->name ) . ‘” ‘ … Read more

Are Category or Tag Archive Pages Possible?

This is absolutely possible. By default, the category archive page will be at domain.com/category/the_category. The file that is typically used for this rendering is category.php, which is located in your theme directory. To remove the /category/ part, so that your category archives are at domain.com/the_category, you can use the SEO Ultimate plugin. After installing the … Read more

Display WordPress Parent Categories Only?

This should do what you’re looking for. It’s untested, I just whipped it up really quick right now, but the concept is there. function my_get_highest_parent( $id ) { $cat = get_category( $id ); $parent = $cat->parent; if( $parent == 0 ) return $id; else my_get_highest_parent( $parent ); }

wp_parse_args & category parameter

Update 3/5: When I originally answered this question I didn’t realize that your code was almost an exact copy of the wp_get_archives function. There is nothing in your code or the original wp_get_archives code that supports categories. The function was written to get date archives and your defaults are missing the type, limit, before and … Read more