Page 1 of 1

Different slider on each page. IF function

Posted: Fri Feb 04, 2011 4:06 pm
by timmydeleu
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

Re: Different slider on each page. IF function

Posted: Fri Feb 04, 2011 6:56 pm
by timmydeleu
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.

Re: Different slider on each page. IF function

Posted: Fri Feb 04, 2011 7:05 pm
by timmydeleu
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); }; ?>