Hi,
On my website https://lehrlingsdays.at/ there is a portfolio grid.
Is it possible to display a specific category when the page loads? By default, all portfolio entries are shown when the page loads. However, I do not want to display all of them; I only want to show the entries from a specific category. Is that possible?
Thanks!
Hi, can anyone answer me please?
*push* this is urgent!
Hi,
Thank you for your patience, unfortunately this element doesn’t have this option, you can choose to only show the one category alone by choosing only one category, or if you want to enable many categories and have one selected first you can try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function custom_script() { ?>
<script>
(function($){
setTimeout( function() {
var grid = $('#js_sort_items .sort_by_cat');
if( grid ) {
grid.find('a[data-filter="austria-trend_sort"]').trigger('click');
console.log('click');
}
}, 800);
})(jQuery);
</script>
<?php
}
add_action( 'wp_footer', 'custom_script', 99 );
This will click your “austria-trend” sort option on page load. You can change this to the item you wish and adjust the delay option (800) if you wish. I tested this on your page by injecting it in the browser and it working well.
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
It worked!! Thank you so much! :-)
Hi,
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