I'm developing with Wordpress in a multi environment scenario. I develop on my local machine, test on a server and so on.
I was using the "trick" of having a
local-config.php file to have different configurations based on the environment. Today I discovered this:
Wordpress config bootstrap.
It's just a simple improvement of the default wp-config.php file. It's working fine, but on my local environment appeared this error:
Notice: Undefined property: stdClass::$id in /home/carlo/public_html/altrababele/wp-content/themes/wp-foundation/index.php on line 21
The code generating the error is this:
<?php echo get_the_post_thumbnail( $post->id); ?><div class="date"><time datetime="<?php echo the_time('y-m-j'); ?>" pubdate><?php the_time('j'); ?><br><?php the_time('M'); ?><br><?php the_time('y'); ?></time></div>
I set the debug option to
false, but nothing changes. The problem appears to be that
id is lowercase, so writing
$post->ID actually solves the issue. It's strange because if I use the
local-config.php it works just fine, but all the options are the same.