Forums

How to check $static, like before with $m and $p etc. (4 posts)

  1. moxie
    Member
    Posted 4 years ago #

    To give a page a correct title in 1.2.2 I checked which variable was present on that page:

    <?php
    $m = $_REQUEST["m"];
    $p = $_REQUEST["p"];
    $cat = $_REQUEST["cat"];
    $s = $_REQUEST["s"];
    if($s){
    echo "Gevonden op " ".$s." "";
    } else if ($m=="" && $p=="" && $cat==""){
    echo "Meest Recent";
    } else {
    single_cat_title();
    single_month_title(" ");
    single_post_title(" ");
    }
    ?>

    I want to add a title for static pages I call through index.php?static=341, but adding && $static!="" doesn't work.

    Someone any idea's on this?
    I'm also puzzled because the link I use states index.php?static=341 and the url says index.php?page_id=341

  2. mdawaffe
    Member
    Posted 4 years ago #

    is_page() should return TRUE if it's a page you're viewing.

    You might try is_month(), is_category(), is_single(), etc. (most of them are defined in wp-includes/functions.php) for other stuff too.

  3. mdawaffe
    Member
    Posted 4 years ago #

  4. moxie
    Member
    Posted 4 years ago #

    Thanks for the link! That solves it :).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.