Display children category images

Haven’t tested it, but this should do it. <?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $queried_object = get_queried_object(); $term_id = get_queried_object() -> term_id; $taxonomyName = “product-categories”; $termchildren = get_term_children( $term_id, $taxonomyName ); if (! empty ( $term_children ) ){ foreach ($termchildren as $child) { $image_id = get_term_meta( $child, ‘showcase-taxonomy-image-id’, true … Read more

How to display only the direct children of a term on a taxonomy page

You have got the current term id by the following code $current_term_id = get_queried_object_id(); Getting all the info of chilldren of the parent, not grandchildren $termchildren = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $current_term_id , ‘taxonomy’ => ‘Structure’ ); $subcats = get_categories($termchildren); // Display the children foreach ($subcats as … Read more

Child Category Image

You can get a random post by category by using the following code: query_posts( array ( ‘showposts’ => 1, ‘orderby’ => ‘rand’, ‘cat’ => $cat->term_id ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); … And then use get_the_post_thumbnail() to retrieve the post featured image: if ( has_post_thumbnail() ) $image = … Read more

Menu Arrow for Child Element

To add arrow for parent elements: jQuery + CSS Solution: JQUERY: jQuery(function($){ $(document).ready(function(){ $(‘ul.sub-menu’).parent().addClass(‘drop-down’); // Add Sub-Menu Class to insert personalized style $(‘li.drop-down > a:first-child’).wrapInner(‘<span class=”menu-bullet” />’); // Add .menu-bullet in span to insert your arrow image background }); }); CSS: div#nav ul li.drop-down a .menu-bullet {display:block; background:url(your_image_path.jpg) no-repeat; padding-left:15px; /* padding left value is … Read more

Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?

I had done some work for my upcoming theme which shows category tree (Taxonomy drill down) from custom taxonomy. You can show it on taxonomy page or on category page. if(! defined(‘TH_TAX_TYPE’)) define(‘TH_TAX_TYPE’,’your-tax-type’); function is_decendent($term_id,$main_parent) { $terms= get_term_by(‘id’, $term_id,TH_TAX_TYPE); $parent_term= get_term_by(‘id’, $terms->parent,TH_TAX_TYPE); $grand_parent_term= get_term_by(‘id’,$parent_term->parent,TH_TAX_TYPE); if($terms || $grand_parent_term){ if($grand_parent_term->term_id==$main_parent){ return TRUE; } } return FALSE; } … Read more

How to customize taxonomy archive template files for subterms?

Strictly speaking, according to the Template Hierarchy, you cannot. Unfortunately taxonomy-$taxonomy-$term-$subterm.php is not provided for in default, so this file structure will not work. The best you can do here is taxonomy-$taxonomy-$term.php So for Thailand you will name your template as follows taxonomy-location-Thailand.php EDIT Just to add to my answer, the file structure that you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)