September 30, 2007 6:58pm
I’ve just upgraded to WordPress 2.3 and, while the process was pretty painless, for some reason tags weren’t working, even after I added tag support to the theme using the_tags() in The Loop. The problem turned out to be that The Loop in the Connections theme uses deprecated function calls. To enable tagging in the Connections theme edit index.php and find the following code.
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<div class="post">
<?php require('post.php'); ?>
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endforeach; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
This is The Loop. You need to replace it with this code.
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<?php require('post.php'); ?>
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endwhile; ?>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
You need to make a similar change to single.php, category.php, date.php and search.php.
Finally, you need to edit post.php and add a call to the_tags() somewhere. You can add it anywhere, depending on how you want the post laid out. I added the_tags(', tagged ', ', ', ''); after the call to the_category().
October 8th, 2007 at 2:52am
[…] tag to your singlepost.php page and you still don’t see tags, check out your loop. See this post from echo about resolving this […]
October 23rd, 2007 at 10:54pm
Thanks very much for this excellent guide - I was really struggling with this!
:o)
November 22nd, 2007 at 12:36pm
[…] you enabled tags by following my instructions for enabling tags in Connections, you’ll have some code like this: Posted by <?php the_author(); ?> under <?php […]