0

Context:

I am done creating an advertising/info page for my project's wordpress site that I'm editing locally using XAMPP, and I did this within the "Front Page" template which shows up as the default page of the website.

Now I would rather have the front page be a navigation oriented page with links to all the other pages, and have this advertising/info page moved to a different page accessed via an "About" link on my new front page.

Problems:

  1. The "Front Page" template seems to override whatever template the actual front page (defined in Settings>Reading>HomePage) is using, in this case my "Main Navigation Page":enter image description here

  2. I cannot find the source file of this "Front Page" template within my wordpress files nor the theme I am using if I were to copy or edit it manually, (the "actions" dropdown under manage all templates only allows me to delete it). templates list wordpress files

  3. I also cannot use the "Front Page" Template on a new page in order to give it a page. image of template options list

Seems that I'll need to copy all my changes to another custom template and delete or restart the "Front Page" and "Home" ones. Come to think of it, even without knowing where the files are stored, I have an idea of how I could do this easily by copying the Front Page template's html within the Code Editor and pasting it into another template (Edit: this worked to copy the template.)

1 Answer 1

0

It seems like you figured it out, but for the sake of clarity, and in case it helps someone else:

It appears that you went to the site editor, hit the + to make a new template, and accepted the default for which kind of template you wanted, which was "Front Page."

You then wanted to use the template at a different url, but, not knowing that front page was special, you got stuck. Then you figured out that you could copy and paste the code into a new template and use that, so you did, and it worked. Yes?

Here's some background that might demystify the experience.

  • The Front Page template is only for the default page (the home page you get with just the domain name: www.mydomain.com). If it exists, it is used for whatever content ends up being served at the base url, regardless of template settings, etc. and it will never be used for a page at any other url.

  • You couldn't find the "Front Page" template in the page editor because "Front Page" never needs to be in that list, since the only criteria are if it's the home page or not.

  • You couldn't find the template file, because there isn't one. The files on disk in a theme that supports the site editor, like 2023, are the defaults. They stick around so you can always revert to them. All new templates, and changes you make to existing templates are stored in the wp_posts table in the database with a custom post type of 'wp_template.' So your new front page template is only in the db, not on disk.

  • You don't need to have a "Front Page" template at all. If it's not there, you can select the template you want in the page editor. (In fact, the only template a theme actually has have to have is index.)

  • In an old-school theme, php templates are in the theme directory, here: {site-root-dir}/wp-content/themes/{your-theme-directory}/front-page.php

  • In Gutenberg 2 themes like 2023, the templates are stored as html with special comments standing in for where php used to do stuff, like instead of include "header.php" you get

I hope that helps somebody, sometime, as much as researching this answer helped clarify it for me 8)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.