Hey there,
I have two Cathegorys in my Portfolio and one of them is way more important so it should appear at the beginning.
Now, ists the other way round (does he sort by alphabet?)
What can I do to change it?
Cheers
Monika
Hey Monika,
Thank you for the inquiry.
There is no option for this by default, but you can try this script in the functions.php file to reverse the order of the first and second item:
function ava_custom_js_inline() {
?>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var parentElement = document.querySelector('.av-sort-by-term');
var logoDesignElement = parentElement.querySelector('.logodesign_sort_button');
var webDesignElement = parentElement.querySelector('.webdesign-entwicklung_sort_button');
if (parentElement && logoDesignElement && webDesignElement) {
parentElement.removeChild(logoDesignElement);
parentElement.removeChild(webDesignElement);
parentElement.insertBefore(webDesignElement, parentElement.firstChild);
parentElement.insertBefore(logoDesignElement, parentElement.firstChild);
}
});
</script>
<?php
}
add_action('wp_head', 'ava_custom_js_inline');
Best regards,
Ismael