Probably the easiest thing to use is the date()
function with the “daylight savings argument and add a custom <body>
class:
<?php
/** Plugin Name: (#179112) Daylight savings body class */
add_filter( 'body_class', 'daylightsavings_classes' );
function daylightsavings_classes( Array $classes )
{
$classes[] = 0 === date('I') ? 'winter' : 'summer';
return $classes;
}
This plugin appends either winter
or summer
to your classes. Therefore it allows you to use different rules in your stylesheet and style your elements accordingly.
Related Posts:
- How to load a different theme for categories?
- How to display message (with switch_theme hook) after deactivating My theme?
- How to switch theme if the current user is admin?
- Translate a site based on different themes
- Can I easily switch themes on a fully built website? [closed]
- Switching Theme and back will reset the previous Theme’s settings?
- Ensure Quality Transition to New WordPress Theme [closed]
- How to allow users to switch to the child theme from front end without plugin?
- How to change background color in the Notepad++ text editor?
- What are all the available parameters for query_posts?
- Does WordPress work without a theme?
- Is it OK to remove theme credits from footer? [duplicate]
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- Difference between stylesheet_directory and template_directory
- Adding a Template to the Page Attributes Panel for both Posts and Pages?
- Why are my widgets not saving when being added to a sidebar?
- Building useful features into your theme
- How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?
- How do I put my comment form above the comments?
- Edit theme wp_head
- Current theme broken – after server and domain migration
- Theme Advanced Styles in Visual Editor and Paragraphs
- Want to have the Post editor remembering the last editing position
- Enqueue different stylesheets using IE conditionals
- Switch Theme Through Options Panel
- Override parent theme translation on child theme
- Forbidden 403 error, permission to access, unable to read htaccess
- Theme of codinghorror.com
- Activate a new WordPress Theme Only for Admins
- WordPress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]
- How to add template to theme in WP
- How do I copy my Parent Templates to my Child Templates?
- How can I show more than 15 themes at a time in the admin menu?
- What is the WordPress Pinecone sitting on top of? [closed]
- Pros and cons of using Backbone for WordPress theming [closed]
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- Create a dashboard-style site (not WordPress dashboard) – is there a theme? [closed]
- How to setup a new WordPress theme without deactivating the current theme?
- WordPress is not able to change themes
- How do I set the featured image size on the single post?
- Are theme .php files stored in the database?
- Execute filter in theme as last
- Why style.css with ?ver=3.9.2 not updating as the one without ?ver=3.9.2?
- Inconsistent translation on a WP site
- How can I have different theme with same booking table? [closed]
- Updating my free theme delete all my changes [closed]
- Web site Header tag links some resources with HTTPS
- Do not show one specific widget on one specific page
- Troubles with Walker_Nav_Menu and closing
- How to create different navigation for registered users in WooThemes Canvas?
- Different logo on homepage
- Translation not working after editing plugin template
- How to apply different themes with custom design in one site?
- Selected template is not respected for home page in WordPress
- How to restore file or theme?
- A /proc folder in wp-content?
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- Problem Installing a Premium Theme– File Permission Issue on a Mac, Local Machine? [closed]
- Child theme’s stylesheet cannot load [closed]
- Is it good practice moving the main stylesheets after the plugin styles?
- Variant of the same theme for each page
- When someone likes an article on my blog, they are prompted to log in on WordPress.com [closed]
- WordPress TwentyTen Theme Incompatible with Theme Unit Test
- WordPress theme logo handling (Trying to use GIF as logo)
- Changing an image in header.php
- Installing a theme on localhost, Ubuntu 16.04
- Unable to find translations in WordPress theme
- Using filter in the widget causes fatal error
- Will I lose the pages I’ve created within a default WordPress theme when adding a new theme?
- Theme title in admin shows full path [closed]
- How to get the theme directory URI?
- Is there a way to see how a theme will look before buying it?
- Menu items do not “open” when mouse hover over them?
- Twenty Ten Theme: Replace the Logo by a picture without moving the code
- In a specific blog, the K2 theme does not have a Text Widget
- theme customizations gone after enabling ssl
- How to customize a section of a widget only on certain pages or page
- Simple filter to change label name of Email Adress to something else
- Show only the beginning of post
- Changing theme folder name disrupts widgets
- WordPress Customazation API section in section
- Edit a template while still keeping a Landing Page on the main address
- How can I Update my Theme
- Use random theme
- post_prev & post_next within same category
- Costum Theme template directoy url problem
- Replacing current theme folder by previous version of the same folder produces “undefined function get_header()” error
- Theme comment callback results nothing
- Does not work bookmarklet in the theme Tagology
- How do I block a subdirectory from WordPress theming?
- How to find out which template the HTML content comes from?
- What is the general cut-off date for reviewed themes in the WordPress.org repository?
- Sub-Theme (based on Taxonomies)
- How to Hide Blog Post Author?
- Commenting in CSS (//) equals “none”? [closed]
- Adding a wp_head hook from an included PHP file
- Deleting Widgets in sidebar in Panthea theme
- Is it possible to dynamically show different themes for different users? [duplicate]
- Table of Contents in Left Navbar [closed]
- How do I get rid of the Mindblown and the book recommendations?