• Resolved dave

    (@mozdzanowski)


    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: https://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?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Your “static” blog page will be using the index.php template file.

    Thread Starter dave

    (@mozdzanowski)

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

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

    Thread Starter dave

    (@mozdzanowski)

    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?

    Not if it is the selected posts page.

    Thread Starter dave

    (@mozdzanowski)

    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?

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

    Thread Starter dave

    (@mozdzanowski)

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

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

    Thread Starter dave

    (@mozdzanowski)

    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?

    Thread Starter dave

    (@mozdzanowski)

    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.

    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.

    Thread Starter dave

    (@mozdzanowski)

    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*

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

    Thread Starter dave

    (@mozdzanowski)

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

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Page Template structure changes not showing in page source’ is closed to new replies.