I want to add something on a page of my WordPress site that is in localhost, but I can’t find the file of that page in the htdocs folder from Xampp. I need the PHP file of that page to edit.
I searched in the "my site" folder in htdocs using some lines of code I can see when I inspect the source code of the page with SearchMyFiles.exe but nothing was found.
3
Answers
what you are looking for is probably stored in the wp_posts table of your database.
In the source code, you will only find files and scripts related to your Themes/template. For WordPress "pages", the standard template used is usually the file "page.php".
Unless there is a more specific template file in your theme (e.g. archive.php to display archive pages), WordPress will use the template page.php to display all the pages of your site.
Basically, WordPress database stores your pages and posts by dividing all the items into 12 tables (n the database).
saving the post and other types of contributions, also known as
“terms.”
categories
and the poster’s name
custom fields and editing lock
title, text content, modification date, creation date,author,and the publishing status excerpt.
Many of the pages in a WordPress website are not based on files unlike HTML sites. Are you sure that this page is based on a file or is it based on some database values? If you are unsure, then feel free to provide the URL.
WordPress has a Template Hierarchy.
Here is the documentation: https://developer.wordpress.org/themes/basics/template-hierarchy/
E.x. For homepage, WordPress looks for home.php first. If the file is absent then it goes to index.php
Similarly:
Front Page display:
For Single Post:
For Single Page:
To find whether you are on post or page, just check the admin top bar (if you are logged in). You will find edit post or edit page button at the admin top bar.