Check if value is a custom taxonomy category name
You must use get_terms in order to obtain all the “categories” of a custom taxonomy. http://codex.wordpress.org/Function_Reference/get_terms
You must use get_terms in order to obtain all the “categories” of a custom taxonomy. http://codex.wordpress.org/Function_Reference/get_terms
<?php $categories=get_categories(”); foreach($categories as $category) { echo ‘<p>Category: <a href=”‘ . get_category_link( $category->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</a> </p> ‘; echo ‘<p> Cat ID: ‘. $category->cat_ID. ‘</p>’; // The Query $id_cat = $category->cat_ID; $args = array( ‘cat’ => … Read more
I do not see why you want to do such a thing but it would be easier to proceed like that : if( has_category(‘Featured’) ) twentyten_posted_on();
I added these lines: $(this).removeClass(‘ic-arrdn’).addClass(‘ic-arrup’); $(this).removeClass(‘ic-arrdn’).addClass(‘ic-arrup’); and achieved the result. $(document).ready(function () { $(“aside ul li:has(ul)”).addClass(“ic-arrdn”); var e = $(“aside > ul > li.current-cat, aside > ul > li.current-cat-parent”); if (e.length == 1) { } $(“aside > ul > li > ul.children”).each(function () { $(this).find(“li”) $(this).parent().toggle(function () { $(this).find(“ul”).slideDown(); $(this).removeClass(‘ic-arrdn’).addClass(‘ic-arrup’); }, function () { $(this).find(“ul”).slideUp(); … Read more
use get_the_terms instead and exclude any terms where parent value is 0, which means it is a top-level term. $terms = get_the_terms( $post->ID, ‘portfolio-type’ ); if ( !empty( $terms ) ) { $output = array(); foreach ( $terms as $term ){ if( 0 != $term->parent ) $output[] = ‘<a href=”‘ . get_term_link( $term ) .'”>’ … Read more
Hiding any option or menu from menubar
I am making a couple of assumptions: I assume that by “I have a category called feature that displays the latest post” you mean that you are displaying the latest posts in your “featured” category I assume that your “featured” categories have their own template which has a query that displays them. Assuming those assumptions … Read more
Using two nested foreach you prevent n+1 db queries, where n is the number of child terms: <?php $_cats = array(); $args = array( ‘orderby’ => ‘id’, ‘order’ => ‘ASC’, ‘taxonomy’ => ‘album’ ); $categories = get_categories($args); if ( ! empty($categories) ) { foreach( $categories as $category ) { if ( $category->parent != 0 ) … Read more
You should not use category parameter to query custom taxonomy instead you should use tax_query parameter or directly custom taxonomy name as shown in the following query. query_posts( array( ‘post_type’ => ‘ublalfieportfolio’, ‘ublalfieportfolio-categories’ => ‘parketten’, ‘posts_per_page’ => -1) ); Refer this page to know how to use custom taxonomy parameter in custom query.
list first post of Child Category on Category page