Category Description as Post Title
-
I have a blog of quotations where I use categories for the authors of each quote (as a steady, repeatable attribute), I use the title for the citation, etc.
I use category description for extended author information (full name, born-died, etc.), and want to use that for, essentially, the title of each post in the main index, etc.
`<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); update_post_caches($posts); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2><?php the_category() ?></h2><div class=”content”>
[Use the_content() and the_title() for quote and citation]
<p class=”under”>
<div class=”act”>
[put in all the date and comment code here.]<span class=”author”>More quotes by <?php the_category(‘, ‘); ?></span><div class=”fixed”></div>
</div>
</p><div class=”fixed”></div>
</div>
</div>
<?php endwhile; ?><?php else : ?>
<?php endif; ?>
`If I use the_category(), then it works to show the category name (wp_terms.name). If I use category_description(), though, nothing shows up. I understand that categeory_description() relies on the context of the pertinent category, but since that’s already seemingly working well enough for the_category() to work, what (probably obvious) think am I missing?
- The topic ‘Category Description as Post Title’ is closed to new replies.