wp_list_pages by taxonomy?

wp_list_categories() Would be the way to go for taxonomies. Further functionality can be done either with a custom walker on this function (This seems to be the one resource: http://scribu.net/wordpress/extending-the-category-walker.html) or write a custom SQL script. In the end, I went with wp_list_pages and sorted by custom post type where: post_type => ‘custom-post-type’ is listed … Read more

Why is taxonmy-[taxonomyname].php not working?

I think this is because you use a reserved name: http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms Try changing in to something else like: register_taxonomy(‘portfolio_category’, ‘portfolio’, array(‘hierarchical’ => false, ‘label’ => ‘Category’,’query_var’ => true, ‘rewrite’ => true));

Description of a sub-taxonomy

Term description works only with term id and the taxonomy name, so if you want to get the sub term’s description, you should first get all the children of a term(and their children, if its another level deep) and loop over their ids with a single term_description call per id. <?php $my_taxonomy = ‘institute’; $terms … Read more

Dealing with variables with gettext function

You could just rename the labels associated with that post type. class News_Post_Type { const POST_TYPE = ‘post’; public static function init() { $post_obj = get_post_type_object(‘post’); $post_obj->labels->name = __(‘News Post’, ‘textdomain’); $post_obj->labels->singular_name = __(‘News Post’, ‘textdomain’); // You can continue to rename all the label properties, this is just an example } } add_action( ‘init’, … Read more

limiting characters shown in taxonomy descriptions

function trunc($phrase, $max_words, $after = null) { $phrase_array = explode(‘ ‘,$phrase); if(count($phrase_array) > $max_words && $max_words > 0) $phrase = implode(‘ ‘,array_slice($phrase_array, 0, $max_words)) . $after; return $phrase; } This function returns the input shortened if there are more words in it than $max_words. You use it like this: $string = “This is a sample … Read more