Hi, id need to exclude a custom taxonomy from showing up on homepage big grid and latest posts.
I saw the blocks have the option to filter by category IDs.
Since i don’t really use categories is it possible to modify this setting to it affect the custom taxonomy “genre”?
I think the file to modify is td_block.php
Around line 72
switch($td_ajax_filter_type) {
case 'td_category_ids_filter': // by category
If anyone can help me with this i really need to exclude a particular term of the taxonomy genre.
Thanks!
Hi
By default the theme display in blocks posts from default wp post type and assigned to default wp taxonomies. At the moment we don’t have a filter which allows the user to filter posts by custom taxonomies, only by custom post types. Usually a custom taxonomy it is assigned to a custom post type, that also happens if you’re using our plugin td-custom-post-type plugin. So basically to avoid posts from a custom taxonomy being displayed in a block you can remove the post type from query.
You can customize the query for block by editing the td_data_source.php file: http://screencast.com/t/jkYWSL90YhKY Please consider that this is a complex task which requires lots of customiations and good coding skills in order to be achieved. We can’t offer customization services at the moment so if you still need guidance on this or you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.
Thanks!
Andrei, thanks for guiding me on the proper direction, i was even looking at the the wrong file!
I think i might have managed to do it myself, could you tell me if this looks correct? It certainly works but i wanna be sure it’s not wrong, please have a look:
//init the array
$wp_query_args = array(
'ignore_sticky_posts' => 1,
'post_status' => 'publish',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'genre',
'field' => 'term_id',
'terms' => array( 1083 ),
'operator' => 'NOT IN',
),
),
);
thanks!