Forums

[resolved] Page Template structure changes not showing in page source (18 posts)

  1. dave
    Member
    Posted 1 year ago #

    I'm designing a WP site with a static home page and a static page displaying the blog, but, and here's the catch, the overflow of a certain <div> to scroll so that the page and design aren't effected and stay the same dimensions. Site here: http://www.nicholasandrewfilms.com

    Therefore, I'm using a custom page template for the static blog page that includes the div with the overflow:auto class and the corresponding style is in my main theme stylesheet.

    The option to select the template is available and everything on my page editor, but none of the changes show, even in the source code, after clearing cache/disabling cache plugins/etc.

    Any thoughts?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Your "static" blog page will be using the index.php template file.

  3. dave
    Member
    Posted 1 year ago #

    I modeled the static blog page after the page.php file. Shouldn't this work just as well?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    No. By design, the page that you selected as your posts page in Settings->Reading will use the index.php template file.

  5. dave
    Member
    Posted 1 year ago #

    The WordPress codex stated that for pages/templates it checks for:

    -The Page's selected "Page Template"
    -page.php
    -index.php

    in that order. So shouldn't page.php work before index.php does?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Not if it is the selected posts page.

  7. dave
    Member
    Posted 1 year ago #

    Mm, something they should distinguish (or do and i haven't dug that far, haha).

    Anyways, I changed the structure of my custom page template from that of page.php to index.php, and nothing changed. Is that what you meant? If not, then how do I force the selected static blog page to use the template that I want it to?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You can't "force" your posts page to use anything other than index.php. Try editing that template file.

  9. dave
    Member
    Posted 1 year ago #

    I would, except it needs to be different than the regular template index.php, that's the point.

  10. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Why? The only page that will ever use index.php is your main posts page.

  11. dave
    Member
    Posted 1 year ago #

    Doesn't WP use home.php before index.php? Or vice versa? And couldn't I use that index-and-home-are-both-for-the-same-theme as a [somewhat]simple solution?

  12. dave
    Member
    Posted 1 year ago #

    Ah, well there we are. I needed to think of it backwards, ie. use a page template for my static home page(or any of my static pages that match it) instead of the blog page.

    Thanks.

  13. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Doesn't WP use home.php before index.php? Or vice versa?

    Not necessarily. This kind of file name prioritising is usually handled by the server config. I'd also suggest that you avoid using home.php as a template file name as I've seen it cause a number of problems in WP 3x. From WP 3.0 onwards, themes can use front-page.php as their custom home page template file.

  14. dave
    Member
    Posted 1 year ago #

    Here's another one for you (I'm sure I'm just burnt out from thinking about that for the past couple of hours): How about a single post page? Will that also pull from index.php, or rather the single.php that I assume. Either way, it ain't workin' :)

    *kicks dead horse*

  15. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Single posts always use single.php - if it exists. If it doesn't, they will also use index.php.

  16. dave
    Member
    Posted 1 year ago #

    Can you think of anything that might inhibit either of those from working?

    Site: http://nicholasandrewfilms.com/2010/12/home-holidays/

  17. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    From what I can see, that page is using the single.php template file. Not sure what's supposed to be wrong with it but you do have a few CSS errors.

  18. dave
    Member
    Posted 1 year ago #

    Haha, thanks. Still working on the site, clearly.

    Must not have cleared the cache that time.
    Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic