• Resolved gabestah

    (@gabestah)


    Hello,

    I imagine I’m far from the first to ask this question, but I’m unable to find an answer so hopefully someone can point me in the right direction.

    I would like to retain the current URL structure of domain.com/stories/article-title/ when viewing Posts, but simultaneously ensure that domain.com/stories/ displays a specific, static Page called “stories” rather than showing the default Post list filed under the stories Category. As you may have guessed, I’m using Yoast SEO to strip the /category/ base from the URL to retain the nice URL structure mentioned above.

    When I have both a category named “stories” and a static Page named “stories”, WordPress defaults to the category listing for domain.com/stories/. Is it possible to force WordPress to instead prefer to show the static Page for /stories/ instead?

    Any help or tips would be much appreciated and thanks!

    -Gabe-

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 7265597

    (@anonymized-7265597)

    I had a similar problem on a clients website, i overcame this by using the ‘is_category();’ function on a custom template file, if it was it displayed the latest posts in that category if not it displays alternative information (in my case a list of all the categories and the number of posts within) but there is no reason why that logic couldn’t display the post information from your static page.

    hope this helps

    Thread Starter gabestah

    (@gabestah)

    Thanks for the quick reply TCR!

    I did end up resolving this eventually by following the steps outlined in this very handy post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Overwrite Category URL with static Page URL’ is closed to new replies.