WordPress.org

Ready to get started?Download WordPress

Forums

If Page & List of Responses (6 posts)

  1. dvent
    Member
    Posted 1 year ago #

    Hi All,

    I am using the following to display a slider:

    <?php
    		if ( is_page(80) ) {
    	?>
        <?php putRevSlider("slider80") ?>
        <?
    		} else {
    		}
    	?>

    Basically if the page is 80, it'll show the slider called slider80.

    If I had a list of pages e.g. 80,90,100 and a list of sliders e.g. slider80, slider90, slider100

    Is there a clever way I can write my if statement to show the right slider on the relevant page?

    Thanks
    dvent

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Which theme are you using?

  3. dvent
    Member
    Posted 1 year ago #

    960 Blank Canvas

  4. dvent
    Member
    Posted 1 year ago #

    Any more help anyone?

  5. michael.mariart
    Member
    Posted 1 year ago #

    Do you want to do this for any page, or for a set list of pages?

    For any page:

    putRevSlider("slider".$post->ID)

    For a range of pages:

    $pages = array (80, 100, 120);
    if (in_array ($post->ID, $pages)) {
      putRevSlider("slider".$post->ID)
    }
  6. dvent
    Member
    Posted 1 year ago #

    ah that's it thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic