In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to establish a wordpress content backup mirror site, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
As a shrimp webmaster, he is actually a rookie who does not understand the code. because his site is a small water pipe host, and its stability is difficult to guarantee, under the suggestion of many visitors, he also wants to establish a content mirror site. to achieve that when the host of the master station is maintained, there can be a backup site for visitors to visit.
At first, I wanted to have a shared database that could be used by two sites together, but after checking the information, Baidu found that it did not seem to be applicable to the virtual host site.
Until you find the following code, you can automatically publish the article on the mirror site when the origin server publishes the article.
The first step is to create a php file named post.php in the root directory of the mirror station with the contents of the code:
/ / the following is the body of the code.
Add the following code before, set the key, and modify the API address.
/ / push add_action ('publish_post',' fanly_sync_post'); / / Hook, execute function fanly_sync_post ($post_ID) {$key='123456'; / / enter the key $url=' http://3838521.com/post.php';//API address you set when the article is published, which is the site that accepts the data, and modify it to your own site $post_info = get_post ($post_ID) If ($post_info- > post_status = = 'publish' & & $_ POST [' original_post_status']! = 'publish') {$title=$_POST [' post_title']; $content=$_POST ['content']; $date=$_POST [' aa'].'-'. $_ POST ['mm'].' -'. $_ POST ['jj'].'. $_ POST ['hh'].':. $_ POST ['mn'].':'. $_ POST ['ss'] $category='';for ($xbirthday 1x
Copy the above code, it is best to use Notepad + + and other tools to save as php files, packaged into zip documents, in the wordpress plug-in installation background upload, install and enable.
In this way, a plug-in form exists, and the theme will no longer have an impact after the upgrade.
Question 2, some topic editors support short codes such as password visible, paid visible, etc., but the short code is different from the output mode in the editing mode. When the content of the mirror station is in the output mode, it is possible to output an exception.
My solution is also to use small plug-ins to make an automatic modification of the code. The code is as follows:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.