• I customized the “Home” template, but my actual Home page is not using it. It looks more like the “Page” template.

    And I don’t understand, if the “Page” template is supposed to be for pages, why does it have blocks for featured images and comments?

    And if I wrote a custom template, how do I go about associating a page with it? I don’t see the mechanism.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • When you go to a page, are you using the right sidebar to select the template you want for that page? There is a popup menu for just that purpose. On my WP, it sits right below “Status & Visibility”.

    Thread Starter keress

    (@keress)

    That dropdown only has a few choices, Default, (which it obviously considers to be ‘Page,’ Page (Large Header), Page (No Separators) and Blank. The page is definitely set in the “Settings > Reading as the “Home” page.

    My guess is that there are a few templates provided that are not actually registered, or registering, within the template.

    Option 1:
    Methodically collect all of the content on your Home template into a group, then turn that group into a reusable block. Next, go build a new template (by going to any page, looking at the Template drop-down we are discussing, clicking the little New link under the pop-up of template names, giving a name to a new template, then going to the Template Editor right away).

    Finally, select this new template in the template editor and add that reusable block you made to essentially copy all of your hard work into a new template that will show up (because you built it in WP inside this particluar template).

    Option 2:
    Look for this code in the JSON file and register the Home template that exists there so that WP knows to add it to the pop-up of template names. I have never done this. It is a theory:

    "customTemplates": [
    		{
    			"name": "blank",
    			"title": "Blank",
    			"postTypes": [
    				"page",
    				"post"
    			]
    		},
    		{
    			"name": "page-large-header",
    			"title": "Page (Large Header)",
    			"postTypes": [
    				"page"
    			]
    		},
    		{
    			"name": "single-no-separators",
    			"title": "Single Post (No Separators)",
    			"postTypes": [
    				"post"
    			]
    		},
    		{
    			"name": "page-no-separators",
    			"title": "Page (No Separators)",
    			"postTypes": [
    				"page"
    			]

    Is this helping?

    • This reply was modified 2 years, 10 months ago by saturn3.

    Sorry, this:

    My guess is that there are a few templates provided that are not actually registered, or registering, within the template.

    Should have been:
    My guess is that there are a few templates provided that are not actually registered, or registering, within the theme.

    And:
    (because you built it in WP inside this particular template).

    Should read:

    (because you built it in WP inside this particular theme).

    Thread Starter keress

    (@keress)

    Thanks, this is very intriguing. I’ll give it a whirl tomorrow.

    Actually, I didn’t write any custom templates. I did that on another site. I developed it on a temporary installation, then wanted to copy it over to the live site. Someone told me to install Gutenberg plugin, that would make the’code view’ work in the theme editor. I tried that and everything fell apart. No header displayed at all. It seemed something got very corrupted. So this time around I’m only editing existing templates.

    Is that theme.json that I would add all that to? I haven’t fooled with that yet.

    If you are hung up on templates vs. pages, try this thread:

    https://www.ads-software.com/support/topic/i-cant-figure-out-how-to-create-a-new-page-based-on-a-template-i-created/#post-15447776

    The JSON file is an adventure in itself. Good luck!

    To add a template, remember to also add it as html file in the templates folder (preferably use a child theme), not only in the json file.

    AFAIK for the Home page-template, it actually controls the “blog home” page. If you have static home page, you can create a Front page template for that.

    Thread Starter keress

    (@keress)

    Confusing success. I was able to add a “front’ page to the dropdown, it showed when I created that page in the templates folder of my child theme.

    Then I noticed that the template editor in FSE says:
    “Home
    Displays posts on the homepage, or on the Posts page if a static homepage is set.”

    When I added a dummy line to the “Page” template it revealed that it is what is being used for the static “Home” page, so the above line is not accurate.

    When I added another item in the theme.json called ‘Home” it still does not show in the dropdown. Out of curiosity, I also created a “home.html” in the child’s template folder, no change. Still doesn’t show in the dropdown.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘“Home” page template not controlling home page’ is closed to new replies.