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
Different slider on each page. IF function
Moderator: General Moderators
-
timmydeleu
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 04, 2011 4:01 pm
-
timmydeleu
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 04, 2011 4:01 pm
Re: Different slider on each page. IF function
I just found something that almost works
<?php if (is_page('6') AND function_exists('premium_slider_center')) { premium_slider_center(4); }; ?>
<?php if (is_page('79') AND function_exists('premium_slider_center')) { premium_slider_center(3); }; ?>
http://www.kohkoodguide.com/facilities/
The problem is it splits the sliders up on the second page.
<?php if (is_page('6') AND function_exists('premium_slider_center')) { premium_slider_center(4); }; ?>
<?php if (is_page('79') AND function_exists('premium_slider_center')) { premium_slider_center(3); }; ?>
http://www.kohkoodguide.com/facilities/
The problem is it splits the sliders up on the second page.
-
timmydeleu
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 04, 2011 4:01 pm
Re: Different slider on each page. IF function
got it, thois was the correct code <?php if (is_page('6') AND function_exists('premium_slider_center')) { premium_slider_center(4); }; ?>
<?php if (is_page('79') AND function_exists('premium_slider_center')) { premium_slider_center(5); }; ?>
<?php if (is_page('79') AND function_exists('premium_slider_center')) { premium_slider_center(5); }; ?>