Tag Info

Hot answers tagged

9

Taxonomies, as previously described are a collective noun for the following category post_tag post_format link_category custom taxonomy The first four are built-in taxonomies, while custom taxonomies are taxonomies that are manually created by the user with register_taxonomy. Custom Taxonomies can be hierarchical or not The categories and tags that you ...


4

The Automatic Sponsor Posts Injector: Here's one idea based on my answer for the question: How to show Y number of custom posts after every X normal posts? I hopefully made it a little bit more useful here on Github, but it may be refined much more (future work). The SponsorPostsInjector class will help you to automatically inject the sponsor posts into ...


3

Category, Tag, Link Category and Post Formats are built in taxonomies. From Codex Basically, a taxonomy is a way to group things together. The names for the different groupings in a taxonomy are called terms. Using groupings of animals as an example, we might call one group "birds", and another group "fish". "Fish" and "birds" are terms in our ...


1

You can get only the category's children. $terms = get_terms( $taxonomy, 'child_of=6' );


1

There is no way easy way to do that. You have to query directly to achieve that. I am assuming, you only want the parent categories which don't have descendants or even if they have descendants, it's not used in any post global $wpdb; $categories = $wpdb->query("SELECT $wpdb->terms.* FROM $wpdb->terms ...


1

To exclude parent categories from your term list, you can just pass over them after you have retrieved your term list with get_terms Example: <?php $args = array( 'orderby' => 'name', ); $terms = get_terms( 'mytaxname', $args ); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ foreach ( $terms as $term ) { if( 0 == ...



Only top voted, non community-wiki answers of a minimum length are eligible