Community Forums › Forums › Archived Forums › General Discussion › Agency Theme Static Homepage with Slider
- This topic has 8 replies, 3 voices, and was last updated 10 years, 5 months ago by
dpbklyn.
-
AuthorPosts
-
February 25, 2013 at 5:45 am #22668
TowelsRus
MemberHi,
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
February 25, 2013 at 6:48 am #22676Brad Dalton
ParticipantAdd 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/
February 25, 2013 at 7:12 am #22683TowelsRus
MemberThanks Brad, I'll have a play with it.
Regards
Craig
April 5, 2013 at 10:30 am #33317dpbklyn
MemberHello 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, LLCApril 5, 2013 at 10:31 am #33318dpbklyn
MemberHello 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, LLCApril 5, 2013 at 11:04 am #33326dpbklyn
MemberWhoops, 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, LLCApril 5, 2013 at 11:30 am #33331Brad Dalton
ParticipantApril 5, 2013 at 11:37 am #33333dpbklyn
MemberBrad,
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, LLCApril 5, 2013 at 1:10 pm #33351dpbklyn
MemberYAHOO!!!
Thank you, All I have to do is style it now.
dp
David Phillips
Owner, St. Louis IT Solutions, LLC -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.