WordPress.org

Forums

Easing Slider
[resolved] disable slider in seach-results or certain categories? (11 posts)

  1. digitalPurist
    Member
    Posted 1 year ago #

    hi matthew,

    I like your plugin a lot and I'm using the PRO version with multiple slideshows.

    In some situations it's useful to disable your slider i.e. special search-results or maybe for posts in a specific category like 'mobile'.

    I could use the_excerpt but it disables everything (style, pictures...).
    I'd rather use two different loops:
    - loopSlider.php (shows content including your slider)
    - loopNoSlider.php (displays everything in the post but NOT the slider)

    Is there a PHP-snippet that does the trick?

    Thanks

    http://wordpress.org/extend/plugins/easing-slider/

  2. digitalPurist
    Member
    Posted 1 year ago #

    OK, here is my workaround:
    I simply disabled the slider via CSS.

    A loop with a wrapper for posts without the slider:

    <div class="hideSlider">
        <?php while ( have_posts() ) : the_post(); ?>
            ...
            <?php the_content(); ?>
            ...
        <?php endwhile; // end of the loop. ?>
    </div>

    And the CSS:
    for lite-version:

    div.hideSlider .easingsliderlite {
        display: none;
    }

    for pro-version:

    div.hideSlider .easingsliderpro {
        display: none;
    }
  3. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @digitalPurist, glad you've managed to figure this one out :) You could also try using some WordPress conditionals, such as is_search to completely prevent the slideshow from loading, rather than just simply hiding it.

  4. digitalPurist
    Member
    Posted 1 year ago #

    Hi Matthew,
    yes, hiding the slideshow via css is just a workaround.
    I don't know how to prevent your slideshow from loading.
    the_content() shows the whole article - including your slideshow.
    Is there a PHP-code or a parameter for the_content() that prevent the loading of a particular plugin? I don't know and don't think so ...

  5. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    HI @digitalPurist, I'm not quite sure what you mean. Is this related to disabling the slideshow on search result pages? Did you try putting the slideshow's code inside the conditional mentioned in my last post? Like this:

    <?php
    if ( is_search() ) {
         if ( function_exists('easingsliderlite') ) {
               easingsliderlite();
         }
    }
    ?>
  6. digitalPurist
    Member
    Posted 1 year ago #

    Hi Matthew, in the pro-version it's not working because an argument is needed. i.e.

    <?php
    if ( is_search() ) {
         if ( function_exists('easingsliderpro') ) {
               easingsliderpro(1);
         }
    }
    ?>

    this is enabling a certain slider (no. 1).
    what argument would disable all slider within that loop?
    can I "unload" the function???

    sorry for bothering ...

  7. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    My apologies, misread that you were using Easing Slider "Pro".

    I'm not sure I'm completely understanding. Why would you load the code not to display the slideshow? If you want to disable nothing, don't use the code.

    If you only want to hide the slideshow on the search page, the code below should work. Does it?

  8. digitalPurist
    Member
    Posted 1 year ago #

    Hi Matthew,

    Since I am not quite happy with my solution yet, I will try to explain my problem in more detail:

    I am using your slideshow within wordpress articles. In pseudo-code, such an article looks like:

    My article
    Some text here and a first slideshow
    [easingsliderpro id="1"]
    Some more text and a second slideshow
    [easingsliderpro id="2"]

    Now I would like to display the same article in two different ways within a web page. Normal viewing and within as search result.

    If I am in a search, I would now like the slide shows not to be loaded and not to be displayed when displaying the article.

    In my loop.php or content.php code I don't have to use easingsliderpro(); to enable it. The slider is always active.

    And yes I could use the_excerpt but that would disable my pictures too.

    The CSS-workaround works but is there another option in your software that I could use in this situation?

  9. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Ok. I understand what you're trying to achieve. Can you let me know what code you've added to your theme to display Easing Slider?

  10. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hey again, do you still need help with this? :)

  11. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Going to mark this as resolved, but feel free to get back to me if help is still needed :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Easing Slider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.