How to Fix Issues With Viewing WP HTML Sitemap
While installing wp-html-sitemap plugin today, after setting up everything I saw that the sitemap page returned shortcode [wp_html_sitemap]. Googling did not worked, even support forum doesn’t have any resolution on this issue. So I decided to debug the issue with plugin myself since debugging becomes tough for developers if they can’t replicate the issue on their own testing environment. I tried to print registered shortcodes with wordpress and found that [wp_html_sitemap] was not getting registered with wordpress. So the issues was with line on how shortcode was defined with add_shortcode function.
How to Fix
1. Open wp-html-sitemap.php file and find add_shortcode function on line number 210.
2. Replace line add_shortcode( ‘wp_html_sitemap’, ‘wp_html_sitemap_shortcode::start’ );
3. With add_shortcode( ‘wp_html_sitemap’, array(‘wp_html_sitemap_shortcode’, ‘start’) );
4. Save file and upload file on server.
5. Now access sitemap page in web browser
6. If you are using cache plugin make sure to delete cache first.
Why add_shortcode( ‘wp_html_sitemap’, ‘wp_html_sitemap_shortcode::start’ ); not working for some installation?
The above line will work fine on PHP 3.0 and above. PHP < 3.0 do not support :: to reference the class. So for backward compatibility we need to declare class function using array.
Thanks a lot, I have same problem and think how to solve it all day, I’m searching internet and found you post. it help me