I dont know what is these mean so can you explain to fix it:
class="home page-template-default page page-id-50 logged-in theme-html5blank-stable woocommerce-no-js ehf-header ehf-footer ehf-template-html5blank-stable ehf-stylesheet-html5blank-stable elementor-default elementor-kit-1715 elementor-page elementor-page-50"
here is my website link:
/
Thank you
I dont know what is these mean so can you explain to fix it:
class="home page-template-default page page-id-50 logged-in theme-html5blank-stable woocommerce-no-js ehf-header ehf-footer ehf-template-html5blank-stable ehf-stylesheet-html5blank-stable elementor-default elementor-kit-1715 elementor-page elementor-page-50"
here is my website link:
http://www.migrate666.deniz-tasarim.site/
Thank you
Share Improve this question edited Mar 13, 2020 at 0:15 ahmet kaya asked Mar 12, 2020 at 23:15 ahmet kayaahmet kaya 331 silver badge9 bronze badges 5 |2 Answers
Reset to default 0It's Used to All class add to wordpress body element Using body_class(); function.
Specifically, it's used to adding body classes, removing body classes, conditionally adding body classes and some use cases.
The Body Class: What Can It Be Used For?
The body class in WordPress is a class or series of classes that are applied to the HTML body element. This is useful for applying unique styles to different areas of a WordPress site as body classes can be added conditionally.
- This is a really simple way to add body classes and is especially useful if you are creating a theme, using this below code is header.php body element
< body
<?php body_class();
?> >
Adding Multiple Body Classes
There may be times when you want to add more than one body class. This can be achieved using a simple
< body <?php body_class( array( "class-one", "class-two", "class-three" ) ); ?>>
Conditionally Adding a Body Class
This example uses the WooCommerce conditional method of is_shop() :
<?php if ( is_shop() ) { body_class( 'is-woocommerce-shop' ); } else { body_class(); } ?>
Adding a Body Class by Filter
It's possible to use a WordPress filter to add a body class, This code can either go in your themes functions.php or within your plugin.
add_filter( 'body_class','my_body_classes' );
function my_body_classes( $classes ) {
$classes[] = 'your-custom-class-name';
return $classes;
}
refer Link For More Knowledge
Those are the classes echoed by body_class()
and the problem was, I called the function outside of the <body>
tag:
<body>
<?php body_class(); ?>
So I changed that to:
<body <?php body_class(); ?>>
And that solved the problem. :)
header.php
or check the<body>
tag there. It could also be a filter/function that causing the classes to be put outside the tag. – Sally CJ Commented Mar 12, 2020 at 23:27[SOLVED] <title>
. – Sally CJ Commented Mar 12, 2020 at 23:53