Forums

Intro To Categories (9 posts)

  1. spikoley
    Member
    Posted 1 year ago #

    I am looking for a solution to put a small intro on top of a category. When you click on the category tag it brings you to a page with every post under that category. I would like to add a paragraph to the top of that page where I can have an intro the category topic.

    Using a sticky plug in doesn't work because that post shows up under the all post section.

    Any ideas on how to accomplish this?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try using the category description in Posts/Category and then amend your category template file to display the category description.

  3. spikoley
    Member
    Posted 1 year ago #

    Thanks for the reply. I don't have a category template file to edit. Any other ideas on how to accomplish this? Is there a plugin I can use?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    If your theme doesn't have a category.php file, it will be using archive.php or index.php (in that order).

  5. spikoley
    Member
    Posted 1 year ago #

    I only have a index.php file. Inside the file category is mentioned once.

    <div id="post-<?php the_ID(); ?>" class="node clearfix node-story node-teaser published promoted <?php if (is_sticky()): ?>sticky<?php endif; ?> without-photo">
    <div class="meta">
    <h2>"><?php the_title(); ?></h2>
    <p>Posted <abbr class="created"><?php the_time('M.d, Y') ?></abbr> by <?php the_author_posts_link(); ?>, under <?php the_category(', '); ?></p>
    <div class="terms">
    <?php the_tags('<span class="icon"> </span>', ', ', ' '); ?>
    </div>
    </div>

    From the link you provided me it looks like I need to add <?php echo category_description( $category ); ?>.

    I am new to PHP and I haven't been able to get it to work. Where would I put that line?

  6. spikoley
    Member
    Posted 1 year ago #

    I got it working! Thanks for you help. Now I just need to tweak it.

  7. spikoley
    Member
    Posted 1 year ago #

    Actually, that solution is not going to work. It ads the category to each post. I just want a paragraph at the top of the category when you view by category.

    Any other idea? Maybe a way to create a page and then have the category show up below the page?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You need to add <?php echo category_description( $category ); ?>. before the Loop - not inside it.

  9. obragblog
    Member
    Posted 1 year ago #

    In WP 3.0.1 there is a new feature, when you edit the properties of a category (click on the Category link from the left sidebar in the admin panel, find the category you want to add the description to and click the edit link) you can now add an Introductory Headline and Introductory Content to each category.

    Inside the Introductory Content section you can even use html to add images and style the content. Now when you go to a category archive your information will show at the top of the page.

    It's about time something like this was made available. Now if they would make it this easy for Author archives...

Topic Closed

This topic has been closed to new replies.

About this Topic