How to display custom post type on wordpress page
From wordpress 3.0 version we got custom_post_type method introduced in wordpress api. Here we shown, How to display custom post type on wordpress page
Recently, I came across very weird issue. I found wordpress 3.3 dashboard blank issue on my PC. There are many wordpress admin pages not shown to me. suddenly all admin pages became blank.
Only left side bar was visible to me. I checked my site in firefox, chrome, IE browser but same result. I am not able to see the posts, dashboard. Only left sidebar was visible.
I was using wordpress Version 3.3.2. I was using php 5.5 on my local box.
Note: This issue nothing to do with plugins or images. When I realized on production server I was using PHP 5.3 and local box I am using PHP 5.5 version. I quickly solved issue.
I enabled debug mode of wordpress using wp-config.php file. You can open wp-config.php file put following code in that.
/** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */ define('WP_DEBUG', true);
When I checked apache error logs I found following error:
Fatal error: Access to undeclared static property: WP_Screen::$this in blog/wp-admin/includes/screen.php on line 706
This is old bug in WordPress 3.3 versions which causing issue.
To solve the issue you can update WordPress to the current stable release and do integration testing afterwards. Or you can do a quick bug fix.
Open file in your wordpress, wp-admin/includes/screen.php in any text editor.
On line no 706 find following PHP statement: <?php echo self::$this->_help_sidebar; ?>
Replace with above: <?php echo $this->_help_sidebar; ?>
Save changes and that will solve your issue.
<?php echo $this->_help_sidebar; ?>
Above code is working with PHP 5.3 version but with newer PHP 5.5 version. We are facing issues.