• Hi,

    I’d like to add into my sidebar.php something like this:

    If we are in category ID = 1: write-> : LOrem Ipsum 1
    If we are in category ID = 2: write-> : Lorem Ipsum 2

    <php if (in_category(1)) echo “Lorem Ipsum 1”; ?>
    Does not work.

    Help…

Viewing 3 replies - 1 through 3 (of 3 total)
  • try is_category

    this will only work on category archive pages, while you browse.

    Thread Starter karolha

    (@karolha)

    Ivovic, I luv you, but…

    <?php
    if(is_category(’14’))
    echo ‘Lipsum’;
    ?>

    Does not work… why?

    because you’re not on a category archive page?

    be specific about where you want to use this please – sidebars are everywhere, saying “sidebar” isn’t enough – what page will you be viewing? single post? /category/catname? the home page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘In whitch category are we?’ is closed to new replies.