I want to limit the filter attributes shown on the shop page. I found this
function my_theme_scripts_function() {
echo "<scipt>
var limit = 10;
var list = $("#attribute_list");
var more = 0;
function tricky_hide(){
var morec = 0;
$("li", list).each(function(index) {
if (index >= limit) {
$(this).hide();
morec = index - limit + 1;
}
});
if (!more) more = morec;
if (more) {
list.append('<li class="more">' + more + ' more</li>');
return true;
}
return false;
}
if (tricky_hide()) {
list.live("mouseover", function() {
$("li", list).each(function(index) {
$(this).show();
});
$("li.more", list).hide();
});
list.live("mouseout", function() {
tricky_hide();
});
}
</script>
"
}
add_action('wp_enqueue_scripts','my_theme_scripts_function');
i want to add a button or a text link with "show more"