alexlbc
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Custom Post Type UI] Help with categoryOh! You are the best! Tnx! Its finally work! Thank You!
Forum: Plugins
In reply to: [Custom Post Type UI] Help with categorykategorieis my taxonomy, not default. It is category ofrecepty, its mean in Czech recipeForum: Plugins
In reply to: [Custom Post Type UI] Help with categoryI try it, I put this code to function.php, but without results 🙁
code, what I put:
function my_cptui_add_post_types_to_archives( $query ) { // We do not want unintended consequences. if ( is_admin() || ! $query->is_main_query() ) { return; } if ( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { // Replace these slugs with the post types you want to include. $cptui_post_types = array( 'recepty', 'Recepty' ); $query->set( 'post_type', array_merge( array( 'post' ), $cptui_post_types ) ); } } add_filter( 'pre_get_posts', 'my_cptui_add_post_types_to_archives' );at in the end of function.php
For exaple:
My Post Type name is “Recepty”, it in chech recipes
https://sarahkopcanska.cz/kategorie/dezerty/ – it is category “Dezerty”
https://sarahkopcanska.cz/recepty/dynovka-2/ – its item in category “Dezerty” but it isn’t in the url …./kategorie/dezerty/
Viewing 3 replies - 1 through 3 (of 3 total)