Grandchild Term Things Grandfather Term is It’s Parent

Use get_terms() and the parent argument. ‘parent’ (int|string) Parent term ID to retrieve direct-child terms of. $parent_term_id = 123; $direct_child_terms = get_terms( array( ‘taxonomy’ => ‘[taxonomy]’, ‘parent’ => $parent_term_id, ) ); Don’t forget to replace [taxonomy] with whatever the taxonomy is; e.g., post_tag, product_cat, etc. Additional arguments for further customization here.

Default Category Page not showing custom post type which has taxonomy category

The default query doesn’t include custom post types. You have to use pre_get_posts hook to modify your query. Hope this solves your issue function custom_posttype_query( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars[‘suppress_filters’] ) ) { $query->set( ‘post_type’, array( ‘post’, ‘gallery’ )); } return $query; } add_filter( ‘pre_get_posts’, ‘custom_posttype_query’ );

Blogroll links sorted by category in a table

As suggested, here is the “arrayed” version: $args = array( ‘categorize’ => 1, ‘category_before’ => ”, ‘category_after’ => ‘</table>’, ‘title_before’ => ‘<h3>’, ‘title_after’ => ‘</h3><table><tr><th>Link</th><th>Description</th><tr>’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘before’ => ‘<tr><td>’, ‘after’ => ‘</td></tr>’, ‘between’ => ‘</td><td>’, ‘show_description’ => 1, ‘show_name’ => 1 ); wp_list_bookmarks( $args ); The Highlight of my answer … Read more

How can I completely hide a taxonomy term from “frontend”? [closed]

First what i see in your “latest FAIL” code you use wrong “operator” (or maybe is just typo). It sholuld work if you change “operator” to ‘operator’ => ‘NOT IN’ tax query parameters UPDATE: for Sablednah comment You can try to hide this term (and “count”) completely by modify WP_Term_Query with something like that: add_action(‘pre_get_terms’, … Read more

Change header on pages displaying taxonomy items

You need to change the code that currently displays that header, so that it doesn’t display the default title when it’s on this taxonomy. You can detect if you are on a taxonomy page with the is_tax() function, and then you could do something like this: $term_array = get_term_by( ‘slug’, get_query_var( ‘term’ ), ‘materia’ ); … Read more

Query custom post types & Taxonomies and list them in a table on a page

You can use term_query in WP_Query: $args = array( ‘post_type’ => ‘all_parks’, ‘posts_per_page’ => -1, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘all_park_categories’, ‘field’ => ‘slug’, ‘terms’ => ‘national_parks’, ), ), ); $all_parks = new WP_Query( $args ); Query all posts with all categories and sort by term or create … Read more