Tagged: x
-
AuthorPosts
-
September 6, 2016 at 5:54 am #1162870
RLavParticipantHi,
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.1I’ll provide the user and pw in a pm.
Hope you can help!
Richard
September 6, 2016 at 5:56 am #1162875
RLavParticipantThis reply has been marked as private.September 6, 2016 at 7:29 am #1162958
ChristianModeratorHey 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.
September 6, 2016 at 10:42 am #1163178
RLavParticipantThanks, I will try this and get back to you!
September 6, 2016 at 12:01 pm #1163281
JoaoModeratorHi There,
Let us know how it goes,
Joao
September 7, 2016 at 4:26 pm #1165195
RLavParticipantI 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 …
September 7, 2016 at 4:31 pm #1165201
RLavParticipantBy 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
September 8, 2016 at 12:04 am #1165825
RadModeratorHi Richard,
In that case, please provide your FTP login credentials and I’ll check your templates.
Thanks!
September 10, 2016 at 10:28 am #1169323
RLavParticipantThis reply has been marked as private.September 10, 2016 at 10:13 pm #1169735
Rue NelModeratorHello 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.
September 11, 2016 at 4:56 pm #1170428
RLavParticipanthi,
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
September 11, 2016 at 10:21 pm #1170685
RadModeratorHi 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!
September 13, 2016 at 3:57 am #1172706
RLavParticipantHi,
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!
September 13, 2016 at 5:52 am #1172839
ChristianModeratorThanks.
September 19, 2016 at 2:09 pm #1181952
RLavParticipantHi,
@ 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
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1162870 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
