There is a the7dt theme and its subsidiary the7dtchild. In the7dtchild style.css I change the styles #bottom-bar .mini-nav { margin-right: 40px; } #bottom-bar .mini-nav { margin-right: 40px; } , but in the end, #bottom-bar { margin-right: 40px; } #bottom-bar { margin-right: 40px; } . But sometimes nothing happens at all and in Chrome DevTools in Sources in the file of these styles do not exist. And when I open this file in the admin panel, everything that I wrote is there. Why is that? How to fix?

  • you put a space? It is not needed, i.e. "# bottom-bar.mini-nav". Maybe this is the case ... - cvvvlad
  • No, I need to apply to the child element, and not to the # bottom-bar with the class .mini-nav - zh-mskl9
  • Yes, I'm sorry. Checked on a simple document, everything works. Maybe your values ​​are frayed? I have nothing to do with the bottom-bar. Here is the screen: yadi.sk/i/ZG1d2sKeqysBz - cvvvlad
  • The fact of the matter is that no. In the inspector, styles are not even displayed at all. - zh-mskl9
  • Another option - crooked styles are connected, since there are no sources. Try to connect these styles to another document and check ... - cvvvlad

1 answer 1

Creating child themes for the WordPress code, in my humble opinion, has a flaw. It appears just in the error of rewriting the parent css. I recommend that you do the following:

1) Disable parent css In the functions.php file of the parent theme, look for the line connecting css, you need to know its id. In my topic "NatureSpace" it looks like this: Connecting styles

style file id - naturespace-style

Next, in the function.php your (child theme), we write the following code (an example for my theme):

/* * отключение стилей родительской темы */ function give_dequeue_plugin_css() { wp_dequeue_style('naturespace-style'); wp_deregister_style('naturespace-style'); } add_action('wp_enqueue_scripts','give_dequeue_plugin_css', 100);

2) Instead of connecting the parent style using @import... copy the code of the style.css file and paste it into your own. In the future, you do not have to rewrite the values, just modify the existing ones. This method, first of all, eliminates the problems with !important in parental topics and confusion with priority in classes.

Optional: Using the code above, you can disable any unnecessary styles and scripts (for scripts, change the style to script )