Forums

[resolved] variable in the category template (4 posts)

  1. taghaboy
    Member
    Posted 6 months ago #

    i use a config.php with variables as

    <?php
    $cat01 = "sky";
    $cat02 = "sea";
    ?>

    and i'd like to add $cat01 to this category template:

    <?php if (is_category('Category A')) { ?>

    how can i add $cat01 in place of Category A

    Thanks

  2. stvwlf
    Member
    Posted 6 months ago #

    <?php if (is_category("$cat01")) { ?>

    Make sure config.php is in scope in your category template i.e. included on the page.

  3. taghaboy
    Member
    Posted 6 months ago #

    Thanks i will test it.

  4. taghaboy
    Member
    Posted 6 months ago #

    It work, thanks a lot.

Reply

You must log in to post.

About this Topic