• Resolved protesian

    (@protesian)


    Hi!
    I have custom post type

    I 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @protesian

    Thank you for contacting us, may I know the reason why you removed the slug from the post type?

    Also, please let us know what you are trying to achieve with examples so we can understand your issue correctly

    Thread Starter protesian

    (@protesian)

    Thanks for your reply!

    I removed cpt name from slug due to project requirements.

    As for examples, i just show how i did it.

    So can you help me with this issue?

    • This reply was modified 2 years, 7 months ago by protesian.
    Thread Starter protesian

    (@protesian)

    So i have now the same permalink structure for posts and for cpt, suppose this is the reason of the issue, but i do not know how to fix it, without changing url structure for cpt ( but i can not change it following requirements )

    Plugin Support Milind More

    (@milindmore22)

    Hello @protesian

    Sorry for the misunderstanding, When I say example, I mean a URL where I can check things also please send us your support UUID to better understand your setup

    Plugin Support Milind More

    (@milindmore22)

    @protesian As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘AMP pages with custom post type’ is closed to new replies.