SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist fs_tigre's Avatar
    Join Date
    Feb 2009
    Location
    Close to Chicago, Illinois
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WP ingnores the index.php and uses the page.php instead

    Hi,

    I'm currently learning to create themes in WP but I'm a little confused. I created my HTML/CSS page and then I started converting it into a WP theme using an empty theme from starkers which contains a lot of pre-made themes like page.php, archives.php, comments.php etc, but I noticed that WP was ignoring the index.php template which should contain the main content and that was driving me crazy so I decided to start from scratch and then I started deleting all templates except the four basic ones (header.php, index.php, sidebar.php and footer.php) and as soon as I deleted them my theme worked just as it should, then I put all the templates back into the theme's folder and again the page wasn't behaving as it should, so I started deleting the extra templates one by one to find the one causing the problem and I found that the one causing the problem was the page.php, I deleted only this template and the theme now works just fine. It looks like it was showing the page.php instead of the index.php which doesn't have a sidebar. The problem is now solved but I would like to know how this happen because now I won't be able to use the page.php if I would need to. May be I changed the settings in the Admin area to use a different template? If yes, where is this option?

    Any idea why or what was causing the problem?

    Thanks
    Thank you very much!!!

  2. #2
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    page.php should only come into effect on static pages. More info here: http://codex.wordpress.org/Template_Hierarchy
    Dan G
    Marketing Strategist & Consultant

  3. #3
    SitePoint Evangelist fs_tigre's Avatar
    Join Date
    Feb 2009
    Location
    Close to Chicago, Illinois
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, that is probably why I'm using static pages only for this site.

    Should I copy and paste code from index.php to page.php that way both will look the same?

    Link helped a lot...

    Thanks a lot
    Thank you very much!!!

  4. #4
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if all you have are static pages, than you don't need a separate template file for them.
    Dan G
    Marketing Strategist & Consultant

  5. #5
    SitePoint Evangelist fs_tigre's Avatar
    Join Date
    Feb 2009
    Location
    Close to Chicago, Illinois
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot!
    Thank you very much!!!


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
  •