Last week I featured three tips for effectively utilizing shortcodes. Now what’s the point in having all of that knowledge if you can’t use it? It’s time to get down and dirty with some shortcodes that you can use on your WordPress blog right now.
Your level (or lack) of expertise doesn’t matter – shortcodes can be successfully implemented by anyone who knows how to copy and paste!
Every single one of the shortcodes below has been tested and works with WordPress:
Hello World! Most Recent Post Related Posts Display AdSense Content for Registered Visitors Only RSS Feed Display Disable WordPress Auto Formatting Embed a PDF Feed Only Content Hello World!
Don’t worry – I am not trying to suggest that a really helpful shortcode is one that allows you to display “Hello World!” But this super simple shortcode is included because it demonstrates what you can do with just a little HTML knowledge.
The potential applications are endless – you could use a shortcode like this any time that you wish to display something on more than one page (such as social sharing buttons, a newsletter signup form, or a simple call to action). Rather than typing out the same code every time, just reference the shortcode.
function HelloWorldShortcode() { return ‘<p>Hello World!</p>’; } add_shortcode(‘helloworld’, ‘HelloWorldShortcode’);
As you can see, it is very simply to change what message you want to display, and you can include full-blown HTML and CSS.
Whenever you want to include the content stored in the shortcode, just enter this into your WordPress editor:
[helloworld]
Source: https://www.sitepoint.com/wordpress-shortcodes-tutorial/
Most Recent Post
Having the ability to display your most recent post is one of those “stock” features that can be useful in a multitude of applications. For instance, I recently built a website for
Keep reading this article on wpmudev.org