Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] How do I restrict which pages my custom sidebars show-up on? (http://forum.bytesforall.com/showthread.php?t=8772)

wordy_gurdy Aug 8, 2010 09:15 AM

[SOLVED] How do I restrict which pages my custom sidebars show-up on?
 
:confused:

I decided to create 4 additional sidebars for my static front page (for custom linked categories that link to a unique page), so I basically took a short-cut and used my footer widget (that has four columns), modified the width, and added it in the content_below_loop section. The columns display perfectly, but they are also showing up on ALL of my pages. How do I restrict which pages my custom sidebars/widgets show-up on?

Thanks,
Rachel

juggledad Aug 8, 2010 09:18 AM

put a php if statement around - go here to see the tests you can use - http://codex.wordpress.org/Conditional_Tags

wordy_gurdy Aug 8, 2010 09:54 AM

Quote:

Originally Posted by juggledad (Post 39698)
put a php if statement around - go here to see the tests you can use - http://codex.wordpress.org/Conditional_Tags

Thanks "juggledad". I did just as you suggested, and copied some code from the wordpress codex page to test it out. But the widgets are still showing up on all of my pages. Well, my front page is set to Test Page, and the columns show-up fine, but they are still showing on my About page. This is the conditional tag and "footer" widget code I'm using for my additional four widgets on my Test Page:

<?php if (!is_home()) {?>
<?php bfa_widget_area('name=My widget area&cells=4&align=1&align_2=9&align_3=7&width_4=1 65&before_widget=<div id="%1$s" class="header-widget %2$s">&after_widget=</div>'); ?>
<?php }?>

So, I wrapped the code in the conditional tag but it didn't work. I also tried <?php if (!is_front_page.., but the widgets didn't show up at all. I also tried removing the <?php from before bfa_widget_area, but doing that disabled my widgets as well. Is there something in the widget code that I need to add or change?

Thanks again for your help,
Rachel

juggledad Aug 8, 2010 10:29 AM

the statement
HTML Code:

<?php if (!is_front_page..
says 'if this is NOT the front page...' therefore, every page but the front page will get the action. Try with just
HTML Code:

<?php if (is_front_page..

wordy_gurdy Aug 8, 2010 11:02 AM

THANK-YOU! It worked. You are awesome "juggledad".


All times are GMT -6. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.