• I’m currently building a site and when I originally started setting it up I specified a particular page as my “Posts Page” in Settings > Reading. This page had the slug “news”, however I now no longer want to use this page for posts so I changed the “Posts Page” setting back to the default of “-Select-“, but this slug is still being associated with posts. I’ve also tried setting the “Posts Page” to another page on the site, but when I go to the page with the URL /news it’s taking me to the new “Posts Page”. I need to be able to use the /news URL with another template instead of the index template. Any help would be appreciated.

    Thanks in advance.

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

    (@bcworkz)

    When you have a static home page configuration, you must select a post listing page. You don’t have to use it, but some page needs to be assigned for its use. Assign some other page as the post listing page, or create a new page for the purpose. For good measure, next visit the permalinks settings screen so that any stale rewrite rules get flushed. You don’t have to change anything, just load the permalinks screen.

    You can now edit the /news/ page like any other page. If your theme has multiple page templates, you can select which one to use. Otherwise page.php template will be used if it exists, otherwise index.php will be used. You can cause another template be used for this one page by naming the template using the format page-{$page_ID}.php For example, if the page’s ID is 1234, the template file should be named page-1234.php.

    Thread Starter Jason_K70

    (@jason_k70)

    Hi. Thanks for your reply. I’m still having problems though. As I mentioned in the second half of my original post, I have tried assigning another page as the posts listing page (and in fact this is how it is at the moment). So, in a nutshell:

    I have created another page /temporary-news-page/ and assigned this as my posts page, which works as it should (using the index.php template). However the /news/ page is still using the index.php template page as well.

    I’ve tried selecting different templates for /news/ from the Page Attributes area when editing the page, and I’ve also created a template for the specific page ID named with the format required, and in all situations it’s still using index.php. After each change I’ve visited the Permalinks setting page, but it’s still happening unfortunately.

    Thanks again.

    • This reply was modified 5 years, 7 months ago by Jason_K70.
    Moderator bcworkz

    (@bcworkz)

    If a template named page-{$page_id}.php is not used for its related page, there must be code somewhere overriding the normal template hierarchy. Try copying the page-{$page_id}.php file to the twentynineteen theme folder, then switch to that theme. If the template file is used under twentynineteen, the overriding code is in your normal theme somewhere. If the problem remains under twentynineteen, the overriding code is in a plugin. Restore your normal theme, then selectively deactivate plugins. When the correct template is used, the deactivated plugin has the overriding code.

    Thread Starter Jason_K70

    (@jason_k70)

    Thanks very much for your suggestion. I’ll give it a try and see how I get on.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to disassociate URL from posts page setting’ is closed to new replies.