WordPress.org

Ready to get started?Download WordPress

Forums

Conditional Statement stop image scroll (5 posts)

  1. Raymond
    Member
    Posted 2 years ago #

    Hello all,

    I have a theme that utilizes an image scrolling feature in the background of every page. I have a few pages that I would like to setup a conditional statement which blocks the image scroll. Basically to allow the user to focus on solely the content in the pages.

    The theme is setup with templates that achieve different features. Including blogs, portfolios, contact pages, etc... Any ideas on how to create a conditional statement that isolates the pages in question?

    Your help is greatly appreciated. Thank you and have a great day.

  2. deepbevel
    Member
    Posted 2 years ago #

    You have to find the code that creates the scroller, then you can do something like this:

    <?php if (is_page('page-slug')) { ?>
    slider code here
    <?php } ?>

    If you need to do somethig else on another page instead of the slider:

    <?php if (is_page('page-slug')) { ?>
    slider code here
    <?php } ?>
    
    <?php } elseif (is_page('page-slug')) { ?>
    do something else
    <?php } else { ?>

    instead of "is page" you can also use "in category" with the category slug, which may be useful:)

  3. Raymond
    Member
    Posted 2 years ago #

    Thank you very much for your input.

    I didn't write the theme, it was a purchased theme since I'm very much a newb at html! :/. I'm pretty sure the code is somewhere in the theme's "includes" folder. I'll have to double check with the theme author since I'm more worried about messing anything up lol.

    The theme I purchased is called "Imperia" and I found it on themeforest.

    I'll try and reach the author and figure out how to implement what you said.

    Thank you again for your help. :)

  4. deepbevel
    Member
    Posted 2 years ago #

    As you wish, however this is nothing fancy, you don't have to write themes to implement this. It's a basic conditional. you might find that the slider is called via a template tag in your page.php file, may not be hard to find and try it out.

    you should learn how to make a child theme, that way you can quickly revert any changes. But only do what you're comfortable with:)

  5. Raymond
    Member
    Posted 2 years ago #

    I definitely would like to do it myself and resolve the issue quickly. I'll look to see if I can locate the slider function code myself and use the first code you described to have the desired effect.

    Thank you for your help. I'll report back with my findings.

    Wish me luck!

Topic Closed

This topic has been closed to new replies.

About this Topic