Add Widget Area to Home Page Only – Code Needed

Community Forums Forums Design Tips and Tricks Add Widget Area to Home Page Only – Code Needed

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  braddalton 1 year, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10729

    TonySan1
    Participant
    Post count: 20

    Hi 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 600×400 widget area. Any help would be really appreciated. :-)

    Thnk you

    TonySan1

    #10731

    braddalton
    Participant
    Post count: 10662
    #10775

    TonySan1
    Participant
    Post count: 20

    Thank 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”>’,     ) );

    #10864

    TonySan1
    Participant
    Post count: 20

    Hi 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”>’,     ) );

    #19205

    braddalton
    Participant
    Post count: 10662

    Try 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


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.