• Resolved mikesd

    (@mikesd)


    I’m trying to have different content in my rigth.php and left.php for every category. I’ve looked hard and can’t find enough to make a good guess on how to do this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you’re talking about the template for a particular category, there are several ways to do this.

    One is have separate templates for each category. category-2.php for example, if it appears in your theme’s directory, will automatically load whenever someone views your category that has ID #2.

    Another is to get the current category’s ID by calling get_query_var('cat')
    so you could do something like
    if ( '2' == get_query_var('cat') ) {
    include('right.php');
    }

    Thread Starter mikesd

    (@mikesd)

    thanks for the reply. i figured it out by using
    <?php } elseif( is_category(‘1’) ) { ?>
    ———-
    <?php endif; ?>
    loop in my right.php and left.php… theres a lot of code in those two files now so there might be an easier/cleaner way to do it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Unique right.php and left.php per Category’ is closed to new replies.