[SOLVED] Adding widget area to home/center column, but not post/page
Goal: My widget area as what displays on the front page/center column, and the single post display and page display normal. Ideally, able to display one or more posts before the widget, but that's not a must.
I found myself able to add PHP code to add a widget area to the center column, by editing index.php. Any suggestions? I was also able to comment out the posts, since I can't seem to set it to display 0. On the front page, it works fine! On a single-post page, I get whatever text I've added for the post, plus the widget. Oops. I tried "Widgets on Pages" plugin, but it was having issues; I would consistently get a 404 error upon first viewing the site, and have to refresh for the widget to show up. I also had difficulties in styling the widget output when showing on a page vs. on the front/index page. Atahualpa 3.7.3 WordPress 3.3.1 Note: If I were to want to display posts on the front page -- excerpt and some limited info -- where would I edit what gets displayed (parts/styling)? |
Just add some logic before the widget area code i.e.
HTML Code:
if (is_front_page()) {.......new widget area code here....} |
Thanks, that worked! More specifically:
<?php if (is_front_page()) {bfa_widget_area('name=WidgetName');} ?> I'll look around for styling info and make a separate thread if needed for that question. Thanks for the quick response! |
All times are GMT -6. The time now is 12:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.