• Resolved acornrevolution

    (@acornrevolution)


    I am trying to add custom text to category pages. On Category three, I want just the title of the category. On all other category pages, I want to add a link under the title. This is the code I have and it is not working. Any help would be appreciated!

    (From archives.php)

    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h2 class="pagetitle"><?php single_cat_title(); ?></h2><br /><br />
    
    <?php } elseif (is_category('3')) { ?>
    <h2 class="pagetitle"><?php single_cat_title(); ?></h2><br /><br />
    <a href="#">Link</a></h2>aa

    I have also tried this, which doesn’t work:

    <?php /* If this is a category archive */ if (is_category('1,2,4,6')) { ?>
    <h2 class="pagetitle"><?php single_cat_title(); ?></h2><br /><br />
    
    <?php } elseif (is_category('3')) { ?>
    <h2 class="pagetitle"><?php single_cat_title(); ?></h2><br /><br />
    <a href="#">Link</a></h2>aa

Viewing 1 replies (of 1 total)
  • Thread Starter acornrevolution

    (@acornrevolution)

    Oops. Solved it myself:

    <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle"><?php single_cat_title(); ?><br /></h2>
              <?php } if (is_category(array('11','7','8','10','13','14','9','19','15'))) { ?>
    		ddd
              <?php } if (is_category('3')) { ?>
    		xxaa

Viewing 1 replies (of 1 total)
  • The topic ‘Different Text on Some Category Pages’ is closed to new replies.