• I am using Discovery Child theme.

    In this theme, posts are used to provide slider content on my home page by identifying them with a category of “Featured”.

    In the slider display there is a link that is intended to go to the post but I have created a page with the same slug as the post.

    When clicked, the page is displayed (which is what I want).

    What I want to know is whether this is a safe mechanism to use.

    The posts and pages have same slugs:

    Page: about Post: about
    Page: location Post: location

    Thanks
    Tony

Viewing 4 replies - 1 through 4 (of 4 total)
  • As far as I know, it is not possible to use the same slug more than once. You probably are safe enough in attempting to do so.

    Thread Starter TonyM2

    (@tonym2)

    Thanks – seems to work fine.

    The slugs are the same and the link delivers the page rather than the post.

    The page was created before the post.

    However, I ran a test where the page was created after the post and the page was still returned rather than the post when I clicked the link. It looks like two slugs the same can co-exist and WP always delivers the page.

    Tony

    You are welcome. Glad you figured it out. If you check the slugs carefully you likely will find the one created second will have -1 or -2 or something extra at the end…

    Thread Starter TonyM2

    (@tonym2)

    For information, there is no difference between the slugs – they are exactly the same.

    Anyone should be able to run the test themselves – set up a post and a page with same names (slugs =) display the URL. The page will show. Delete permanently the page and display the URL and the post will show.

    Tony

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post and Page shared slugs’ is closed to new replies.