Support » Themes and Templates » Sidebars (help!)

  • Hey all.

    I have a three column “Marketplace” theme employed on

    Here’s what I need: the far right column to be empty on every page except for one (Workshops).

    Is that possible?

    A point in the right direction would be great.


Viewing 6 replies - 1 through 6 (of 6 total)
  • I poked around and found the “is_page” thing.

    What is wrong with this code?
    `<div id=”rightcolumn”>
    <php if is_page(19) {
    <ul class=”sidemenu”>
    <?php wp_get_archives(‘type=postbypost&limit=5’); ?>


    <div id="rightcolumn">
    <?php if( is_page(19) ) { ?>
    <ul class="sidemenu">
    <?php wp_get_archives('type=postbypost&limit=5'); ?>
    <?php } ?>

    Or to make it a tad more readable for future generations:

    <div id="rightcolumn">
    <?php if( is_page(19) ) : ?>
    <ul class="sidemenu">
    <?php wp_get_archives('type=postbypost&limit=5'); ?>
    <?php endif; ?>

    With each of those, I got syntax errors. For the first, it was for the “unexpected } in Line 6,” for the second it was the “endif” that threw things off.

    When I remove them, it doesn’t act any differently from what I had before…


    I appreciate your input.

    Oops. I am *not* paying attention tonight…

    Missed the ? in the initial opening <?php tags. Fixed in code above.

    This is great, I really appreciate it…

    One last thing, and I promise, this is it: I also need it to appear when viewing posts from a particular category. I read up on the conditional tags, and saw the “in_category” tag…I tried to put it into the code a few different ways, but haven’t found the right spot.

    If I’m looking to display it also on posts that are in category 5, where do I add that to the code?

    The help is muuuch appreciated. Thanks!

    It depends on what is meant by “viewing posts from a particular category.”

    If you mean when on a category query, you’ll want to look at the is_category() conditional:

    On a single post page you may need a little tweak, since in_category() is considered more of an ‘in The Loop‘ function and may lack the post object (which it needs) outside it. For this just scope $post to global before using in_category().

    A combination of the conditional tests in one if statement for this would look like (assumes category 5):

    global $post;
    if( is_page(19) || is_category(5) || (is_single() && in_category(5)) ) :

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sidebars (help!)’ is closed to new replies.