Tagged: categories, enfold, masonry, Portfolio
-
AuthorPosts
-
January 21, 2017 at 2:10 am #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.
January 25, 2017 at 8:44 am #738193Hi 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!
IsmaelJanuary 25, 2017 at 8:31 pm #738557Thank 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,
WendyJanuary 27, 2017 at 3:23 pm #739413Hi,
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,
VinayJanuary 31, 2017 at 2:23 am #740460Hi 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,
WendyFebruary 3, 2017 at 9:32 pm #742582Hi,
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,
VinayFebruary 3, 2017 at 10:58 pm #742592Thank 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,
WendyFebruary 3, 2017 at 11:31 pm #742606Hey!
Please do keep us updated.
Thanks a lotBest regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.