Archives for each category on WP Multisite

I thought I’d let you know how I resolved this. After some discussion with a colleague, he made the point that adding a trailing year to the url, doesn’t affect the page displayed (I haven’t had time to find out the rationale for this yet) so: /category/subcat/2011/ displays the same page as /category/subcat/ This meant … Read more

List all the categories with or without post

Problem is solved. Just need to add ‘hide_empty’ => false, to the array. Like this : wp_dropdown_categories( array ( ‘orderby’ => ‘name’, // ID of the already selected category: ‘selected’ => 4, ‘hide_empty’ => false, // If no category is selected: ‘show_option_none’ => ‘Choose one’ ) );

RSS/XML of all Categories and/or Tags

Demo plugin for JSON export: I’m not sure the RSS feed structure suits your needs, for example taxonomies and terms don’t have any dates for the public date field. So here’s an example how you can retrieve all the terms for a given taxonomy: /** * Plugin Name: WPSE – JSON export all terms for … Read more

Strip a word from wp_list_categories

I assume you want to replace the “news” string in the category names and not in the category links. The default category walker contains this line: $cat_name = apply_filters( ‘list_cats’, $cat_name, $category ); that allows you to modify the category names that will be displayed. So you could try (untested): <ul class=”subcats-blog”> <?php if ( … Read more

Exclude Posts From Specific Category from Next and Previous post links

Use the 4th parameter $excluded_terms http://codex.wordpress.org/Function_Reference/next_post_link <?php next_post_link( $format, $next, $in_same_term = true, $excluded_terms=”402″, $taxonomy = ‘category’ ); ?> Same for the previous_post_link http://codex.wordpress.org/Template_Tags/previous_post_link $previous=”<span class=”meta-nav”>Previous Post</span>”; $next=”<span class=”meta-nav”>Next Post</span>”; <?php previous_post_link( $format, $previous, $in_same_term = true, $excluded_terms=”402″, $taxonomy = ‘category’ ); ?> Or you could create a template tag like whats included in Twenty … Read more

If posts category is “cars”, display image

You can make use of the conditional tag has_catgeory. You can do something like this if(has_category( ‘cars’ ) || has_category( ‘uncategorized’ )) { //display cars image }elseif(has_category( ‘banana’ )) { //display banana image } From your comments, here is your code <?php if(has_category( ‘Update’ ) || has_category( ‘uncategorized’ )) { ?> <img alt=”Hello!” src=”https://wordpress.stackexchange.com/questions/161368/<?php bloginfo(“template_directory’); … Read more