Ad
How To Show Smart Slider Only On Home Page Of Wordpress Blog
I am using Astra theme and Smart Slider 3 plugin in WordPress. I used Astra Hooks plugin to show slider on header and it worked but the slider is displayed on all pages.
How do I make slider appear on home page header only?
Ad
Answer
wordpress have conditional tags to deal with these problems.
i have not used astra hooks plugin, instead you can use the snippet below and paste it in your functions.php file of your child theme. replace your slider's shortcode with [shortcode_of_your_slider]
and you're good to go.
if you want to change the position of slider checkout astra visual hooks . right now im using the astra_header_before
you cant change it with what ever you want
add_action( 'astra_header_before', 'shalior_display_header_on_front_age' );
function shalior_display_header_on_front_age() {
if(is_front_page()){
echo do_shortcode('[shortcode_of_your_slider]');
}
}
Ad
source: stackoverflow.com
Related Questions
- → CORS missmatch because of http
- → Building sitemap for 2 wordpress install under 1 domain
- → How to remove empty elements after class?(jQuery)
- → Get width of an element and apply to another relative to the first one?
- → How to remove caption p class from wordpress?
- → 301 Redirection from no-www to www in wordpress
- → Laravel 5 routing using prefix
- → WordPress - Header position Top, Left &Right
- → how to add rel=nofollow to some specific external links in wordpress
- → octobercms install error: database is not empty?
- → How to edit the index page of wordpress theme?
- → How to select a Post Type (Wordpress) to pass a filter in head?
- → What sort of URL structure should be used to display AMP HTML vs vanilla HTML
Ad