The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How to display posts on a page other than the main page? (5 posts)

  1. thinsoldier
    Posted 5 years ago #

    Lets say my site is http://www.myblog.com

    I would like:

    http://www.mysite.com shows a hand coded welcome message, a photo, and a list of categories (no articles displayed on the home page at all (for the moment) )


    http://www.mysite.com/news/ lists all the articles (behaves like the default wordpress homepage)

    So far I've found that adding a home.php file to my theme overrides the index.php and lets me do the first bit of what I want. But I haven't found how to get the behaviour of index.php to happen when I visit mysite.com/news

  2. You want a Static Home Page: http://codex.wordpress.org/Creating_a_Static_Front_Page

    You want to make a page TEMPLATE with your old index.php stuff in there (call it like news.php)


    Then make a PAGE called news and point that to the template :)

  3. thinsoldier
    Posted 5 years ago #

    Thanks, that worked perfectly.

  4. thinsoldier
    Posted 5 years ago #

    Sorry, it did not work perfectly after all.

    I created a page in the system named News.
    I created a template by duplicating the default template's index.php and renaming it news.php
    I added the comment <? //Template Name: NewsRoot ?> to news.php
    I edited the News Page in the sytem.
    The template "NewsRoot" is now available as an option.
    I set the News Page to use the NewsRoot template.

    Now when I go to mysite.com/news I no longer get the 404.
    However, no blog posts show up within the main loop of the news.php template file. Any other markup in the file renders as expected but there's nothing showing up within the main loop. Why might that be?

  5. thinsoldier
    Posted 5 years ago #


    Part 2 of the solution:


    (video at the bottom of the page)

Topic Closed

This topic has been closed to new replies.

About this Topic