Wp_query…a type of term a different div

The easiest way is to just create conditional statements checking for the term and wrapping it in a div of your choice. After you loop starts you could do something like: while ($list_query->have_posts()) : $list_query->the_post(); if( has_term( ‘casegoods’, ‘tag-series’ ) ) { echo ‘<div class=”left-side”>’; the_content(); echo ‘</div>’; } elseif ( has_term( ‘casegoods’, ‘rugs’ ) … Read more

Add custom taxonomy as a css class

Your code shows how it fetches posts, but not, how it fetches the $term. On a proper development environment (WP_DEBUG is set to TRUE) this code should trigger a notice, that $term is unknown at this point. However, I suggest to use the template function post_class() to display relevant information of the post as HTML … Read more

Grab all Custom Posts by multiple taxonomies and terms

$terms = get_terms(‘location’, array(‘orderby’ => ‘date’, ‘order’ => ‘ASC’)); foreach( $terms as $term ) { $args = array( ‘post_type’ => $post_type, ‘orderby’ => ‘date’, ‘order’ => ‘ASC’, ‘ignore_sticky_posts’ => 1, ‘post_status’ => ‘publish’, ‘posts_per_page’ => – 1, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘organize’, ‘field’ => ‘slug’, ‘terms’ => array( ‘aba-therapist’ ) … Read more

Multi Parameter search with custom post type category and tag

Ok i manged to create the solution by finding that LIKE condition can be used in meta query. so here is the final code.. $args=array( ‘post_type’ => ‘tyre’, ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘tyre-category’, ‘field’ => ‘ID’, //can be set to ID ‘tag’ => ‘ID’, //can be set to ID ‘terms’ … Read more

Check in which custom taxonomy belongs and change the style

has_term must be used inside the loop. If you use it outside the loop you have to pass the post ID or post object you want to check. In the single.php file put your code inside the loop to check the current post: <?php get_header(); while(have_post) { the_post(); ?> <div class=”non-home-parallax product-listing-parallax” style=” <?php if( … Read more

Breaking Bootstrap Grid at Post Count with Tax Terms

I’m not exactly sure where you want your clearfix to come in, but you should be able to do something like this: <div class=”row”> <?php $libargs=array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 0, ‘exclude’ => array(16, 20, 22,25, 27, 28, 30, 4), //* Enter ID’s of parent categories to exclude from list ‘taxonomy’ … Read more