Website redesign – New theme – Help needed

You’ll have some process of data migration and validation, so you can setup a staging WordPress environment somewhere on the same server (like staging.recepti-kuvar.rs). You can do the following: Create the subdomain and protect it with htpasswd; Create a copy of the living site, using Duplicator plugin (or any other that you find easier); Restore … Read more

Switching content between summer and winter

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 … Read more

How to change the color theme per post?

I would agree to the comment by Howdy_McGee to use Custom Fields. A nice implementation would be possible with add_meta_box(). 1. Approach: The body_class Filter So for example, you could let him enter a custom field ‘color-scheme’. In the next step, you could simply hook into the ‘body_class’-filter and add another class to the <body>-tag … Read more

Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value

One of the solutions that I’ve found, is to store the set get_theme_mod($name) into a PHP $_SESSION[“$name”]. If the session exist, compare the new get_theme_mod($name) to that old $_SESSION[“$name”], if they’re not the same then // do something..: // Check if the user is an admin for validation to improve performance. if (current_user_can( ‘manage_options’ )) … Read more