Skip to content

Instantly share code, notes, and snippets.

@mikeyarce
Last active June 24, 2017 00:43
Show Gist options
  • Save mikeyarce/da8e8127a56202200e4cfc0cda55c2a2 to your computer and use it in GitHub Desktop.
Save mikeyarce/da8e8127a56202200e4cfc0cda55c2a2 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