<?php
function reha_parse_tax_query($query) {
if ($query->is_main_query() && !is_admin()) {
$tax_query = $query->tax_query;
foreach ($tax_query->queries as $k => $v) {
if (is_array($v) && isset($v['include_children']) && $v['include_children']) {
$tax_query->queries[$k]['include_children'] = false;
}
}
$query->tax_query = $tax_query;
}
}
add_action( 'parse_tax_query', 'reha_parse_tax_query' );
?>
Action de Wordpress que modifica la tax_query, para indicar que se muestren solo los productos hijos directos de una categoría (no sus nietos, ni otras subcategorías)
1 Response
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.