“Sticky” posts for each category (archive.php)

To make this more complete, here is what I have said in comments in reply to the question on hand Just to quickly explain, WP_Query fails catastrophically in some cases where empty arrays are passed to some of its parameters, instead of also returning an empty array as we should expect, WP_Query returns all posts. As for getting the correct stickies, … Read more

Are Custom Taxonomy Templates Possible?

Custom Taxonomy templates are entirely possible, the order of the template loading is, taxonomy-{sometax}-{someterm}.php – If the taxonomy were sometax, and taxonomy’s slug were someterm taxonomy-{sometax}.php – If the taxonomy were sometax. taxonomy.php archive.php index.php This template hierarchy give you tons of control on how you want to alter the display of taxonomies as a … Read more

Getting WordPress custom taxonomy/category?

I think you are getting confused by terminology here. Category is a taxonomy. Specific categories you create are terms. our_gallery is taxonomy. Landscapes is term. our_gallery is not category. It is its own taxonomy and has nothing to do with category taxonomy. get_the_category() function explicitly fetches terms of category taxonomy. To get terms of our_gallery … Read more

wp_list_categories, Add class to all list items with children

jQuery solution: You could try this if you want to use jQuery: <script> jQuery(document).ready(function($) { $(‘li.cat-item:has(ul.children)’).addClass(‘i-have-kids’); }); </script> to add the class i-have-kids to all the li parents that include the items ul.children, within the HTML generated from wp_list_categories(). Category walker solution: You could take a look at the Walker_Category class in /wp-includes/category-template.php and extend … Read more