SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2009
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Template hierarchy question

    Scenario 1
    My website's home page url is http://www.example.com
    I want my latest posts to display at http://www.example.com/news

    My understanding to accomplish this..

    I will have to go to the Reading Settings page in the Wordpress Dashboard and then ensure that the "A static page" is selected in the option for the Front page display.

    Then i would have to select what page is used for the front page display and also the posts page.

    My first question:
    What template will wordpress look for to display the static home page?

    Is it front-page.php or home.php or index.php?

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2009
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Scenario 2

    My website's home page url is http://www.example.com
    I want to display the home page according to front-page.php (It displays all my posts)

    Lets say i've created every possible template do display every page type:

    category.php - Used to display all the posts for my categories
    search.php - Used to display the search results
    404.php - Used to display a page not found
    tag.php - Used to posts queried via tags
    single.php - Used to display my blog posts
    page.php - Used display my pages (about, contact)
    sidebar.php - Used to contain sidebar contents and a widgetized area
    header.php - Used to contain all the header contents
    footer.php - Used to hold all the footer content

    not forgetting the template to display taxonomies and attachments and authors..

    Question:

    Will i still have to create index.php? Will it be redundant as i've got front-page.php to display all my posts and to show it on the home page http://www.example.com

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Scenario 1:
    To have your blog page be example.com/news, create a Page in the Dashboard called "News". Then under reading settings, set the posts page to static and select "News" from the drop-down list.

    That leads us into...

    Scenario 2
    1. Turn "front-page.php" into a page template. (http://www.wordpressmax.com/customiz...ss/custom-page).
    2. Create a new Page in the Dashboard and set it to use that template you created in step one.
    3. Go to Reading Settings and set that page you created in Step Two as your home page.

    Yes, you still need index.php. index.php and style.css are the two files that all WordPress themes must have. And since you're using custom templates, you must have an index.php file.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •