Hi @wildflower24
You can try this javascript code snippet:
jQuery(window).on("resize load", function() {
jQuery(".um.um-directory").each(function() {
element_width = jQuery(this).width();
if (element_width <= 340) {
jQuery("[data-type='list']").trigger("click");
} else if (element_width <= 500) {
jQuery("[data-type='list']").trigger("click");
} else if (element_width <= 800) {
jQuery("[data-type='list']").trigger("click");
} else if (element_width <= 960) {
jQuery("[data-type='grid']").trigger("click");
} else if (element_width > 960) {
jQuery("[data-type='grid']").trigger("click");
}
jQuery("[data-type='list']").trigger("mouseout");
jQuery("[data-type='grid']").trigger("mouseout");
});
});
You can add it to your theme scripts customizer. Or use this plugin to add the code to the footer or header( don’t forget to enclose it with <script></script> tags: https://ww.wp.xz.cn/plugins/insert-headers-and-footers/
Regards,
Works like a charm! Thanks <3