Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1327842

    Hi Guys,

    From the documentation – The code snipped below seems to no longer work. I have a site where I’d like to display the tesimonials in a grid and display the image and name above.

    If this snippet doesnt work am I better to edit the shortcode?

    #1328048

    Hey Thomas,
    Thank you for your patience, I tested this on my demo site and it worked for the Testimonial Sliders, is this what you tried to use it on?
    2021-11-06_120942.jpg
    Try checking if you are forcing the jQuery to load in the footer Enfold Theme Options ▸ Performance ▸ Load jQuery in your footer this could break the script.
    Otherwise link to your page and we could adjust it for your situation.

    Best regards,
    Mike

    #1328111

    Thanks Mike,

    I’ll try changing the settings js was set to load in the footer on my test site.

    is the issue that the script must run after the main js file has loaded or before? I may still be able to load scripts in the footer and add the code snippet but adjust the priority that they load. Like setting wp_head functions to -1 priority so they are loaded before other critical css generators.

    #1328112

    Hi,
    Thanks for your question, the script needs to run after jQuery, if you want to load jQuery in the footer the try using this script instead, the first part uses an event listener for the loading of the DOM, which includes the footer scripts and then it loads the other script:

    function defer_custom_script(){
    ?>
    <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($) {
        $(".avia-testimonial-meta").each(function(){
            $(this).closest('.avia-testimonial_inner').prepend($(this));
        });
    }(jQuery)); 
     });
    </script>
    <?php
    }
    add_action('wp_footer', 'defer_custom_script');

    Best regards,
    Mike

    #1328375

    Hi Mike,

    I can confirm that your fix works.
    Please can you add this to the documentation? I think this is a more robust way of doing things.

    #1328470

    Hi,
    Glad to hear this helped, I will suggest to the Dev Team 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Testimonial Image above in grid view’ is closed to new replies.