All Topics
Specific layout for taxonomy term list
Hello,
I am new to ACP, I just discovered it and it looks like a real great plugin!
I would like to automatically link a layout to a taxonomy term. First I set the taxonomy when the layout is selected, with that :
add_filter( 'parse_query', 'my_fema_crm_posts_filter' );
function my_fema_crm_posts_filter( $query ){
global $pagenow;
if(!$query->is_main_query() || !is_admin() || $pagenow != 'edit.php') :
return ;
endif;
print_r($query);
if(isset($_GET['post_type'])) :
if($_GET['post_type'] == 'contact') :
if(isset($_GET['layout'])) :
if($_GET['layout'] == '60749abc4f46e') :
$query->set('taxonomy','categorie_contact');
$query->set('term','accredite-2021');
endif;
endif;
endif;
endif;
}
But I would also like to set the layout when the posts are filtered by taxonomy term (for instance on /wp-admin/edit.php?post_type=contact&taxonomy=categorie_contact&term=accredite-2021 )
Is there a way to achieve that ?
Thanks in advance
Etienne
You must be logged in to reply to this topic.