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.
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
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.
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.
ok, so I paste that code in my editor under index.php then what do I do?
thanks,
Go and add widgets to your new area via Admin/Appearance/Widgets.
Whenever I paste that code in all it does to my site is add a giant block with all my recent posts.
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?
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.
Can anyone point me in the right direction
thanks a lot
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().