Support

Account

Home Forums Front-end Issues Display related posts using specific tag via taxonomy custom field Reply To: Display related posts using specific tag via taxonomy custom field

  • I tried using this code which I found here :

    
    <?php
    							$tagValue = get_field('related_places_by_tag');
    							$args=array(
    							'tag_id' => $tagValue,
    							'posts_per_page'=>6 // Number of related posts to display
    							);
    							$my_query = new wp_query( $args );
    							while( $my_query->have_posts() ) {
    							$my_query->the_post();
    							?>
    							<div>
    							<a href="<? the_permalink()?>">
    							<?php the_title(); ?>
    							</a>
    							</div>
    							<?php }  
    							wp_reset_query();
    						?>

    Though it does not break the template, it doesn’t work.