Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] Adding widget area to home/center column, but not post/page (http://forum.bytesforall.com/showthread.php?t=16782)

JennyD Feb 16, 2012 08:04 PM

[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)?

juggledad Feb 17, 2012 02:59 AM

Just add some logic before the widget area code i.e.
HTML Code:

if (is_front_page()) {.......new widget area code here....}

JennyD Feb 17, 2012 11:35 AM

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:38 PM.

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