Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
demi4444
tagDiv Member

Hi Calin,
maybe I wasn’t clear. I know I can use multiple taxonomies filter, but in this case the block displays posts that belong to at least one taxonomy-term of the term id list.
Instead I need to display posts that belong to all the terms set in the multiple taxonomy filter.

In other words, the multiple taxonomy filter generates a query that has a tax_query relation in “OR” (not in “AND”), and I really need to modify this behavior.
I investigated and it seems to me that I have to modify the file plugins/td-composer/legacy/common/wp-booster/td_data_source.php (line 137)
$tax_query[‘relation’] = ‘OR’;

But how can I do it in my child theme?
thanks

demi4444
tagDiv Member

Hello,
I am having the same problem with the theme.
So how can I use your blocks to display posts that use multiple taxonomies but with the tax_query relation in “AND” and not in “OR”?
thanks

demi4444
tagDiv Member

ok,
i copied the td_block_mega_menu.php from wp-content/plugins/Newspaper/includes/shortcodes/ to
wp-content/themes/my-child-theme/includes/shortcodes/ and modified the code as shown above.

@Robert
: I think it solves, please let me know if the solution has issues

demi4444
tagDiv Member

Hi Calin,
I investigated and maybe found a solution, but I need to override the td_block_mega_menu.php file in plugins/Newspaper/includes/shortcodes/
How can i do this?
The solution in quite simple: on line 140 of that file, change the get_categories() params from ‘child_of’ to ‘parent’.. so from:
$td_subcategories = get_categories(array(
‘child_of’ => $category_id,
‘number’ => $show_child_cat
));

to

$td_subcategories = get_categories(array(
‘parent’ => $category_id,
‘number’ => $show_child_cat
));

That seems to solve, but how can i override the function in my child theme?

Thanks

demi4444
tagDiv Member

Hi Calin,
how can it solve this specific case? (I also need to restrict the megamenu and visualize only the sub cat)
In the screenshot I can see that it is possible to adjust the number of subcategories, but i need to exclude the sub sub cat, not to limit the number of the subcategories
thanks

Viewing 5 posts - 1 through 5 (of 5 total)