Use the Kunze Law Plug-In to import content (HTML snippets) from a central remote Address into a post or page using a shortcode. This is very beneficial in case you deliver content for several
WordPress installations which needs a periodical update. The Plug-In will cache the remote content locally. After a predefined time, which can be set within the Plug-In, the snippet will be
pulled again. The big advantage: In order to get all websites updated, you only have to edit the snippet on the remote server.
Example:
Imagine you are using the Plugin and a HTML snippet in hundreds of your websites. In case of content changes you only have to edit the snippet on the remote server. After expiry of the set cache time the new
content will be pulled from the remote server. No need to do this manually on every website.
How to start:
- Set up the remote server. Choose the url of your remote server.
- If you would like to receive an E-Mail in case of remote access problems, please activate the “Get E-Mail Error Message checkbox”. Please provide a valid “E-Mail Error From Address” value.
- Create HTML snippets. A snippet is a html file. The content of the snippet will be delivered. Always use filename.html as the file name. “filename” can be replaced to your need.
- Upload the snippets onto the remote server.
- Install the Plugin and fill in the following information:
- Remote Server. e.g. http://yourserver.com/content
- Cache time in seconds. This is the time in seconds after the plugin will look for updated content on the remote server.
- In order to get the content of a snippet named facebook.html, you have to use
[kunze_facebook]
as the shortcode.
- Embed the shortcode within WordPress. This works in pages, posts and widgets.
Naming convention:
Shortcode within WordPress: [kunze_filename]
HTML Snippet on remote Server: filename.html
Example of a HTML snippet:
`<div class="myClass"><strong>lorem ipsum</strong></div>```
The Kunze Law..
- in case of problems with the remote server, a message can be send to the WordPress administration email address. (Settings > General > E-Mail Address). The email is send only once.
- will cache locally your HTML snippets. If the remote server does not work any longer – the local saved snippets will be served.
- works within a WordPress Multisite installation
- is based on regular expressions