Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding Genesis Responsive Slider only to home page
- This topic has 16 replies, 3 voices, and was last updated 9 years, 5 months ago by bhaynet1.
-
AuthorPosts
-
June 17, 2014 at 12:41 pm #110222Lisa at OGMember
So I am working with the latest version of the Beautiful Pro Child Theme. I have used Genesis Simple Hooks to create a Home Slider widget to go just below the nav. I only want the slider on the home page -- not on any other page. I tried using a plugin called Widget11 to hide it on all other pages but it is not working.
Can anyone tell me the easiest way to allocate the slider only to the home page?
http://www.originalginger.com/demos/seattledog/June 17, 2014 at 2:29 pm #110251badlydrawnbenMemberHi Lisa,
If you're using Simple Hooks then try this in the box and make sure the 'Execute PHP in this hook' tickbox is ticked
<?php if ( is_front_page() ) { [put your slider shortcode or php code here]; } ?>
Ben
June 17, 2014 at 2:35 pm #110255Lisa at OGMemberHi there,
I'm not that strong with php. This is what I currently have in the simple hooks box:
<div class="home-slider">
<?php dynamic_sidebar( 'home-slider' ); ?>
</div>There is NO shortcode. We used the genesis responsive slider plugin inside a new widget we set up. Are you able to help further?
June 17, 2014 at 2:52 pm #110260badlydrawnbenMemberOK - try this in the Simple hooks box:
<?php if ( is_front_page() ) { return '<div class=”home-slider”>'; dynamic_sidebar( ‘home-slider’ ); return '</div>'; } ?>
June 17, 2014 at 3:45 pm #110269Lisa at OGMemberThanks for offering your help. Unfortunately, the slider has now completely disappeared from all pages. 🙁
June 17, 2014 at 4:16 pm #110275badlydrawnbenMemberSorry, because this is directly in Genesis Hooks and not inside a function then 'return' might not work.
<?php if ( is_front_page() ) { echo '<div class="home-slider">'; dynamic_sidebar( 'home-slider' ); echo '</div>'; } ?>
Should do though - it works on mine anyway.
Ben
June 17, 2014 at 4:28 pm #110279Lisa at OGMemberYou are super genius - LOL! Thank you so much for your assistance. It is now working. Much appreciated. 😉
October 20, 2014 at 3:48 pm #128489bhaynet1MemberHi - I am trying to model your slider on Seattle Dog - looks absulutely wonderful!
However I am not doing it correctly - no luck!
Can you please list exact steps and any widgets you used to to get the full width slider to display please?
I still want to use the "Content/Sidebar" below the slider as you have on your homepage.
Thanks so very much!
Barbara
October 20, 2014 at 4:07 pm #128493Lisa at OGMemberHi bhaynet,
Sure. We just registered a new widget. See http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar for information on how to do that.
Second, we used Genesis simple hooks to be able to display the sidebar once we registered it by adding the php code as per the thread above (thanks to badlydrawnben).
Third, you need to install the Genesis responsive slider plugin. Then, from the widget area move the Genesis Responsive Slider sub widget inside the new one you just created and set up the Genesis Responsive Slider the way you normally would.
Hope this helps.
You'll need to style the slider using CSS if you want to change the width or background etc.
October 20, 2014 at 6:14 pm #128515bhaynet1MemberHi -
Thanks for your quick response! I've registered the new sidebar widget - however my slider is now below the navs & the "background" image.
Here's the link to the homepage: http://www.hiddenpondtreefarm.com/HP_NEW_SITE/
How to I make it display directly under the main nav at full width (1850 x 498) please?
Do I need to get rid of the background image somehow?
Thank you!
October 20, 2014 at 6:22 pm #128517Lisa at OGMemberYou are using a secondary navigation which we didn't use in our design. You just need to put your php in a different place in Genesis Simple Hooks. You may have it in the wrong place. Try installing the plugin - Genesis Visual Hooks. will help you determine where in Simple Hooks the php should go.
To get the slider full width you will need to adjust your css. You can use firebug to see what code we have used in our css to accomplish this.
We did not use the background banner at the top of the home page in our design. We edited it out from the home page in CSS and just used the slider instead.
October 20, 2014 at 7:09 pm #128522bhaynet1MemberThank you!
I do believe I have the code from above in the correct Genesis Hooks box: genesis-before-sidebar-wrap.Also - got rid of the background image & the secondary nav bar.
I looked at your CSS via firebug & added that to my css as well.
However - something is funky somewhere - I've got the image size I want however it's now pushed all the way to the right & there's a border around it.
Anything else I should have added to the CSS to make this centered & get rid of the gray border?
Thank you!
October 20, 2014 at 8:11 pm #128539Lisa at OGMemberFrom what I can see, it looks like you've put your code within the site-inner container which has a max-width of 1140px...your slider is 1850px wide and as a result it won't fit within site-inner. A full width slider below the navigation needs to be outside of site-inner.
So....You need to revisit the steps of registering your widget so that it is between nav-primary and site-inner. Once you've done that, then you can add your slider code again. Make sure that the css for the wrap within your slider widget has a max-width that is set to none.
October 21, 2014 at 8:59 am #128646bhaynet1MemberHi Lisa -
To register the sidebar - I followed the instructions at the link you listed here: http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar
Also - in following the visual hook guide - it seemed to me that the correct place in the Simple Hooks plugin would be:
'genesis_after_content_sidebar_wrap'
With regard to registering the widget "so that it is between nav-primary and site-inner" - do you mean in hte functions.php? If so - we're the instructions on nicks site incorrect?
Thank you.
October 21, 2014 at 6:48 pm #128698Lisa at OGMemberNo, Nick's instructions are correct but when placing your php you need to choose a place in simple hooks that is not inside the site-inner container.
October 22, 2014 at 4:42 am #128733bhaynet1MemberAHh - thank you very much!
I guess my confusion is where in hte genesis hooks guide? I chose to place the code in the hook box: ‘genesis_after_content_sidebar_wrap’
This seemed to be the right place but I guess not!
October 23, 2014 at 12:36 pm #128872bhaynet1MemberThank you very much!
-
AuthorPosts
- The topic ‘Adding Genesis Responsive Slider only to home page’ is closed to new replies.