Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1162870
    RLav
    Participant

    Hi,

    I have a strange problem with Revolution Slider on the page: http://wp.leobus.nl/contact/ .

    This is the only page that was not build with Cornerstone, because I wasn’t able to get the desired layout. So I used the regular WordPress editor in combination with some shortcodes. Everything worked fine, until I made some changes to the content of the page. Now I get an error saying:

    Revolution Slider Error: Slider with alias x-slider-rs-8 not found.
    Maybe you mean: ‘rev-slider-home’ or ‘rev-slider-diensten’ or ‘rev-slider-projecten’ or ‘rev-slider-opdrachtgevers’ or ‘rev-slider-facts-and-figures’ or ‘rev-slider-contact’

    I didn’t even touch any of the slider settings or the slider below masthead meta box before the error occured.

    If I deactivate the slider below and use the slider above, all is well (but that’s not what I want …). So the slider seems to be ok!

    I use some custom php to activate a specific slider for 404 situation, therefor if I deactivate the slider below on a page, there will be a slider shown. This is working fine and has been working fine in the past.

    WP version: 4.4.2
    X version: 4.6.1
    Cornerstone version: 1.3.1

    I’ll provide the user and pw in a pm.

    Hope you can help!

    Richard

    #1162875
    RLav
    Participant
    This reply has been marked as private.
    #1162958
    Christian
    Moderator

    Hey Richard,

    Would you mind switch to the parent theme and check if the issue persists? If that doesn’t help, please backup your site and remove all customizations and third party plugins. If you could not do that, please copy your site over to a dev server.

    Thanks.

    #1163178
    RLav
    Participant

    Thanks, I will try this and get back to you!

    #1163281
    Joao
    Moderator

    Hi There,

    Let us know how it goes,

    Joao

    #1165195
    RLav
    Participant

    I found the problem, but not a solution. The problem was that my custom php code in the file _slider-below.php (in a child theme). but the the whole concept of the code in this file has been changed dramatically since I wrote this custom code last year, resulting in the error described before. Even when switchig to the x theme instead of the child theme, I notice some weird discrepancies in the behaviour of revolution slider when it comes to the search page results. When then something is found, it shows a slider (not sure what it’s based on …). But when nothing is found it doesn’t show a slider, sort of weird if you ask me …

    #1165201
    RLav
    Participant

    By the way, I removed my custom code and the sliders are working again for normal pages. The problem is that I want a specific slider to show up for the search pages (with or without results).

    Thanks for your reply by the way!

    I would like to solve this problem quickly, hope you can point me in the right direcrio!

    Regards,

    Richard

    #1165825
    Rad
    Moderator

    Hi Richard,

    In that case, please provide your FTP login credentials and I’ll check your templates.

    Thanks!

    #1169323
    RLav
    Participant
    This reply has been marked as private.
    #1169735
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! To display a specific slider in search pages, since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Add custom content below the masthead
    // =============================================================================
    function custom_content_below_masthead() { ?>
      <?php if ( is_search() ) : ?>
        <div class="custom-shortcode">
          <?php echo do_shortcode('[rev_slider alias="{the-alias}"]'); ?>
        </div>
      <?php endif; ?>
    <?php }
    add_action('x_after_view_global__slider-below', 'custom_content_below_masthead');
    // =============================================================================

    Please supply the correct slider shortcode and save it.

    Hope this helps. Please let us know how it goes.

    #1170428
    RLav
    Participant

    hi,

    thanks for your suggestion!

    I implemented your code but please take a look at these 2 examples:

    1: http://wp.leobus.nl/?s=wontbefound (no search results)

    2: http://wp.leobus.nl/?s=vervoer (with search results)

    So your code works in case there are no results, bus it now shows 2 sliders in case there are results. This is consistent with my earlier remarks ie: no results shows no slider and with results shows a (random) slider. The only difference is that your code forces a specific slider to show up!

    I appreciate your code suggestions, but I would really like to understand the weird behaviour when combining sliders with search pages.

    Thanks in advance,

    Richard

    #1170685
    Rad
    Moderator

    Hi there,

    The top slider is the search result, that’s because the slider will fetch the data of current page/post ID. And it happens that single result has the slider. You can confirm it here http://wp.leobus.nl/projecten/vervoersbeleid/

    Let’s hide the upper slider and maintain the recently provide code. Please add this CSS to Admin > Appearance > Customizer > Custom > CSS

    .search .x-slider-container.below,
    .search-no-results .x-slider-container.below {
    display: none;
    }

    Cheers!

    #1172706
    RLav
    Participant

    Hi,

    your suggestion works but it seems to me it’s a waste of resources to render the slider and then hide it via css. I will try to fix it in php. I’ll keep you updated!

    #1172839
    Christian
    Moderator

    Thanks.

    #1181952
    RLav
    Participant

    Hi,

    @ Rad – You said: “The top slider is the search result, that’s because the slider will fetch the data of current page/post ID.” But it seems like the id of the page of the first result, when there are multiple results, will be used for the slider. Therefore the php code in _slider-below.php “if ( X_REVOLUTION_SLIDER_IS_ACTIVE || X_LAYERSLIDER_IS_ACTIVE ) :” returns true. But if there are no results there’s no page id is assigned to the page, so “if ( X_REVOLUTION_SLIDER_IS_ACTIVE || X_LAYERSLIDER_IS_ACTIVE ) :” returns false and there will be no slider on the page.

    I found a solution in creating my own _slider-below.php file named _slider-below-search.php (and all of the other files that route to this file) and adding the following code:

    // custom output for search pages without any results
    if ( is_search() && !have_posts() ) : ?>
    <div class=”x-slider-container below”>
    <?php echo do_shortcode(‘[rev_slider alias=”rev-slider-search”]’); ?>
    </div>

    <?php endif;

    It would be nice to know if these core files (like _slider-below.php for example) have been changed in an update to the theme, since this broke my former solution to this problem. Is there any notification of some sort apart from the standard changelog?

    regards,

    Richard

  • <script> jQuery(function($){ $("#no-reply-1162870 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>