• Resolved jeromevilayil12

    (@jeromevilayil12)


    Hi everyone,

    Earlier the press archive page was created using an archive page(template). The URL for the same is http://www.webiste-name.com/press. Now I have created a page for the same using elementor and the slug is /press. I have deleted the archive-press.php file but it is still not showing the page that I have created using elementor.

    In short, I want the URL to be the same and show the new page design.

    Regards
    Jerome

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You have a post type called “press”? Using a post type and page with the same slug causes a conflict. If you must have a “press” page slug, the base term in permalinks for your post type cannot also be “press”. If you change the post type’s base term, after making the change in code, visit the permalinks settings screen to get WP to recognize the new term. No need to change or save anything, just load the screen.

    Thread Starter jeromevilayil12

    (@jeromevilayil12)

    Thanks, Bcworkz for responding.

    Can you please tell me where to make the changes for the same? Should I make the changes in the functions.php file? If so what code to change?

    Regards
    Jerome

    Thread Starter jeromevilayil12

    (@jeromevilayil12)

    The issue is resolved now. Found a solution to this.

    1. To change the slug (https://zemez.io/wordpress/support/knowledge-base/changing-custom-post-type-slug/)
    (a) Go to functions.php and paste this code at the end of the file:

    add_filter( 'your-post-type_post_type_args', '_my_rewrite_slug' ); // Here replace "your-post-type" with the actual post type, e.g., "cherry_services", "cherry-projects"
                function _my_rewrite_slug( $args ) {
                $args['rewrite']['slug'] = 'our-services'; // Replace "our-services" with your preferable slug
                return $args;
            }

    (b) Chane the slug accordingly
    (c) Refresh the permalinks in the dashboard.
    2. To disable the slug from showing the archive page (https://wordpress.stackexchange.com/questions/135146/resolve-a-custom-post-type-name-vs-page-permalink-conflict-same-slug)
    (a) Find the below snippet for the particular post type and set the value as false.

    'has_archive' => false,
    (b) Refresh the permalinks in the dashboard.

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

The topic ‘Slug(eg: /abc) is showing the archive template, now want to show a page.’ is closed to new replies.