Loop Question
-
When I click on a tag from the bottom of one of our blog posts, the result is our main blog page, not just the articles that are listed under that tag.
There’s a file in the theme we’re using called loop.php – is there something you can see that’s interfering with returning just the tag query? Should there be another loop file that’s specific for tags? — here’s the code:
`<?php
$print = 1;
if (have_posts()) : while (have_posts()) : the_post();
$format = get_post_format($post->ID);
if( false === $format ) { $format = ‘standard’; }
$day = get_the_time(‘j’);
$month = get_the_time(‘M’);
$year = get_the_time(‘Y’);
?><article class=”post”>
<?php
if( has_post_thumbnail($post->ID) ) { the_post_thumbnail(‘full’, array(‘alt’=>$post->post_title)); }
else { echo ‘<img src=”‘ . get_template_directory_uri(‘template_directory’) . ‘/img/default.jpg” />’; }?>
<header>
<h3 <?php echo colors(‘h3’);?>><?php echo the_title();?></h3>
</header>
<h4 <?php echo colors(‘h3’);?>><?php echo the_title();?></h4>
<p <?php echo colors(‘p’);?>><?php echo wp_trim_words(get_the_content(),40,’…’);?></p>
<a <?php echo colors(‘a’);?> href=”<?php the_permalink();?>” class=”readmore”><?php _e(‘Read more’,’gym’) ;?> <i class=”entypo-right-open” ></i></a>
<footer>
<span <?php echo colors(‘h1s’);?>><i class=”entypo-pencil” ></i><?php the_author();?></span>
<span <?php echo colors(‘h1s’);?>><i class=”entypo-calendar” ></i><?php echo $day;?></span>
<span <?php echo colors(‘h1s’);?>><i class=”entypo-comment” ></i><?php comments_number();?></span>
</footer>
</article>`
- The topic ‘Loop Question’ is closed to new replies.