skip to Main Content

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.

database picture1
database picture2
database picture3

3

Answers


  1. 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).

    • wp_usermeta: saves metadata on your users
    • wp_users: saves the user’s data on your site, including their password and username
    • wp_termmeta: saves metadata on your taxonomy terms
    • wp_term_relationships: stores the posts assignment to categories,
      saving the post and other types of contributions, also known as
      “terms.”
    • wp_term_taxonomy: saves the taxonomy of wp_terms table’s term
    • wp_terms: saves all your site’s taxonomy terms, such as the tags and
      categories
    • wp_commentmeta: saves all the metadata of your site’s comments
    • wp_comments: saves all your posts’ comments, which includes the time
      and the poster’s name
    • wp_postmeta: stores all the metadata from the wp_posts, like the
      custom fields and editing lock
    • wp_posts: stores every file or content of your website, including the
      title, text content, modification date, creation date,author,and the publishing status excerpt.
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. 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:

    1. front-page.php
    2. home.php
    3. page.php
    4. index.php (if none of the above 3 files are present, then WordPress follow index.php)

    For Single Post:

    1. single-{post-type}-{slug}.php
    2. single-{post-type}.php
    3. single.php
    4. singular.php
    5. index.php

    For Single Page:

    1. custom template file
    2. page-{slug}.php
    3. page-{id}.php
    4. page.php
    5. singular.php
    6. index.php

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search