Agency Theme Static Homepage with Slider

Community Forums Forums General Discussion Agency Theme Static Homepage with Slider

This topic is: resolved

Tagged: , ,

This topic contains 8 replies, has 3 voices, and was last updated by  dpbklyn 1 year ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #22668

    TowelsRus
    Participant
    Post count: 6

    Hi,

    I wanted to setup our homepage to use the responsive slider widget, however i can only do so if the homepage uses recent posts and is not set to static page.

    Do you know any work around for this?

    Thanks Craig

    #22676

    braddalton
    Participant
    Post count: 7473

    Add a widget area to a static page using this tutorial http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar

    Change the conditional tag to match your custom home page

    is_page('007') or is_home()
    

    Modify this code and change the hook location and conditional tag:

    add_action( 'genesis_after_post_content', 'child_after_post_box' );
    /** Loads a new sidebar after the post on single pages*/
    function child_after_post_box() {
     
        if( is_single() ) {
            echo '<div class="after-post-box">';
                dynamic_sidebar( 'after-post-box' );
            echo '</div>';
        }
    }
    

    or use this and use the Widget Logic plugin http://www.briangardner.com/welcome-text-widget/


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #22683

    TowelsRus
    Participant
    Post count: 6

    Thanks Brad, I’ll have a play with it.

    Regards

    Craig

    #33317

    dpbklyn
    Participant
    Post count: 26

    Hello Brad,

    Thank you in advance.

     

    I am trying to add a slider under the header in my Agency theme and I followed the direction above, but I am not able to see it.  I can see the sidebar in my widgets control panel.  I think I am having trouble identifying the page name/number.  I am using this particular page as my home page (static).  My code is below:

    genesis_register_sidebar( array(
    ‘id’ => ‘after-header-testl’,
    ‘name’ => ‘After Header Slider’,
    ‘description’ => ‘This is a sidebar that goes after the header.’,
    ) );

    add_action( ‘genesis_after_header’, ‘child_after_header_testl_sidebar’ );
    /** Loads a new sidebar after the header */
    function child_after_header_testl_sidebar() {

    if( is_home() ) {
    echo ‘<div class=”after-header-testl”>’;
    dynamic_sidebar( ‘after-header-testl’ );
    echo ‘</div>’;
    }

    }

    Thank you…

    dp


    David Phillips
    Owner, St. Louis IT Solutions, LLC

    #33318

    dpbklyn
    Participant
    Post count: 26

    Hello Brad,

    Thank you in advance.

     

    I am trying to add a slider under the header in my Agency theme and I followed the directions above, but I am not able to see it.  I can see the sidebar in my widgets control panel.  I think I am having trouble identifying the page name/number.  I am using this particular page as my home page (static).  My code is below:

    genesis_register_sidebar( array(
    ‘id’ => ‘after-header-testl’,
    ‘name’ => ‘After Header Slider’,
    ‘description’ => ‘This is a sidebar that goes after the header.’,
    ) );

    add_action( ‘genesis_after_header’, ‘child_after_header_testl_sidebar’ );
    /** Loads a new sidebar after the header */
    function child_after_header_testl_sidebar() {

    if( is_home() ) {
    echo ‘<div class=”after-header-testl”>’;
    dynamic_sidebar( ‘after-header-testl’ );
    echo ‘</div>’;
    }

    }

    Thank you…

    dp


    David Phillips
    Owner, St. Louis IT Solutions, LLC

    #33326

    dpbklyn
    Participant
    Post count: 26

    Whoops, sorry for the duplicate posts…

    UPDATE:

    Here is an update.  When I changed the page name to another non-static page it seems that the slider is finding its way onto the page.  Actually what happens is that the page goes blank when I change the code to have the widget put on that page.  I guess this is progress?

     

    Thank you still…

    dpbklyn


    David Phillips
    Owner, St. Louis IT Solutions, LLC

    #33331

    braddalton
    Participant
    Post count: 7473
    #33333

    dpbklyn
    Participant
    Post count: 26

    Brad,

    Thank you for getting back to me, but it doesn’t seem that I Have access to that repository.  Actually, I can’t find that repo on github.

    The code just populated…never mind.

     

    Thank you,

    dp


    David Phillips
    Owner, St. Louis IT Solutions, LLC

    #33351

    dpbklyn
    Participant
    Post count: 26

    YAHOO!!!

    Thank you,  All I have to do is style it now.

    dp


    David Phillips
    Owner, St. Louis IT Solutions, LLC

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

You must be logged in to reply to this topic.