Different slider on each page. IF function
-
I’m trying to figure out how to make this work. I have an image slider in the header of my website. The slider has a piece of code that looks like this.
<?php if (function_exists(‘premium_slider_center’)){ premium_slider_center(4); }; ?>
What I want to do is when someone click on a page they get a different slider. I can call a different slider simply by changing the slider number, for instance
<?php if (function_exists(‘premium_slider_center’)){ premium_slider_center(3); }; ?>I am new to php but I tried a few things anyway.
if(is_page(‘6’)){echo ‘<?php if (function_exists(‘premium_slider_center’)){ premium_slider_center(4); }; ?>’;}
if(is_page(’79’)){echo ‘<?php if (function_exists(‘premium_slider_center’)){ premium_slider_center(3); }; ?>’;}I also tried
<?php if (is_page(‘6’))(function_exists(‘premium_slider_center’)){ premium_slider_center(4); }; ?>’;}
<?php if (is_page(’79’))(function_exists(‘premium_slider_center’)){ premium_slider_center(3); }; ?>’;}But I’m obviously doing something wrong and I don’t really understand what I’m doing just yet. I’ll keep reading but I hope someone can push me in the right direction.
Timmy
- The topic ‘Different slider on each page. IF function’ is closed to new replies.