Forums

Adding Static Text to Single Category (8 posts)

  1. futurepocket
    Member
    Posted 11 months ago #

    Hi,
    This may be simple but I searched around, read some solutions but couldn't figure it out. I want to add some static text to only ONE of my category pages, e.g., http://futurepocket.com/category/lifestyle/

    I want to add some text to the top of that category before any of the posts are displayed (possibly in a box). If also possible, I want to arrange the posts so they appear beside each other rather than below each other. That's not the category I want to add the text to, I have yet to create that category, but just wanted to know how I would do that before I made the category. Thanks in advance!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

  3. futurepocket
    Member
    Posted 11 months ago #

    What is "OUTSIDE" the loop, which file? And do we label the name as the category "A" (put name of category in place of A)?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    What is "OUTSIDE" the loop

    Before (or sometimes, after) The Loop.

    which file?

    category-lifestyle.php

    And do we label the name as the category "A" (put name of category in place of A)?

    Ignore that section. It's another approach entirely.

  5. Chip Bennett
    Member
    Posted 11 months ago #

    Since this is such a minor change to the default template, I would modify the category.php template file, rather than creating an entirely separate category-lifestyle.php template file.

    Simply add something like the following:

    if ( is_category( 'lifestyle' ) ) {
         // We are on the lifestyle category archive page; do something
         ?>
         ADD STATIC TEXT/MARKUP HERE
         <?php
    }
  6. futurepocket
    Member
    Posted 11 months ago #

    Thanks CHIP much appreciated :)

  7. clarelarge
    Member
    Posted 4 months ago #

    Hello,

    Please can you tell me where you would put that within the category.php file??

    Thanks :-)

  8. alchymyth
    The Sweeper
    Posted 4 months ago #

    where you would put that within the category.php file

    whereever you want the text to show up.

Reply

You must log in to post.

About this Topic