Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add Widget Area to Home Page Only – Code Needed
- This topic has 4 replies, 2 voices, and was last updated 12 years ago by
Brad Dalton.
-
AuthorPosts
-
January 9, 2013 at 12:29 pm #10729
TonySan1
MemberHi to you all, I hope you are all doing well. I would like to know if someone could supply the correct code I would need to insert into my Genisis home page .php to call my registerd widget to the home page only. I know how to register the new wigdet in the functions .php but I am stuck with what code I should use and exactly where to insert it in my home page .php. Also the basic css. for a 600x400 widget area. Any help would be really appreciated. 🙂
Thnk you
TonySan1
January 9, 2013 at 12:34 pm #10731Brad Dalton
ParticipantJanuary 9, 2013 at 2:27 pm #10775TonySan1
MemberThank you for the information. I tried to use the code in the article and substituted some of the code with what I thought was needed. Unfortunately I got a Syntax error message. So I gusse I did something wrong. Could you give me an example of what the code would look like? I would like the widgetized area to be 600 x 400 pix above the posts excerpts and below the nav bar. Here is the site URLhttp://internetbusinessmastery.info
By the way Here is the code that i used . See anything wrong?
/** Add the home above content slideshow */ add_action( 'genesis_before_loop', 'lifestyle' ); function lifestyle() {
/** Do nothing on page 2 or greater */ if ( get_query_var( 'paged' ) >= 2 ) return;
genesis_widget_area( 'home-above-content-slideshow', array( 'before' => '<div class="home-above-content-slideshow-widget-area">', ) );
January 9, 2013 at 9:45 pm #10864TonySan1
MemberHi Guys I am still searching and looking for an answer to my question, so far I have been hitting brick walls. Maybe if I show you the code that I used to register my widget in the "functions .php" you can help me with the code to put in my Genisis "home page .php" so here it is:
genesis_register_sidebar( array(
'id' => 'home-above-content-slideshow',
'name' => __( 'Home Above Content Slideshow', 'lifestyle' ),
'description' => __( 'This is the sidebar above the content.', 'lifestyle' ),
) );Can anyone show me what code I need now to put in my home page .php to call my widget to the page? I tried this but it did.'t work:
/** Add the home above content slideshow */ add_action( ‘genesis_before_loop’, ‘lifestyle’ ); function lifestyle() {
/** Do nothing on page 2 or greater */ if ( get_query_var( ‘paged’ ) >= 2 ) return;
genesis_widget_area( ‘home-above-content-slideshow’, array( ‘before’ => ‘<div class=”home-above-content-slideshow-widget-area”>’, ) );
February 9, 2013 at 5:57 am #19205Brad Dalton
ParticipantTry this: http://pastebin.com/u/braddalton
You can change the location to display the widget area content on the home page by changing the genesis hook
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.