An unwanted inline style is added to my body tag

After searching a lot, I realized that elements inside my head tag are shown inside body tag and head tag contains nothing in my generated HTML code. This happened because I had used UTF-8-BOM encoding and by changing it to simple UTF-8 everything was fixed.

How the Css File is Linked without calling it in header.php?

The correct way to register styles in WordPress is to enque them through wp_enqueue_style function in your theme’s functions.php. You can read and learn how to do it here – wp_enqueue_style /** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, … Read more

Cannot figure out how to center div in WordPress theme [closed]

As mentioned in my comment, http://howtocenterincss.com/ is a great resource to get the necessary CSS to horizontally or vertically center containers or paragraphs in CSS. Since you mentioned the text should be centered, the wbesite would give you this solution: <div style=”text-align:center;”>Text Content</div> If you want to center a container instead, margin-right: auto; margin-left: auto; … Read more

Editing WordPress Nav Menu Walker

You need create additional field for menu item. Because if you will use class field – you will block adding additional class to links. But if it’s ok – create <i class=”$your_class”></i> before link title. And @Dilip Gupta gave solution to you.

How to exclude certain code from style.css? [closed]

I would not suggest creating a child theme to override a single CSS line. You can simply use the theme customizer and add your CSS to the additional CSS box. Most CSS properties accept an unset or inherit value. So, you can paste the following code into the additional CSS box: @media (max-width: 991px) and … Read more

How/where to add additional stylesheet to WP

The WordPress API provides the functions wp_enqueue_style() and wp_enqueue_script() for including stylesheets and JavaScript. These functions should be used instead of hardcoding style or script tags within HTML. // Runs wpse_enqueue_styles() on the wp_enqueue_scripts() hook. // (Yes, we’re enqueuing a stylesheet here, but the proper hook is wp_enqueue_scripts. add_action( ‘wp_enqueue_scripts’, ‘wpse_enqueue_styles’ ); function wpse_enqueue_styles() { … Read more

CSS not loaded when omitting www. part of URL

This can happen for several reasons – in your case, it looks like you are using a caching plugin that only recognizes www links. I suspect if you turned off caching you would not have that problem, but then you’d lose the benefits of caching. It’s best practice (with or without caching) to add redirects … Read more