Here is a way of adding the class. Replace blog
withe the slug of the page. Example – This class will be added only on example.com/blog
. Put this code in your header.php
<?php if($post->post_name === 'blog'){ ?>
<html class="html-homepage">
<?php } else { ?>
<html>
<?php ?>
Related Posts:
- Editing page content through FTP?
- How do I add GoogleAnalytics header snippet in WordPress?
- How can I add a google play badge to my header and footer?
- How to make a monopoly board using css grid?
- Redirect from an HTML page
- How to horizontally center an element
- Android WebView err_unknown_url_scheme
- Why does z-index not work?
- Is it possible to write data to file using only JavaScript?
- Image is not showing in browser?
- Is it possible to write data to file using only JavaScript?
- Is “ ” a replacement of ” “?
- HTML Button : Navigate to Other Page – Different Approaches
- Which is better: or
- Adding attribute in jQuery
- Is element block level or inline level?
- XPath //div[contains(text(), ‘string’)] fails to select divs containing ‘string’
- Two divs side by side – Fluid display
- Proper way to make HTML nested list?
- FontAwesome icons are not showing, Why?
- CSS horizontal scroll
- mailto using javascript
- Mailto using Javascript?
- Can I set subject/content of email using mailto:?
- How do I set a background-color for the width of text, not the width of the entire element, using CSS?
- text-overflow: ellipsis not working
- How to reference nested classes with css?
- How to save user input into a variable in HTML and JavaScript
- Why is there an unexplainable gap between these inline-block div elements?
- How to make JavaScript execute after page load?
- Hide element by class in pure Javascript
- How to draw a dotted line with css?
- Function not defined javascript
- Navigate to an anchor on another page
- What is gZip compression?
- How to stick text to the bottom of the page?
- How to make blinking/flashing text with CSS 3
- Why doesn’t height: 100% work to expand divs to the screen height?
- How can I position my div at the bottom of its container?
- Why doesn’t height: 100% work to expand divs to the screen height?
- How can I position my div at the bottom of its container?
- AppendChild() is not a function javascript
- How to overlay one div over another div
- How can I change an element’s class with JavaScript?
- Input Type URL – Says “Please enter a URL” if HTTP is not included
- Place input box at the center of div
- Can HTML checkboxes be set to readonly?
- Best HTML5 markup for sidebar
- Difference between CAPTCHA and reCAPTCHA
- how to do a line break in Bootstrap 3.3.7
- Vertical align not working on inline-block
- HTML table needs spacing between columns, not rows
- Is it possible to put CSS @media rules inline?
- Make padding responsive
- Vertically align text next to an image?
- HTML not loading CSS file
- How can I center my ul li list in css?
- YouTube: How to present embed video with sound muted
- CSS !important not working
- How to best set a CSS3 transition to none?
- Playing Sound In Hidden Tag
- Why is vertical-align: middle not working on my span or div?
- ow to change the style of the title attribute inside an anchor tag?
- Flex align-items: center not centering items
- Redirecting to a page after submitting form in HTML
- Specifying Font and Size in HTML table
- How do I clear the content of a div using JavaScript?
- How do I change the value of lang=en-US
- Style reply form different than comment form
- How to display a raw HTML page (bypassing WordPress theme, scripts, etc)
- Style the last element having a specific class [closed]
- Publish pages/posts as HTML?
- How do I add some HTML before & after the content for all posts?
- How do I add a front menu button that redirects to another website or sub-domain?
- Protect HTML in Comment
- how add custom tag/tool in classic editor?
- Allow HTML in Settings API input field
- Create custom markup to use in posts?
- Adding Plugin Assets to Header
- Widget Text Needs to be White [closed]
- Why can’t I edit HTML in WordPress even with the administrator role?
- Adding HTML to posts with certain tags?
- Adding to the WYSIWYG
- Redirect WP 404 to html
- How to remove auto generated markup? [closed]
- Is there a common structure for a wordpress formular?
- a generated wordpress page from a form that is inputted by user [closed]
- creates an unnecessary space in content?
- WordPress is replacing code with when I add to posts
- Echo outside HTML
- Add html plugin into wordpress
- WBR tag breaking hyperlinks
- Query WordPress Database and Post HTML Table
- theme or plugin or server is outputting html before the init hook fires, how is it possible to prevent this
- How to Know If I’ve Correctly Inserted Alt Attributes Into HTML
- WordPress HTML editor panel is not showing HTML elements
- How to hide unwanted HTML Comment like in website [duplicate]
- HTML code not working in WordPress
- WordPress adds ‘noindex’ tag to search results. Anything I can do about it?
- How can we get Buddypress to interpret HTML entities correctly?