The Daily Plugin “Power Stacks” – My Shortcodes with Random Text

Today I am going to start what I hope is a semi-regularly occurring feature segment of The Daily Plugin series called “Plugin Power Stacks” where I will show a “Trick” or “Hack” for a few plugins that work together to get some added functionality out of your WordPress installation, whether that be in content creation, administration or user interaction. Today’s installment involves solving the two common problems when dealing with content that changes frequently or is date dependent, even if it’s just a sentence.

If there are two things that I use frequently in my “campaign-based” sites it’s the ability to create my own shortcodes, and the ability to pull content or keywords at random as if I were to draw a name out of a hat, or as complex as 20 different products that people could buy, with full HTML code cycling at random and embedded with a single shortcode. Here are two plugins that I found to be absolutely DEADLY when power stacked together. I know there are many more possibilities and I hope those that read this will share their own 1-2 punch combos that you use as well.

Here’s today’s WordPress Plugin Tag Team of Doom: Random Text and My Shortcodes.

Wordpress Developer PantsOnHead.

Random Text is from a developer named “PantsOnHead” from New Zealand. I’m not kidding. That’s the man’s name. But he might want to change that soon, because this plugin is killer and he needs to be recognized! This is one of the more colorful of profile images that I’ve seen in a while, so I just had to share. This plugin allows you to create random blocks of text or HTML that are called up by shortcode. You can add them based on their own unique category. For example, if I want to add a list of colors that I’d like to display at random, I can do it in a few different ways.

Random Text Plugin - Bulk InsertFirst I can add a list of brands one line at a time and select “bulk add“. Bulk add allows you to line delimit your entries and add a massive list all at once. As long as there is a hard-line break in what you are pasting, it will add in mass. This could include full HTML code with embedded images and links, or a full paragraph. It knows when to delimit the import when it detects a return to the next line. Another way to add content is one at a time, allowing for full pages and/or code inserts to come up at random based on a shortcode. I like to consider the categories as buckets from which to pull from in future posts.

Examples of some of the other basic content types I’ve also loaded into categories could include a “bucket” of first names that are gender specific, city names, pet names or even simple banner codes to display. On the more advanced end, you can include fully blown scripts for displaying just about anything you want at random. The shortcode is used by evoking something like [randomtext category=”colors”] which would display the item in order of the list, whereas a shortcode callout like [randomtext category=”colors” random=”1″] would display the same list, but in random order. The real limitations that I found were when I needed to insert random items that needed to be included in quotes, such as alt tags or titles, the plugin had problems getting things lined up exactly as planned.

With that issue in mind, we now move to a solution in the plugin titled My Shortcodes by David Cramer. This plugin is very complex, and can even be used to output OTHER PLUGINS in the Pro version, but more on that later. Though I only used it in a limited way, My Shortcodes allows you to create amazing shortcodes of your own creation. This includes using other shortcodes within it’s code, which is the solution to our particular problem with Random Text.

Before I merged this particular plugin with Random Text, I used to use it to help with updating content that was date dependent. The first of every month I simply modify one shortcode that I created to reflect the current month. So in my content, I can simply use something like “This deal is good throughout the month of [month], [year] and well into [next-month] as well.” Instead of having to edit a hundred old posts to remain relevant, I can simply change the value of what [month] represents to reflect the current month.

This plugin is meant to be a fire-breathing dragon right out of the gate. With it you can create custom shortcode elements or even download and install shortcodes made by other My Shortcodes users. It features areas for HTML/text entry, java script input, custom PHP libraries, external/CDN css and java script sources. Talk about loaded with plenty of firepower! You create anything you need in any format, name a shortcode of your own choosing, and it works!

Returning to the combo with Random Text. What we are now able to do is add the previous shortcode of [randomtext category=”colors” random=”1″] and just use [color] instead. Nothing fancy there. But imagine when you have proper short codes and random text setup so you can create a fully css integrated panel with a background set to your chosen random color, and a buy button of the same shade. Or even a cycling of images with affiliate links embedded in them that display completely formatted. In my case, I use it in a simple form of “Choose from top brands like [store-topbrand], [store-topbrand] and [store-topbrand]” and it would output the top brands at random. If I chose to use an HTML coded link with proper description attributes, I could also use that in the “top brand” designator and it would like to the brand pages.

In the advanced text manipulation end, I use My Shortcodes to embed a sponsor block at the end of my show notes in my music podcast. Every one of the 13 sponsors that I have has random text content, from how I call something a “coupon” or “promo code” at random to the anchor text that is used to drive traffic to another page on my site. I start on the sentence level, then work to the whole paragraph. What can be randomized and pulled from the “bucket” is included as long as it makes sense. I can stuff one shortcode from Random Text into My Shortcodes and go back and forth again. Once the paragraph is finished with all the Random Text shortcodes woven in, I then create a single shortcode for the whole “block”.

Now, when I want to insert the entire sponsor block in my show notes, I simply insert [sponsor1-block] and the entire formatted paragraph is perfectly placed in line. It gets even deeper. If I add each one of my sponsor blocks back into Random Text, I can then create a shortcode that displays only one of my sponsors at a time, at random. Another benefit to this method is that if an affiliate link changes, I simply have to change it in one line in the admin panel and it’s fixed throughout.

I know that I cannot do the My Shortcodes proper justice as far as describing its full potential, but I can tell you that it allows me to create a lot of shortcuts for things that I normally would have to create a lot of content for, or around. It allows me to split test on a massive scale, and change things on the back-end with seamless integration. In its most advanced form though, it allows you to create actual plugins from the My Shortcode system, where you can create your own custom plugins based on the data that is output. Very cool indeed.

If you happen to use either of the plugins suggested today, please consider making a nice contribution to them in any way you can. They have created some really great, functional plugins that completely expand how you think about creating your content.

I am interested in the feedback of others out there about their own plugin “stacking”. Sometimes, just one plugin won’t get you “across the bridge” and you simply need two to get you there. It’s often tough to think of these power combos until a need arises, so the more we share, the more we learn.