Forums

PHP IfIsset (2 posts)

  1. georgerobbo
    Member
    Posted 2 years ago #

    Can someone help me with this PHP IF statement. I want to say if the single_month_title is true then do nothing but if it isn't set then display the category.

    <?php if(isset($_GET['single_month_title'])) { } else { ?><?php the_category(); ?><?php }; ?>

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    <?php
    $smt= single_month_title( '',false );
    if ($smt) {
    echo $smt;
    } else {
    the_category();
    }
    ?>

    Because of the_category(), use this in The Loop.

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    Template_Tags/single_month_title

Topic Closed

This topic has been closed to new replies.

About this Topic