Title: Sidebars (help!)
Last modified: August 19, 2016

---

# Sidebars (help!)

 *  [driplabcom](https://wordpress.org/support/users/driplabcom/)
 * (@driplabcom)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/)
 * Hey all.
 * I have a three column “Marketplace” theme employed on CreatingYourJourney.com.
 * 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.
 * THANKS!

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

 *  Thread Starter [driplabcom](https://wordpress.org/support/users/driplabcom/)
 * (@driplabcom)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695051)
 * I poked around and found the “is_page” thing.
 * What is wrong with this code?
    `<div id=”rightcolumn”> <php if is_page(19) { 
   <h1>Workshops</h1> <ul class=”sidemenu”> <?php wp_get_archives(‘type=postbypost&
   limit=5’); ?>
 * </div>’
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695053)
 *     ```
       <div id="rightcolumn">
       <?php if( is_page(19) ) { ?>
       <h1>Workshops</h1>
       <ul class="sidemenu">
       <?php wp_get_archives('type=postbypost&limit=5'); ?>
       <?php } ?>
       </div>
       ```
   
 * Or to make it a tad more readable for future generations:
 *     ```
       <div id="rightcolumn">
       <?php if( is_page(19) ) : ?>
       <h1>Workshops</h1>
       <ul class="sidemenu">
       <?php wp_get_archives('type=postbypost&limit=5'); ?>
       <?php endif; ?>
       </div>
       ```
   
 *  Thread Starter [driplabcom](https://wordpress.org/support/users/driplabcom/)
 * (@driplabcom)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695056)
 * 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…
 * …thoughts??
 * I appreciate your input.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695058)
 * Oops. I am *not* paying attention tonight…
 * Missed the `?` in the initial opening `<?php` tags. Fixed in code above.
 *  Thread Starter [driplabcom](https://wordpress.org/support/users/driplabcom/)
 * (@driplabcom)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695133)
 * 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!
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695235)
 * 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:
 * [http://codex.wordpress.org/Conditional_Tags#A_Category_Page](http://codex.wordpress.org/Conditional_Tags#A_Category_Page)
 * On a single post page you may need a little tweak, since in_category() is considered
   more of an ‘in [The Loop](http://codex.wordpress.org/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):
 *     ```
       <?php
       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.

## Tags

 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [formatting](https://wordpress.org/support/topic-tag/formatting/)

 * 6 replies
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 4 months ago](https://wordpress.org/support/topic/sidebars-help/#post-695235)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
