• 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter timmydeleu

    (@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.

    Thread Starter timmydeleu

    (@timmydeleu)

    God it this 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); }; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different slider on each page. IF function’ is closed to new replies.