No worries Mali, PHP errors are generally pretty helpful. They will tell you if the code has something it wasn’t expecting, or is missing something it was, and often will at least tell you the line the error is on.
The documentation on conditional tags is a big help with setting up conditionals like this.
First, you are echoing the meteor_slideshow
function, you don’t need to do that, it should look just like this:
<?php if ( function_exists( "meteor_slideshow" ) ) { meteor_slideshow( "home", "" );}?>
I would double check and confirm that you have the page titles correct, and that you have the slideshow slugs correct. In fact I would test the slideshows one at a time without the conditions, make sure they work, and test the conditions separately with just a simple echo, make sure each piece is functioning.
Also watch the structure of that conditional and make sure it resolves. Like with an else
, you would just put what the default would be, not another condition. To add another condition use an elseif
, and then either end it, or set a default with an else
.
Try using this code and see if it works for you:
<?php if ( is_page( 'Home' ) ) {
if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "home", "" ); }
} elseif (is_page( 'About Us' ) ) {
if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "training", "" ); }
} else {
//Put your default content here
} ?>