Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save the-nerdery-dot-info/5d3044658be69a62ce87bfe445b010f6 to your computer and use it in GitHub Desktop.
Save the-nerdery-dot-info/5d3044658be69a62ce87bfe445b010f6 to your computer and use it in GitHub Desktop.
Add a full-width slider to Storefront (meta slider in example)
// Don't copy this opening PHP tag if your file already has one. That breaks things.
<?php
function marce_slider_before_storefront_content () {
// If the template is not the homepage (template-homepage.php), don't display.
if ( ! is_page_template( 'template-homepage.php' ) ) {
return false;
}
// If it is the homepage, add this meta slider shortcode
echo do_shortcode( '[metaslider id=586]');
}
add_action('storefront_before_content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment