Title: Widget Help (pretty urgent)
Last modified: August 19, 2016

---

# Widget Help (pretty urgent)

 *  [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/)
 * Is there anyway to have a text widget appear on the home/main page without it
   appearing on every single page on the site?
 * Thanks,

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276508)
 * Yes. You can widgetize the index.php file in your theme (for post pages) or page.
   php (for static pages) in conjunction with the is_home() and is_front_page() 
   conditionals. So something like:
 *     ```
       <?php if ( is_home() || is_front_page() ) :
       if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
       <?php endif; endif; ?>
       ```
   
 * should work.
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276509)
 * Please excuse me being a newb, but do I just copy and past that code into my 
   index.php?
 * My site is [http://www.crashthecrease.com](http://www.crashthecrease.com)
 * I have a a text widget on the right hand side the poker one.
 * I only want that to appear on the home/main page.
 * Sorry for my lack of understanding.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276515)
 * The index.php file in your theme is the right file. I’d suggest adding it just
   before, or after, your Google AdSense block if that’s suitable for you.
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276520)
 * ok, so I paste that code in my editor under index.php then what do I do?
 * thanks,
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276523)
 * Go and add widgets to your new area via Admin/Appearance/Widgets.
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276529)
 * Whenever I paste that code in all it does to my site is add a giant block with
   all my recent posts.
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276538)
 * I pasted that code into my index.php again and on my site it added my recent 
   posts and pet everything out of whack.
 * Do i paste it somewhere else then?
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276558)
 * So I tried pasting it in page.php and none of my recent posts came up out of 
   nowhere on the site so thats good but I still did not have a new option under
   widgets.
 *  Thread Starter [curtist](https://wordpress.org/support/users/curtist/)
 * (@curtist)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276585)
 * Can anyone point me in the right direction
 * thanks a lot
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276672)
 * Try editing your theme’s function file and replace:
 *     ```
       <?php
       if ( function_exists('register_sidebar') )
           register_sidebar();
       ?>
       ```
   
 * with
 *     ```
       <?php
       if ( function_exists('register_sidebars') )
           register_sidebars(2, array('name'=>'%d'));
   
       ?>
       ```
   
 * Then try using:
 *     ```
       <?php if ( is_home() || is_front_page() ) :
       if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
       <?php endif; endif; ?>
       ```
   
 * You may also have to amend your sidebar template to use `dynamic_sidebar(1)` 
   instead of `dynamic_sidebar()`.

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

The topic ‘Widget Help (pretty urgent)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/widget-help-3/#post-1276672)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
