Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Where to place the conditional if_front_page tag


  #1  
Old Nov 24, 2010, 08:35 PM
webgurl's Avatar
webgurl
 
59 posts · Nov 2010
WordPress 3.0/Atahualpa 3.4.9/Firefox 3.6.12/XP sp3/
Help [SOLVED] Where to place the conditional if_front_page tag

I've read Flynn's 2009 post about creating new widgets again and again, and I still can't decide where to put the php conditional statement to have the new widget area appear only on the first page.

I have the widget area created on my static front page, and the widget is running on every page.

I know I need the php is_front_page to stop it from running on all pages, and Flynn says to put it in index.php, but I don't see the <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(X) ) : endif; ?> statement he says should be in the template to make the widget run. It's running, so it must be somewhere, but I just can't find it!

I am running default templates for all pages; landing page is set to static in wp>general>Reading options.

Thanks for any help you can give. Site is www.greenvilleconcerts.com/blog wp3.0 ata 3.4.9
  #2  
Old Nov 24, 2010, 08:50 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
In the place where you are putting the new widget area code put this instead.

HTML Code:
<?php if( is_front_page() ) bfa_widget_area('name=My new widget area'); ?>
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Nov 25, 2010, 02:59 PM
webgurl's Avatar
webgurl
 
59 posts · Nov 2010
WordPress 3.0/Atahualpa 3.4.9/Firefox 3.6.12/XP sp3/
Sorry to be such a noob regarding wordpress, but I take it you mean to replace the first line of code only, leaving the div on the following line as it is? Thx a lot.
  #4  
Old Nov 25, 2010, 07:20 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I don't know what first line of code you mean. Where did you put the code to create the new widget area? Or where do you want the new widget area to appear?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Nov 26, 2010, 12:23 PM
webgurl's Avatar
webgurl
 
59 posts · Nov 2010
WordPress 3.0/Atahualpa 3.4.9/Firefox 3.6.12/XP sp3/
Quote:
Originally Posted by lmilesw
I don't know what first line of code you mean. Where did you put the code to create the new widget area? Or where do you want the new widget area to appear?
In ATO>Center Col>Style and Edit center column>Content Above The Loop... I placed this code:

<?php bfa_widget_area('name=My new widget area'); ?>

I don't think I loaded anything else, but in the same place, (Content Above The Loop) right under that line, this code appears:

<div id="my_new_widget_area" class="bfa_widget_area"></div>
<?php /* For MULTI post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_page_links('Top'); ?>

<?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */
if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?>


I've been reading Codex and this forum very regularly for four weeks, but the light bulb isn't going off yet. I'm still trying to piece together the dynamically generated code, template tags, static code, etc and AWO on top of that, to see how it all relates. Sorry if I sound lost.

What I am trying to do is have a static front page with a center column widget area to run the gce widget. The widget runs ok, but I have it on all three pages. I only want it to appear on the first page. Thanks.
  #6  
Old Nov 26, 2010, 01:16 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
OK then... Here is what it appears you currently have in Above the Loop...

HTML Code:
<?php bfa_widget_area('name=My new widget area'); ?>

<div id="my_new_widget_area" class="bfa_widget_area"></div>

<?php /* For MULTI post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_page_links('Top'); ?>

<?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */
if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?>
Take out the first two lines and replace with
HTML Code:
<?php if( is_front_page() ) bfa_widget_area('name=My new widget area'); ?>
You can change the name to something else besides My new widget area. That line could for instance be.
HTML Code:
<?php if( is_front_page() ) bfa_widget_area('name=Front page widget area'); ?>
That way when you look in Appearance>Widgets you will see a widget titled Front page widget area.

The whole Above the Loop area would look like the following when you are done.
HTML Code:
<?php bfa_widget_area('name=Front page widget area'); ?>

<?php /* For MULTI post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_page_links('Top'); ?>

<?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */
if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?>
If you changed the name to my suggestion you will need to go to the Add new widget areas section and delete the My new widget area. Or you could take out the first two lines first then go to ATO>Add new widget areas and delete the widget area. Now go back to Style and edit Center column and add the code as described above.

I hope I haven't confused you with too many words. If I have just ask for clarification where needed.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks

Tags
is_front_page, widget area

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Widget Logic, WP Conditional Tag for multiple pages jslusc Plugins & Atahualpa 1 Nov 6, 2010 09:55 PM
[SOLVED] Trying to put tag and tag description on tag archive pages. c4duser Atahualpa 3 Wordpress theme 2 Jun 5, 2010 02:18 AM
Conditional PHP issue MyJourneytoMillions Center area post/pages 6 Feb 10, 2010 03:11 PM
want to place clickable icons in place of links (Home, About, etc.) agrossman Header configuration & styling 2 Aug 13, 2009 02:45 PM
[SOLVED] Conditional Tag to exclude widget d_random Sidebars & Widgets 8 Jun 2, 2009 07:23 AM


All times are GMT -6. The time now is 07:00 AM.


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