WordPress.org

Ready to get started?Download WordPress

Forums

php syntax for conditional tag (1 post)

  1. pgmlesondra
    Member
    Posted 5 years ago #

    Here's current code from the template:

    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h2>More articles about ‘<?php single_cat_title(); ?>’</h2>
    
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h2>More articles tagged ‘<?php single_tag_title(); ?>’</h2>
    Right now for all category pages is_category() the text
    'More articles about' is displayed.

    I need an additional clause that displays
    'More articles from' instead for only 1 specific categors:
    the category guest-bloggers:
    is_category(guest-blogger)

    I just don't know how to do the correct php syntax to separate between these 2 variations of category.

    You can find and test it in the archive.php of the news theme.

    Conditional tags documentation is here:
    Conditional tags

    Please Help me...Thank You..

Topic Closed

This topic has been closed to new replies.

About this Topic