-
AuthorPosts
-
January 26, 2023 at 11:11 am #1395346
Hello together
I have installed a new page.
Link belowMy question: is it possible to show the same slider on the store and shopping cart pages as on the start page?
thanks in advance
kind regards
FranzJanuary 27, 2023 at 2:44 am #1395487Hey schweg33,
Thank you for the inquiry.
Yes, this is possible. First, you have to set the builder to debug mode by adding this code in the functions.php file.
/** * Enable Avia Layout Builder Debug * @link http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/ * * @return string */ function builder_set_debug() { return 'debug'; } add_action( 'avia_builder_mode', 'builder_set_debug' );
After switching to debug mode, you will have access to the shortcodes field just below the Advance Layout Builder. You can then extract the actual shortcode of the slider from this field and use it to replace the value of the do_shortcode function below.
// render something after the main container add_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { $output = ''; $output .= do_shortcode("PLACE THE SLIDER SHORTCODE HERE"); echo $output; }
This will render the slider after the main container for every page, so you will have to add a few conditions in order to control the visibility of the slider.
// https://woocommerce.com/document/conditional-tags/#:~:text=The%20conditional%
Best regards,
IsmaelJanuary 27, 2023 at 9:05 pm #1395674hello Ismael
Thank you very much for your introduction:I could change the Function.php without problems.
But after that I don’t know what to do.
I can’t find this part: the access to the shortcode field ?
can you give me a look or make a PrintScreen where this field is?
Thanks in advance
Friendly greetings
FranzJanuary 28, 2023 at 8:29 am #1395697Hello Ishmael
I have done a test on appointments but it is not displayed like the other sliders.Thanks and
Kind regards
FranzJanuary 28, 2023 at 2:05 pm #1395715Hi,
Thanks for the link to your new page, but the code Ismael gave you is for the child theme functions.php, not for a text block on a page:
Like this:
I added this for you and now the slider shows on your shop page:
and your product page:
please clear your browser cache and check.Best regards,
MikeJanuary 29, 2023 at 8:27 am #1395793Hello Mike
now it looks greatNow I think I understand how this works
Is it possible to hide this revSlider on the startpage
and I can insert another one there, now for example an easy slider, which now comes in second place.or is it possible instead of the revslider see below 1
simply insert an image see path see below 2thanks in advance
Kind regards
FranzJanuary 30, 2023 at 12:31 pm #1395897Hi,
I changed your code to this:add_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { if ( !is_front_page() ) { $output = ''; $output .= do_shortcode('[rev_slider alias="routiers-cvfl"][/rev_slider]'); echo $output; } if ( is_front_page() ) { $output = ''; $output .= do_shortcode("[av_image src='https://routiers-cvfl.li/wp-content/uploads/2023/01/schloss-gutenberg.jpg' attachment='3159' attachment_size='full' copyright='' caption='' image_size='' styling='' align='center' font_size='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' animation='no-animation' hover='' appearance='' link='' target='' title_attr='' alt_attr='' img_scrset='' lazy_loading='disabled' id='' custom_class='' template_class='' av_element_hidden_in_editor='0' av_uid='' sc_version='1.0' admin_preview_bg=''][/av_image]"); echo $output; } }
This shows the slider on all pages except the homepage, on the home page it shows the image you asked for, but it could show a different slider if you wished.
Best regards,
MikeJanuary 30, 2023 at 3:28 pm #1395919Hello
Thanks for your effort
I think we have misunderstood each otherOn the page home I have inserted an easy slider
and I want only this slider to be visible.but on all other pages the image
https://routiers-cvfl.li/wp-content/uploads/2023/01/schloss-gutenberg.jpgif that works
thanks and greetings
FranzJanuary 30, 2023 at 7:11 pm #1395957Hi,
Thanks, I did misunderstand, so I changed the function to show the image on all pages except the homepage, there you already have your easy slider, I imagine you want to control it on that page.Best regards,
MikeJanuary 30, 2023 at 9:22 pm #1395965Hello Mike many thanks
Now it works greatI have now taken another picture.
I think I just had to change the path.thank you
then you can close the ticketkind regards
FranzJanuary 31, 2023 at 12:10 pm #1396013Hi,
I checked and your new image looks like it is working correctly.Best regards,
MikeJanuary 31, 2023 at 1:45 pm #1396026Hello Mike
thanks
then you can close the ticket
kind regards
FranzJanuary 31, 2023 at 6:53 pm #1396088Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘slider on store like home’ is closed to new replies.