Home › Forums › Winning Agent Pro Theme › Limit Slider on Listings
Tagged: slider
- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by
richsadams.
- AuthorPosts
- June 12, 2014 at 6:35 pm #3144
richsadams
ParticipantHi Carrie,
I’m using the Genesis Responsive slider in the WAP template on this website:
Currently the slider automatically appears at the top of all pages, posts and listings.
I would like to be able to limit the slider to either just the Home page and/or other specific pages as well as eliminate it completely from all individual listings.
In the Genesis Responsive Slider settings there’s an area where it allows you to limit the slider on a per-listing basis (using the listing ID), but nothing regarding pages, posts or for all listings as a default.
Any advice would be appreciated.
Best wishes and TIA!
- June 13, 2014 at 7:45 am #3150
Carrie Dils
MemberWhat widget area are you using to add the slider to your site? If it’s the Search Bar widget area, that’s intended to show across all pages like you mentioned.
Before I give you more info I want to make sure we’re talking about the same thing – sounds to me like the issue isn’t the slider, but the widget area you’re using to show it. Please confirm?
- June 13, 2014 at 9:29 am #3151
richsadams
ParticipantHi Carrie,
Yes, it’s the search bar widget.
Thanks again!
- June 13, 2014 at 10:20 am #3153
Carrie Dils
MemberFind this in functions.php:
// Add search widget below header. add_action( 'genesis_after_header', 'wap_search_bar' ); function wap_search_bar() { genesis_widget_area( 'search-bar', array( 'before'=> '<div class="search-bar"><div class="wrap">', 'after' => '</div></div>', ) ); }
You can add in a conditional statement to specify where you want it to show. For example, adding this bit will only show it on the home page:
if ( ! is_front_page() ) { return; }
COmbined, the code snippet looks like this:
// Add search widget below header. add_action( 'genesis_after_header', 'wap_search_bar' ); function wap_search_bar() { if ( ! is_front_page() ) { return; } genesis_widget_area( 'search-bar', array( 'before'=> '<div class="search-bar"><div class="wrap">', 'after' => '</div></div>', ) ); }
BEFORE you edit your functions.php, please take a moment to read this tutorial otherwise you can accidentally break your site if you’re cutting and pasting improperly. http://www.carriedils.com/editing-wordpress-site-101/
Also, here’s a tutorial on understanding WordPress conditionals: http://www.carriedils.com/wordpress-conditional-tags/
- June 13, 2014 at 10:50 am #3155
richsadams
ParticipantHi Carrie,
That worked perfectly.
Thank you again!
- AuthorPosts
- You must be logged in to reply to this topic.