I have a checked a few links but nothing seems to for me in getting the attribute value of a shortcode so that I can use it in a condition.
function bf_shortcode_slideshow($atts) {
extract(shortcode_atts(array(
'location' => ''
), $atts));
ob_start();
if ( $location = 'home' ) {
classslider = 'homeslider';
}
include(dirname(dirname(__FILE__)) . '/templates/slideshow.php');
return ob_get_clean();
}
add_shortcode('rotator', 'bf_shortcode_slideshow');
In the slideshow.php
I have a
echo 'classslider=' . $classslider;
My result for $classslider
is blank ( nothing is displayed )
Is there another way you should compare $location
to a string value set ?