You can now nest shortcodes from other themes and plugins within Dynamic Text!
This is effectively a localization plugin that allows you to have dynamic text, pictures and really any content on your WordPress pages and posts that changes depending on the content of your url (domain). To use this plugin, you can use this settings page to create an unlimited number of domains. Each domain is associated with the title for the domain, which is always DynamicDomain_”number associated with your domain or url content”. These titles are used as attribute values for the shortcode associated with this plugin and will be listed right next to the domain you enter on this page. The shortcode itself is [dynamic_text][/dynamic_text] and the attribute is “domain.” Your content goes in-between the shortcode. To add additional domains, click the “Add New Domain” button on this page. To save your domains or to change previously set domains, click the “Save Domain Names” button.
*If you save the domain “test.com” as DynamicDomain_1 and want content to show up only when “test.com” is in the url for your page, then you would enter the following: [dynamic_text domain=”DynamicDomain_1″]Your content goes right here[/dynamic_text]
*If you save the domain “mydomain.com” as DynamicDomain_2 and want content to show up only when “mydomain.com” is in the url for your page, then you would enter the following: [dynamic_text domain=”DynamicDomain_2″]Your content goes right here[/dynamic_text]
*If you save the word “door” as DynamicDomain_3 and want content to show up only when “door” is in the url for your page, then you would enter the following: [dynamic_text domain=”DynamicDomain_3″]Your content goes right here[/dynamic_text]
*If you have a shortcode from any other plugin or theme that you want to only have work for a particular domain you can simply nest the shortcode between the dynamic text shortcode with the appropriate domain set like so: [dynamic_text domain=”DynamicDomain_2″][Your other shortcode goes here][/dynamic_text]
While this is plugin can be used strictly for localization, you can also use this plugin to swap content on your site based on any phrase contained in the url. In the case of localization, rather than having to set up separate wordpress sites for different countries you can instead use this plugin to have a central site and swap the content based upon the domain being used to access the site (so someone hitting the site from the UK and using .uk could see different content on the site than someone reaching it from the US using a .us extension). Alternately, if you just want page content to swap on a page depending on terms contained in the url, you can use this plugin for that as well. Additionally, you could combine this plugin with a custom theme then use the plugin to swap out content on templates in your theme depending on the domain used to reach the site. In that case, you could setup 1 website but have it appear to be an unlimited number of separate websites depending on the domain used to reach the site, with a completely different look and completely different content displayed per domain using the combination of this plugin and your custom theme.
Dynamic Text Plugin.zipto the
/wp-content/plugins/directory via the ‘Plugins’ menu in WordPress
Activate the plugin through the ‘Plugins’ menu in WordPress
Navigate to the “Dynamic Text Domain Settings” page located in the WordPress Admin menu under “Dynamic Text”
Set your domain names
Place your short code and content where applicable, referring to the “Description” section of this readme for proper usage.
- Why did you make this plugin?
Because I have worked with companies that have had WordPress sites intended for the US and other countries, and this is
a nice way to swap content out based on the domain used when landing on the site. Usually if you wanted a .com and a .US version of a site, you would have to set up two separate wordpress sites.
This plugin makes it so you can use one site instead and simply swap out page content depending on the domain associated with the site when a page loads.
- I’ve got my content between shortcodes but am not seeing any content when I load the page
Make sure you’ve chosen the right domain name for the page you are viewing, otherwise you will not see the content. This is the intended behavior
of the plugin.
There are no reviews for this plugin.
Contributors & Developers
“Dynamic Text” is open source software. The following people have contributed to this plugin.Contributors
Translate “Dynamic Text” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changed html and styling for the settings page to make it more responsive on mobile devices, added the ability to delete/reset option 1 and changed the underlying code to be more object-oriented
Shortcodes from other themes and plugins can now be nested inside Dynamic Text. Also added individual delete buttons for saved domain info and changed the shortcode function to include parsing page data in addition to domain date (this allows the plugin to work based on any string in the url now rather than just the domain)
Completely overhauled the entire plugin, consolidating the shortcode names and functions into 1 and allowing for attributes to instead dictate behavior. The plugin also now allows for an unlimited number of domains.
This is the first version of this plugin.