Hi there,
We can change your CSS’s selector so the CSS only applies to specific pages.
WordPress adds classes to its body tag by default depending on what page it is. On Front page or Home page, WP adds home
class to the body tag. These classes being added to the body tag can be used as a selector.
Say for example, you want a CSS to apply on the front/home page only.
Example CSS: applying CSS to front page/home page only.
body.home article:first-child h2.entry-title {
font-size: 50px;
font-weight: 700;
}
Alternatively, you can use a Hook element hooked to wp_head
with display rule location set to your front page with your CSS placed in its code area.
Example CSS code for Hook element:
<style>
article:first-child h2.entry-title {
font-size: 50px;
font-weight: 700;
}
</style>
A wise man once said:
"Have you cleared your cache?"