Query Multiple Custom Post Types & Exclude a Taxonomy Term

You should have a look at the arguments of WP_Query. The following arguments should be what you need. Note that tax_query takes an array of arrays. $args = array( ‘post_type’ => array( ‘post’, ‘videos’, ‘music’ ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘content’, ‘field’ => ‘slug’, ‘terms’ => ‘indy’, ‘operator’ => ‘NOT IN’ ) ) … Read more

Query custom posts from custom taxonomy

You should access global variables in php using global keyword.It makes variable( or object, array) visible inside current function we are dealing with. In function wms_output_home_slides you are using $post global variable directly instead access it using global keyword as following. function wms_output_home_slides($cat) { // $cat=”homeslide” global $post; // You Code Goes here } Find … Read more

Taxonomy archive template not working

You have a taxonomy name Talks, this must be lowecase (talks). If you look at the register_taxonomy() Codex page the following parameter description is shown: <?php register_taxonomy( $taxonomy, $object_type, $args ); ?> $taxonomy (string) (required) The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces) and not … Read more

Show single Child Category on Custom Post

You can use get_term_children function. For Example: <?php $termID = 10; $taxonomyName = “region”; $termchildren = get_term_children( $termID, $taxonomyName ); echo ‘<ul>’; foreach ($termchildren as $child) { $term = get_term_by( ‘id’, $child, $taxonomyName ); echo ‘<li><a href=”‘ . get_term_link( $term->name, $taxonomyName ) . ‘”>’ . $term->name . ‘</a></li>’; } echo ‘</ul>’; ?>

Order taxonomy terms wordpress

You’re not setting an order anywhere for get_terms, you’re setting it for the query of articles within each term. You need to pass arguments to get_terms if you want an order other than default, which is ASC. $tax = ‘news’; $tax_args = array( ‘order’ => ‘DESC’ ); $tax_terms = get_terms( $tax, $tax_args );

Retrieve Custom Taxonomies with Description and Slug

Here’s how you can output all the custom taxonomies in any template for examination: <pre> <?php $args = array( ‘public’ => true, ‘_builtin’ => false ); $taxes = get_taxonomies( $args, ‘objects’); foreach ($taxes as $key => $tax) { $terms = get_terms( $tax->name, array(‘hide_empty’ => false) ); // return empty ones too! foreach ($terms as $key … Read more

Show all terms in a custom taxonomy with all child terms wrapped in a ul

You can take a look at the WordPress function wp_list_categories(). If you want to display all the terms within a given custom taxonomy you can for example use: <?php $args = array( ‘taxonomy’ => ‘my_custom_taxonomy_slug’, ‘orderby’ => ‘name’, ‘hide_empty’ => 0, ‘title_li’ => ”, ‘hierarchical’ => 1, ‘walker’ => null, ); ?> <ul class=”menu”> <?php … Read more

Custom Post taxonomy template

Turned out to be an internal mayashop function in the taxonomy.php page that checks for two particular taxonomies if found populates their pages it not returns to the index.php added my condition & all is well now, Thanks <?php /** * @package WordPress * @subpackage Impero * @since Impero 1.0 */ if ( yiw_is_portfolio_tax( get_query_var(‘taxonomy’) … Read more