WordPress.org

Ready to get started?Download WordPress

Forums

Single.php and page.php? (6 posts)

  1. webDressing
    Member
    Posted 7 years ago #

    Hi everyone. We're trying to learn how make templates and was wondering what the function of single.php and page.php was? Index, header, footer, comments and searchform.php all make sense, but we can't figure out what single and page.php are needed for.

    Can anyone briefly explain what thier purpose is? Thanks.

  2. Doodlebee
    Member
    Posted 7 years ago #

    Single.php is for single posts. In the blog portion of your site, the headers are all inks. Single.php is the layout you see when you want to view just that one single post. If you don't make a layout for it, it uses the default.

    Page.php is for your Pages (static wordpress Pages). Again, if you don't make a different template for Pages, then WP uses the default.

  3. webDressing
    Member
    Posted 7 years ago #

    In the blog portion of your site, the headers are all links.

    Shouldn't that read 'titles'? Doesn't clicking on the header area always take you back to the index page?

  4. Doodlebee
    Member
    Posted 7 years ago #

    Shouldn't that read 'titles'? Doesn't clicking on the header area always take you back to the index page?

    I was thinking of code. Your titles *are* headers (<h2>).

    And no, it doesn't always take you back - only does if you have it set to do so.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    webdressing: It would probably help you to read this:
    http://codex.wordpress.org/Template_Hierarchy

  6. webDressing
    Member
    Posted 7 years ago #

    That looks great Otto42. Thank you for the link, I really appreciate it :)

Topic Closed

This topic has been closed to new replies.

About this Topic