How to see the file of a page in wordpress

Hello i am a web developer and i have never worked on WordPress recently i am given a task to do modifications in a wordpress website where some features are in wordpress and some written in code , i have to do changes only in code part.How do i see the file relevant to a page or section in website for example when working with a code website i inspect it and copy a div with id and search in vs code and gets to the page after that i can modify that page.How can i do the same in wordpress or anything else that will help me achieve it.

2 Comments
  1. WordPress is dynamically generated when you visit a page unless you have a full page caching solution and even then modifying those is not what you want to do. You are generally either modifying the post entries or your theme files directly if you want to add custom php. The only places you would want to modify code directly using an external editor is pretty much a child theme’s function.php file which would be listed in wp-content/themes/your-theme-name/functions.php. This can also be edited directly from the wp-admin as long as the theme allows editing of theme files in its config. There also plugins for adding custom code but everything can be done from the functions.php file.

    Almost every piece of user and admin facing content that has been created for the website is a post in WordPress and stored in the wp_post and related tables in your database. Blog posts are a post of type post, pages are a post with type page, some plugins create custom post types such as if you use a contact form plugin there is a chance that both the form itself and entries from those are also stored here, if your theme has templating options for header, footer, body etc those are also generally stored here. You don’t want to go into your database and try to modify these entries though because you will 99.9% break something and even if you manage not to it will likely not work in the graphical editor after. Instead in the wp-admin there is generally a page to modify these. Pages and Posts have their own menu options in the wp-admin, your theme likely has a place to modify templates, etc. Some themes and associated editors give you the option to directly modify the html from these pages. If you want to move divs and html around this is where you would do it and may be limited depending on theme/editor you are using.

    Themes generally have a templating solution for the header, body, footer, etc and some add their own editor into the mix. Some are more customizable than others and offer more options. If the modification you want to make is going to be site wide you will want to look into modifying the theme. You generally don’t want to modify a theme directly and would instead use a child theme to persist updates. These allow you to add modifications to your functions.php, replace or modify the theme’s css, js, and other static files without having to use hacky solutions, and when your theme updates it doesn’t remove your modifications.

    This is obviously over simplified but dynamic sites on the back end aren’t just the html/css/js that are presented to the end user. When a user visits a page on your site WordPress essentially looks for the page that was requested but that isn’t usually a static file. Instead it looks at the theme and gets the layout for your site and the post content for the header, the post content for the body, the post content for the footer, etc and then assembles those together into an html that is then sent back as the page requested by the user.

    Edit: As I reread my post I may not have been clear enough that you don’t want to modify any WordPress core files, plugin, or theme files as an update will overwrite your changes. Basically the only place to be making changes to code are in a child theme, from within the edit post/page feature, or from a plugin designed to add custom code.

    This is a good place to start off https://learn.wordpress.org

  2. As a developer I would think it’d not be hard to understand the concept of dynamically created content using php…

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer