[ submit_form post_type='POST_TYPE']
[ advance_search_page post_type='POST_TYPE']
[ map_page post_type='event' image='thumbnail' latitude='21.167086220869788' longitude='72.82231945000001' map_type='ROADMAP' map_display='1' zoom_level='13' height='450']
These are the Tevolution Plugin based shortcodes that help you in creating some of the very common but important pages with in just no time.
Have you ever had a time where you wanted to add some specialized content to your WordPress post or page, but weren’t sure how? Maybe you wanted to embed a Twitter widget or some content called back from some website or API. How can you easily add this type of content to your WordPress post? Fortunately, WordPress provides something called a shortcode to make this kind of task extremely easy. This tutorial will take you through the process of building, installing, and using a shortcode in your WordPress installation. Let’s start by seeing what a shortcode is.
Briefly, a shortcode is a special tag that you can enter into a post that gets replaced with different content when actually viewing the post on the website. If you have ever embedded a WordPress gallery on your blog, then you’ve already seen the built in short code .
When you load a blog page with the shortcode, WordPress replaces the shortcode with all of the code that actually displays a gallery of your images.
As you can see from the above example, a shortcode looks similar to an HTML tag, but is enclosed with square brackets instead of angle brackets. This code gets replaced with some other code when the page is actually loaded in a web browser. The really cool thing is that WordPress allows you to create your own custom shortcodes to display pretty much anything!
In case that doesn’t make sense, let’s look at an example. Let’s say I want to output an AdSense ad within my post. I could go into the HTML mode of the WordPress content editor and copy and paste the Adsense code block into it, but this would be tedious and potentially distracting with all the extra markup in my post. In addition, if I wanted to change the ad block, I would have to go back to each and every post to change it to the new one. An easier way and more reliable way to add the Adsense block wherever I wanted would be to use an adsense shortcode. The shortcode could look like this:
That’s it! The first parameter passed in is the name of the shortcode, so in our case, ‘adsense’ tells WordPress to create the [adsense] shortcode. The second parameter designates the function that will be called when the new shortcode is encountered. Again, in our case, ‘get_adsense’ tells WordPress to replace [adsense] with the results of our get_adsense method.
Not too bad is it? Now this is a very simple shortcode, WordPress allows you to do much more with your shortcodes, including adding parameters (maybe you want to choose between adsense blocks?).