watershawl
Member
Posted 1 month ago #
Hi, I am trying to display a list of links in the archive after clicking on a tag. I've been referencing http://wordpress.org/support/topic/152904?replies=28 but it keeps showing up blank. Here is my code:
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class="pagetitle"><strong> <?php single_tag_title(); ?></strong></h2>
<?php $current_tag = single_tag_title("", false); ?>
<ul><?php query_posts(array('cat'=>'0','tag_slug__and'=>array($current_tag),) ); while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"<?php the_title(); ?></a></li>
<?php endwhile; rewind_posts(); wp_reset_query(); ?></ul>
watershawl
Member
Posted 1 month ago #
Wow, that was 2 hours of learning. Why is it that after you post things to a forum, your brain is freed to find the answer sometimes?
All I had to do was repeat the wordpress loop and only list the title and permalink, not the content.
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class="pagetitle"><strong>Baked <?php single_tag_title(); ?> Recipes</strong></h2>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><ul>
<li><a href="<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a></li>
<?php endwhile; endif; ?></ul>