• Resolved jonasep

    (@jonasep)


    Hi,
    Is it possible to have same url in categories, as the post type? Example:

    I have a post type with urls /news
    And then i have created a category where i want to sort the news in different topics. But the category urls are being named /news_category/politics. Can’t i use the same url for categories, so its /news/politics instead?

    When i try to correct the url to use the same slug, it wont work.

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    It’d be very messy if possible, because the permalink is how WordPress interprets what it’s supposed to query for. A post type of “news” and urls of mysite.com/news/my-news-article vs a term archive of mysite.com/news/politics. What’s it supposed to query for? The post named “My News Article” ? or the archive for the “politics” term?

    Vastly different things. Probably the biggest question is going to be which is more important to have “news” in its permalink? I ask this because I know it’s possible to remove the post type slug from permalinks, and then potentially disable its archive at mysite.com/news/ so that that permastruct would be available for the term. Or you could rename the archive slug used for the post type. perhaps change to articles for just the archive permalink.

    For the removal of post type slugs from permalinks, we recommend using https://wordpress.org/plugins/permalink-manager/

Viewing 1 replies (of 1 total)

The topic ‘CPT Url same as in categories?’ is closed to new replies.