Reply To: Filter Not Showing Up Properly

#7313

Ernest Marcinko
Keymaster

Hi!

If you change the logic to “OR” then:

(1) If you have the post in both North America & Canada at the same time: it will display if either of them is selected.

(2) It won't work like that. It does not matter if they are hierarchical, it won't make any difference – if you don't put it into North America only into Canada, then it won't be automatically put in North America.

What I would do:

– Select the OR logic
– Put the post it in both North Americal & Canada

This way it will be displayed if either of them is selected. I understand what you are trying to achieve, but term hierarchy is more of a “visual” feature in WordPress.

Secondary solution

Another way perhaps is to select the parent checkbox if the child box is clicked and selected. You can add this custom javascript code to your site footer to make it happen:

<script>
jQuery(function($) {
$(".asp_option_cat label").click(function() {
    var $parent = $(this).parent().parent();

    if ($parent.attr("asp_cat_parent") > 0 && $("input", $(this).parent()).prop("checked") == false ) {
      $(".asp_option_cat .option input[value="+$parent.attr("asp_cat_parent")+"]").prop("checked", true);
    }
});
});
</script>
  • This reply was modified 2 years, 1 month ago by  Ernest Marcinko. Reason: fix
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)