After change URL, other page say not found
-
Hello Author,
I’ve latest wordpress, CPT plugin
I need below slug change for my post :
BASE URL/taxonomy name/post type name/post title
ex :
BASE URL/company/news/post type
BASE URL/private/news/post typeSo for that :
Rewrite = True
Custom Rewrite Slug = /%taxonomy_name_for_news%/newsIn function.php
function wpa_course_post_link( $post_link, $id = 0 ) { $post = get_post($id); if ( is_object( $post ) && (get_post_type($id) == "news" || get_post_type($id) == "kampanjer" )){ $terms = wp_get_object_terms( $post->ID, 'taxonomy_name_for_news' ); if( $terms ){ return str_replace( '%taxonomy_name_for_news%' , $terms[0]->slug , $post_link ); } } return $post_link; } add_filter( 'post_type_link', 'wpa_course_post_link', 1, 3 );
It work for this CPT
———-
Same above setting I was done for second CPT.
and than check frontend this post, it will redirect on “page not found” pageAlso all other pages, are also redirect on 404
Do you have any idea, like why other post + pages say 404?
Also just FYI : I’ve same name of 2 page, what taxonomy name have, like :
For ex :
page name : company, private
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘After change URL, other page say not found’ is closed to new replies.