AMP pages with custom post type
-
Hi!
I have custom post typeI removed its name from slug using next part of code
‘rewrite’ => array( ‘slug’ => ‘/’, ‘with_front’ => false),
function change_fast_gallery_permalink_structure( $post_link, $post ) {
if ( is_object( $post ) && $post->post_type == ‘post_type_name’ ) {
$post_link = str_replace( ‘/post_type_name/’, ‘/’, $post_link );
}
return $post_link;
}And for now i have issues with my amp pages for this post type, when i follow the amp page link from amphtml attr i have redirect to my page without amp in url ( i have it with any of url structure, include ?amp)
I suppose that plugin created urls for amp pages using post_type_name in urls and i can not get access to them using url without cpt name.
How can i fix it? Thanks?
Also, before i removed cpt name from slug – it worked fine
The topic ‘AMP pages with custom post type’ is closed to new replies.