Solve the problem of LC IS UPDATE SITEMAP WHEN POST

Source: Internet
Author: User
Tags generator

How can I solve the problem of ILLEGAL STRING OFFSET LC_IS_UPDATE_SITEMAP_WHEN_POST in the BAIDU SITEMAP GENERATOR plug-in? This occurs when an article is published. Illegal string offset. For details, refer to PHP5.4 update notes.

The wordpress website map plug-in is now used by Liu Cheng's Baidu Sitemap Generator, which I use now! But sometimes this problem is reported! PHP Warning: Illegal string offset 'lc_is_update_sitemap_when_post 'in ...... /Wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php on line 406. The solution to this problem is:
Open the 406th lines in the baidu-sitemap.php file:
Run the following code:


If ($ get_baidu_sitemap_options ['lc_is_update_sitemap_when_post '] = '1 & prime ;){
Wp_clear_scheduled_hook ('Do _ baidu_sitemap_by_post ');
Wp_clear_scheduled_hook ('Do _ this_auto_daily ');
Wp_schedule_single_event (time () + 10, 'Do _ baidu_sitemap_by_post ');
}

Comment out the condition statement directly and change it:

 

// If ($ get_baidu_sitemap_options ['lc_is_update_sitemap_when_post '] = '1 & prime ;){
Wp_clear_scheduled_hook ('Do _ baidu_sitemap_by_post ');
Wp_clear_scheduled_hook ('Do _ this_auto_daily ');
Wp_schedule_single_event (time () + 10, 'Do _ baidu_sitemap_by_post ');
//}
That's all.

The modified code roughly means that every time an article is published, sitemap will be automatically updated.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.