Show posted on date only for posts in a certain category
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 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
Add <?php get_sidebar(); ?> to single.php in the same place as the other files, i.e. right before <?php get_footer(); ?> You also need to go to style.css, and remove the margins for .singular and .singular #content, .left-sidebar.singular #content. In version 1.5 of this theme css only has, .singular #content, .left-sidebar.singular #content Plus you need to … Read more
Not sure it’s strictly the answer but I found a plug-in which still meant I needed to edit my functions.php file and was probably overkill for what I wanted but it resolved the issue and I binned the code above completely.