Dynamic Taxonomy Terms in Shortcode Builder
-
I have this code and i want to achieve it in the shortcode builder. Everything is fine except the thing where I have to choose the terms instead of taking them dynamically.
Thats my code. Any idea? Is it something I have to do in Custom Arguments?
<?php $numbfour=0; $terms = get_terms( $taxonomyName, array( 'parent' => $custom_term->term_id, 'orderby' => 'slug', 'hide_empty' => false ) ); ?> <?php foreach ( $terms as $term ) { ?> <div class="tab-pane fade <?php if($numbfour == 0){echo 'in active';} ?>" id="subcategory<?php echo $numbfour.$numbtwo;?>" > <div id="posts"> <?php $prds=new WP_Query(array( 'post_type' => 'products', 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => 6 , 'tax_query' => array( array( 'taxonomy' => 'product_categories', 'terms' => $term ->term_id, 'field' => 'ID' )))); ?> <?php $productnumb=1; if($prds->have_posts() ): ?> <?php while ($prds->have_posts()) : $prds->the_post(); ?> <div class="col-md-4 prd-col"> <div class="overlay-wrapper"> <a href="<?php echo get_permalink(); ?>"> <?php the_post_thumbnail(); ?> </a> <a href="<?php echo get_permalink(); ?>"> <div class="prd-overlay"> <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> </div> </a> </div> <a href="<?php echo get_permalink(); ?>"><h1><?php the_title(); ?></h1></a> <p><?php echo wp_trim_words( get_the_content(), 8, '...' ); ?></p> <div class="descr-border"> </div> <div class="front-more"> <h3> <a href="<?php echo get_permalink(); ?>"> Περισσότερα </a> </h3> </div> </div> <?php $productnumb++; endwhile; endif;?> </div> </div> <?php $numbfour++; } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Dynamic Taxonomy Terms in Shortcode Builder’ is closed to new replies.
