
-
AuthorPosts
-
February 6, 2025 at 1:25 pm #1476511
Hi
I’m trying to add a full width easy slider above the calendar on Events Calendar (list) page. I found a support ticket from 2019 which adds an action hook in the functions.php.
add_action('ava_after_main_container', function() { echo "SOMETHING HERE"; });
This works OK but how would I then add the full width easy slider? I used the debug setting and copied the code between [av_slideshow_full and [/av_slideshow_full] but that just displayed all of the code on the page
Is there a way to do this please.
Regards
ColinFebruary 7, 2025 at 7:01 am #1476594Hey waveseven,
Thank you for the inquiry.
You have to wrap the slider shortcode inside the do_shortcode function. Example:
add_action('ava_after_main_container', function () { echo do_shortcode(" [av_slideshow_full img_copyright='' size='featured' min_height='0px' stretch='' control_layout='av-control-default' slider_navigation='av-navigate-arrows av-navigate-dots' nav_visibility_desktop='' nav_arrow_color='' nav_arrow_bg_color='' nav_dots_color='' nav_dot_active_color='' src='' attachment='' attachment_size='' position='top left' repeat='no-repeat' attach='scroll' img_copyright_font='' av-desktop-font-img_copyright_font='' av-medium-font-img_copyright_font='' av-small-font-img_copyright_font='' av-mini-font-img_copyright_font='' img_copyright_color='' img_copyright_bg='' animation='slide' transition_speed='' autoplay='false' interval='5' img_scale='' img_scale_end='10' img_scale_direction='' img_scale_duration='3' img_scale_opacity='1' conditional_play='' img_scrset='' lazy_loading='disabled' alb_description='' id='' custom_class='' template_class='' element_template='' one_element_template='' av_uid='av-m6ucuzsa' sc_version='1.0'] [av_slide_full id='3334' element_template='' title='' video=''][/av_slide_full][/av_slideshow_full]"); }, 10);
You may also need to add a conditional function to make sure it only renders on the events page.
if (function_exists('tribe_is_event_query') && tribe_is_event_query() && !is_singular('tribe_events')) { // do_shortcode(slider); }
Best regards,
IsmaelFebruary 7, 2025 at 12:13 pm #1476630Hi Ismael
Thanks for the reply.
That seems to work except it puts it on every page even if I add the conditional function.
if (function_exists('tribe_is_event_query') && tribe_is_event_query() && !is_singular('tribe_events')) { // do_shortcode(slider); }
I only really want it of the events listing page
Many Thanks
Regards
ColinFebruary 8, 2025 at 8:34 pm #1476725Hi,
Your IF function should check for the body_class “post-type-archive-tribe_events” please give this a try.
If you have trouble please include an admin login in the Private Content area so we can be of more assistance.Best regards,
MikeFebruary 9, 2025 at 11:50 am #1476753Hi Mike
Thanks for your reply.
I’m not really a php person. How would I do that exactly please?
Many Thanks
Regards
ColinFebruary 9, 2025 at 2:46 pm #1476774February 9, 2025 at 5:08 pm #1476778Hiu Mike
Login details below
Many Thanks
Regards
ColinFebruary 10, 2025 at 5:34 am #1476795Hi,
Thank you for the info.
The Appearance > Theme File Editor and the Plugins page are not accessible. How did you add the code? Please make sure to provide an admin account or enable the Theme File Editor so that we can test the modification.
— https://www.wpoven.com/blog/disallow_file_edit/
You have to edit the wp-config.php file and set the DISALLOW_FILE_EDIT to true.
Best regards,
IsmaelFebruary 10, 2025 at 10:14 am #1476811Hi Ismeal
Apologies, certain sections were turned off for general admins, but you should now have full access. Please try again.
Many Thanks
Regards
Colin-
This reply was modified 1 week, 5 days ago by
waveseven.
February 11, 2025 at 6:23 am #1476880Hi,
Thanks for the update.
We added the code in the functions.php file:
add_action('ava_after_main_container', function () { if (function_exists('tribe_is_event_query') && tribe_is_event_query() && !is_singular('tribe_events')) { echo do_shortcode(" [av_slideshow_full size='featured' min_height='0px' stretch='' control_layout='av-control-hidden' src='' attachment='' attachment_size='' position='top left' repeat='no-repeat' attach='scroll' conditional_play='' animation='slide' transition_speed='' autoplay='false' interval='5' lazy_loading='disabled' id='' custom_class='' av_uid='av-m6klirfn'] [av_slide_full id='4796' av_uid='av-73glw'][/av_slide_full] [/av_slideshow_full]"); } }, 10);
Please make sure to purge the cache before checking the events page. (see private field)
Best regards,
IsmaelFebruary 11, 2025 at 9:54 am #1476891Hi Ismael
That is brilliant ! Exactly what I needed. Thank you very much.
Regards
ColinFebruary 11, 2025 at 9:07 pm #1476908Hi,
Glad Ismael could 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 -
This reply was modified 1 week, 5 days ago by
-
AuthorPosts
- The topic ‘Add full-width easy slider above calendar on Events Calendar page’ is closed to new replies.