How to show term child only if has a post

AS per my knowledge you need to write following function in your functions.php and check whether the term has post using the below function function check_term_posts($tax_slug, $term_id) { $args = array( ‘post_type’ => ‘post’, ‘status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => spanishcategory, ‘field’ => ‘term_id’, ‘terms’ => 169 ) ) ); $term_query = … Read more

How to show terms used only for particular custom post type. Filter creation perpose

You need to send param post_id in ajax of data. Then in your plugin parse it and and search by taxomony. My simple example: <?php // in ajax handler // get post_id from requst data $post_id = filter_var($_POST[‘post_id’], FILTER_VALIDATE_INT); // find post $post = get_post($post_id); But before you need register the taxomony. register_taxonomy(‘auto’, array($post->post_type), array( … Read more

Add active class to foundation 6 tabs while looping categories

Sure, you can use a counter. Just move your while loop a little higher. Something along these lines: <ul class=”tabs” data-tabs id=”example-tabs”> <?php // counter for ul.tabs $i=0; $bulletin_types = get_object_taxonomies( ‘bulletinboard’ ); foreach( $bulletin_types as $bulletin_type ) : $terms = get_terms( $bulletin_type ); foreach( $terms as $term ) : // increment each one $i++; … Read more