• I am trying to edit the lay out of the different pages which I land on after clicking on my menu items on top of my web page.

    How can I find the files which control the layout of these different pages?

    I have tried using inspect elements on Google Chrome with no success in trying to locate these files in the files for my WordPress website.

    Furthermore, do you have any resources which give an easy and down to earth explanation of how the world press files which makeup a website relate to the different pages and elements in a website?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • WordPress files contain PHP code, which is the software that generates the HTML that you see as web pages. You won’t find any of your web pages as files anywhere.
    The theme is responsible for the output of the HTML, and the CSS to style it.
    You can switch themes to get a different look for your site. Most themes have some options (usually in the Appearance > Customizer) that affect how your pages look.
    The files of a theme follow the Template Hierarchy.

    • This reply was modified 3 years, 11 months ago by Joy. Reason: added link
    Thread Starter owalker2014

    (@owalker2014)

    I understand how how to use Appearance>Customize; everyone knows how to do wthat. But what Im trying to do is to further customize the theme to meet my needs by removing a few things from the theme which I don’t want.

    I know that this can be done – this is not a question. I already have all the files for my WordPress website downloaded using FTP. I did inspect elements using Google Chrome and I saw the line of code which controls what I’m looking for. My problem is locating that file, inspect elements on Google Chrome does a poor job of giving me the file path.

    My question is more of a developers question and has to do with actually manipulating the code itself!

    I would appreciate if someone – especially a theme developer – can help me out.

    • This reply was modified 3 years, 11 months ago by owalker2014.

    I am a theme developer.
    It’s best you make any changes in a child theme, so that if the theme author releases an update, it won’t overwrite your changes.
    All the theme files are in the wp-content/themes/ folder, one folder per theme.
    You can look at the Template Hierarchy link that I gave and see which file is used to output that type of page. Outside of that main hierarchy, each theme can have different folder structure and code structure.
    If you need to look up functions, use the Code Reference.

    Moderator bcworkz

    (@bcworkz)

    I don’t develop themes, that’s why Joy needs to correct something I say once in a while 🙂 I still know a few things. The template hierarchy isn’t always that clear to a lot of us. The Show Current Template plugin will identify in the admin bar the main template file used for any front end page. There still remain several template parts that get loaded in. You’d need to examine the main template’s code to learn what other parts are used. Then in some themes, those partial templates can load their own partial templates. You could potentially need to examine a number of templates to drill down to the right file where you’d want to make a change.

    To repeat Joy’s advice, you should keep any altered templates and custom code in a child theme. Correctly enqueuing style.css in a child can be a little fussy, but it’s worth doing.

    Thread Starter owalker2014

    (@owalker2014)

    Okay, so how can I modify child themes and what are great resources where I can begin?

    Have you seen the Theme Developer Handbook?
    Layout is a mixture of HTML elements and the CSS that applies. The theme is obviously involved in that, since it outputs the entire dynamic page of HTML and CSS, but the theme is most influential on the elements that surround the content, like the header, footer, sidebar, menu, pagination, comments. The content itself is like a black box, which the theme doesn’t control, although theme styles affect the pieces inside the content.

    Forum questions indicate that a lot of people are unaware that there are standard queries for WordPress: single post/page, multiple posts(whether it’s by date, author, taxonomy, or post type), search. These all are requesting data from the posts table. The front end of WP does not have queries for users, taxonomies, meta data, files. The theme has a known structure because the WP queries have a known structure, and WP maps a query to a theme template. (The theme doesn’t do the query.) Any front end URL that is added for users or other data is added by a plugin. That’s not to say that there aren’t functions to retrieve all that other data, but the URLs are not set up for it. The theme uses WP functions to output other data that is relevant to the main query (taxonomy terms, images, menus, pagination, comments) to fill out the parts of the page that are not the main query.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can locate the files of my menu item pages?’ is closed to new replies.