Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #736682

    Hi,

    I am using the Enfold Theme.

    I am using the Masonry content element in the Avia Layout Builder. I want to remove the “All” and the “/” from the sort categories and default to the first category.

    I’ve already removed the “All” and the “/”, and I found this code in the forums to change the default category, and it seems to work. Although, it takes more than 13 seconds for my images to load.

    add_action(‘wp_footer’, ‘ava_auto_click’);
    function ava_auto_click(){
    ?>
    <script>
    (function($){
    $(window).load(function() {
    $(‘.backgrounds_sort_button’).trigger(‘click’);
    });
    })(jQuery);
    </script>
    <?php
    }

    Is there any way to make the images load faster? When it loaded all photos, it loaded a lot faster.

    Any help would be appreciated. Thanks.

    • This topic was modified 7 years, 10 months ago by wgertler.
    #738193

    Hi wgertler!

    Thank you for using Enfold.

    If you want the images to load faster, you need to make sure that they are optimized accordingly. This short article will help.

    // http://kriesi.at/archives/4-key-wordpress-image-optimization-tips

    And installing a cache and minify plugin will help as well.

    Cheers!
    Ismael

    #738557

    Thank you Ismael,

    They are optimized. When the “All” category was active, they loaded just fine. But, after I put the code in functions.php, they don’t load after about 13 seconds. Any other suggestions?

    Is there something in the code that’s not accurate?

    Thanks,
    Wendy

    #739413

    Hi,

    Try this code below instead this will select the first category of the portfolio filter if you like to change it increase the eq(x) value in line jQuery(‘.inner_sort_button:eq(1)’).click();

    function select_portfolio_filter(){
    ?>
    <script>
    jQuery( window ).load(function() {
      jQuery('.inner_sort_button:eq(1)').click();
    });
    </script>
    <?php
    }
    add_action('wp_head', 'select_portfolio_filter');

    If you still have any loading issue Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)

    Best regards,
    Vinay

    #740460

    Hi Vinay,

    Thank you! I’m still having an issue with the photos taking a long time to load for some reason. Like I said, when it’s on All, it works fine.

    There are two pages that I’d like to default to the first (or second, if you’re counting the “All”) category. I’ll give you the links to the pages below.

    Thanks,
    Wendy

    #742582

    Hi,

    I checked your site on pingdom and the result was amusing. The total size of the page is 10MB which is quite large and the load time seem to be alright.

    To avoid the delay and keep the user waiting while the images load give this plugin a try

    https://wordpress.org/plugins/lazy-load/

    Best regards,
    Vinay

    #742592

    Thank you very much for the information! I appreciate it!

    I’m still not sure why it takes longer to load “Backgrounds” than it does “All.” But, I’ll look into the plugin.

    Thanks,
    Wendy

    #742606

    Hey!

    Please do keep us updated.
    Thanks a lot

    Best regards,
    Basilis

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.