Page has a parent and $post->post_parent returns 0

Try echoing serialized($post); to make sure you’re looking at the right page(s). It should return the post_parent so the problem may be either in the call you’re making to get $post, or double-check that the set of pages did save with a parent page. Easiest way of doing that is call up “All Pages” and … Read more

How to change the format of posts on the hompage?

Ah! Sorry about this. It turns out after some further digging and playing around with the theme I figured out that the content.php file is what is being used. To combat this though I changed the include to content-home and duplicated and renamed the content.php file and now it works. Easy way to alter the … Read more

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