Layout 'Home' location broken?

Hi there,

It seems the layout ‘Home’ location is not working. I have set the Home page in WP Settings > Reading, but the template does not display.


@Rips What “theme position” are you using for this template? It should be noted on the “Location” tab right underneath the contents of your screenshot. I’ve just tested this with the basic “Content” position and it successfully replaces the content area of the home page with my template. If you’re working with custom-defined theme positions, maybe your issue is simply the way that theme position is defined?

1 Like

After some testing, I found two of my positions are not working at all, regardless of the location:

  • After Header
  • Before Footer

I previously encountered an issue with the Underscores starter theme where the Before Content and After Content positions were not working because the Content position entirely overwrote them. So, after some discussion with Eliot, I moved these to the Header and Footer files.

I am unsure what the problem is, but it could be specific to the Underscores theme and how it loads the theme sections, or there is an issue with the PHP.

My Underscores theme is here if you want to take a look.

I can work around this by using Before Content and After Content positions, as I don’t need all of the positions at present.


Further to the above, in addition to some of my positions not working, it does seem that the ‘Home’ location only works with the ‘Content’ position.

There is a workaround for this, which is to use the Route location with a /, and it will set the location to the home page.

For example:

I’m out of my depths when it comes to theme troubleshooting, I know @julia has a lot more experience on that front. As far as I’m aware, Content, Document Head, and Document Foot seem to be the only default theme positions in L&L, so things like After Content would be uniquely defined within your theme. Is there a chance that this position simply isn’t defined on the home page in this particular theme? Again, I don’t know enough about how WordPress themes work to know whether that could be the case.

An example site was provided by an L&L developer a while back, including several theme positions. The original zip can be downloaded here.

My guess is that any combination of a layout and position should work assuming they are valid for the currently viewed page.

I might remove the locations not working for me as I don’t need them anyway. :slight_smile: