Views is a WordPress plugin that lets you easily display content on your website's front-end in any way you choose.
Views User Guides include detailed documentation for creating lists of content, templates for content and archive page and also explain how to create parametric searches for any content type.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 2,266 through 2,280 (of 3,151 total)
Problem:
Creating a List/Archive/Directory Page of Users with Filters
Solution:
You can not create custom search view for taxonomy or user views as its not supported natively. You can create custom search views for post type and post type archives.
The issue here is that the user wants to filter the current view by 2 post relationships from different post types.
Solution:
This can be resolved by using the code below.
//Return only posts from the current author when listing posts of type company:
function tssupp_filter_query( $query_args, $view_settings, $view_id ) {
if($view_id == 123){
$query_args['toolset_relationships'] = array(
array(
'role' => 'child',
'related_to' => 63,
'relationship' => 'leverancier-categorie-leverancier'
),
array(
'role' => 'child',
'related_to' => 51,
'relationship' => 'vestiging-leverancier'
)
);
}
return $query_args;
}
add_filter( 'wpv_filter_query', 'tssupp_filter_query', 99, 3 );
This can be added to the Toolset Custom code section in Toolset->Settings->Custom Code. Change the 123 to the ID of your view and adjust the relationship slug and related_to to the correct ID of the posts.