Sometimes it seems that the developers of themes for the EP are competing with each other in the confusion of topics.

I want to change two banal parameters - the width of the body of the site and the width of the logo, but no! There are no such parameters in style.css

They are inspected by Google, it is clearly stated that there are such styles and such classes in this folder and in this file. And they are not! I usually said goodbye to the topic after a similar crap, but this time I decided to deal with it.

One confused. Both the folder and the file are indicated in the inspection, but the style.css file comes with some parameter, the essence of which is not clear to me. That is, it refers to a file of this type: https: //sayt/wp-content/themes/theme/style.css? Ver = 4.9.4

Riddle. The same with the width of the body of the site. Where to look for this parameter is known only to developers, but they do not respond.

  • @SeVlad and so the question is necessary, many do not understand how to find styles. I also roll the answer in about three hours. - KAGG Design 2:55 pm
  • What rules did I break? - Andrei
  • one
    Yes, you have not violated any rules. As far as I understand, @SeVlad, he means that according to the rules, it’s necessary to respond in essence. - KAGG Design
  • one
    @KAGGDesign SeVlad is mind. that the body of the "question" is whining about nothing. Written by the copywriter, generating water. Fascinating but useless. OK. Someone still has to send to ru.meta.stackoverflow.com/questions/6688/… :) - SeVlad

1 answer 1

To understand where the styles come from, right-click on the element and select "View code" in the menu. The Development Tools browser opens.

These and further instructions are for Chrome because it dominates the browser market today. In other browsers, the inspection course is about the same.

Suppose we decided to inspect the title of the main page of my test site http://test.kagg.eu/

enter image description here

We see that when the tab of the Inspector's Elements with html code opened

<h2 class="entry-title">Home</h2> 

On the right are the styles of this element. When you hover on style.css:1903 a hint style.css:1903 with the full url of the style file: http://test.kagg.eu/wp-content/themes/twentyseventeen/style.css . Moreover, the specified line number in css, from which specific styles are taken - 1903. We see that in line 1903 there are declarations of the rule for

 .page .panel-content .entry-title, .page-title, body.page:not(.twentyseventeen-front-page) .entry-title 

Notice that only those styles that are highlighted in black .page .panel-content .entry-title worked for this element. Those that are grayed out are not applicable to this element.

Scrolling down the right style window, you can see which css-properties worked on this element. Crossed properties do not work, they are overlapped in other rules.

In order to understand where this or that property came from this Home element (for example, font-family), right-click on the Computed tab.

enter image description here

We see that Libre Franklin declared in line 418 style.css. You must hover over style.css to find out its full url, since there may be several files with that name.

In this way, you can find out where any css property is declared: the body width or the logo width or anything else.

Regarding your question about the parameter ?ver= in the url of the style file. This is just a version of the file. It is set either explicitly in the subject when calling wp_enqueue_style() , or it takes the value of the WordPress version. From your text it is clear that you have installed the latest version of WordPress 4.9.4.

Why add a version at all? This is important for caching. When you change ?ver= browser will reset the cache of this file, even if it did not change a single byte.

But in general, this is a slightly different topic that needs to be discussed separately. In this question, you can safely ignore ?ver= . And in the inspector of this parameter is not. The inspector displays the current version of the style file.

Update

As for the specific theme of tdPersona, there is nothing confusing about it.

The function code tdpersona_the_custom_logo() is in wp-content/themes/tdpersona/inc/template-tags.php it is very simple, there are 3 lines, it calls the standard WordPress function the_custom_logo() , and that pulls the sizes of the logo from the base, according to the settings in "Appearance-> Customize-> Site Properties-> Logo". Using the instructions above, it is easy to see that the logo image is wrapped in a div with a class .brand . To change the size of the logo, it is enough to add one rule in style.css

 .brand img { width: 200px; } 

To see the width of the "body of the site, as you call it" (the width of the content, I suppose), you need to point at <header id="masthead" class="site-header container" role="banner"> in the inspector and see the block highlighting

enter image description here

In the bottom right of the styles window we see that the width of the container is specified in the 31st line of the style.css file.

 .container { max-width: 940px; } 
  • Thanks for the detailed answer! However, all these actions I know and did. Having rummaged, I understood that the sizes of a logo are registered in the html code, in attributes of the img tag. But breaking the entire code, I found only a small mention in header.php in the form of the following query: <? Php tdpersona_the_custom_logo (); ?> - Andrew
  • As you can see, the theme is TD Persona. - Andrei
  • @Andrey I doubt that you knew the procedures specified in the answer, otherwise you would have seen at the very first step that the sizes are written in the html code of the element, and you wouldn’t write about style.css in the question. Anyway. What prevents you now open the function code tdpersona_the_custom logo () and see how it displays the image? - KAGG Design
  • @Andrey, besides, you were silent about the moment that my answer shows how to find the width of the site’s body (as you call it). - KAGG Design
  • one
    If the opportunity to upload a logo and the function to display it appeared in WordPress, the decision to use it seems to me quite adequate and rational. - SergeyBiryukov