This is because the slideshow function you added already has closing and opening PHP tags and you added it within PHP, so the your PHP is closing early.
Also, this function doesn’t need to be echoed, the function will already echo the slideshow. I wouldn’t really recommend doing multi-line echoes like that, it leaves more room for error and makes it harder to tell what is PHP and what is HTML.
If you added it all as PHP, with no open or close tags for this section, it should work:
function woo_add_banner_notice () {
// Echo an alert box
echo '<div class="banner_container">';
echo '<div class="banner_container_wrapper">';
echo '<div class="banner_box">';
echo '<div class="banner_box_image">';
if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); }
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
} // End woo_add_banner_notice()
add_action( 'woo_content_before', 'woo_add_banner_notice' );
Thanks a lot Josh!
If it isn’t too much trouble i have another question.
Is it possible to show this slideshow only on the front page and target a specific slideshow for example: “slideshow_2”?
No problem! You can do this with conditional tags, is_front_page will check to make sure it is the front page. And for multiple slideshows with Meteor Slides, you can specify one in the function parameters.
The end result should look like this:
function woo_add_banner_notice () {
// Echo an alert box
if ( is_front_page() ) {
echo '<div class="banner_container">';
echo '<div class="banner_container_wrapper">';
echo '<div class="banner_box">';
echo '<div class="banner_box_image">';
if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "slideshow_2", "" ); }
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
} // End woo_add_banner_notice()
add_action( 'woo_content_before', 'woo_add_banner_notice' );