How to make shortcode in wordpress

How to make shortcode in wordpress

February 17, 2012 Shortcode is a set of function to use in your post/page content. For instance, we use contact form 7 or any gallery plugin, we use a simple code to put in our post/page content: [contactform] Its really easy to built. Shortcode is define in your theme file function.php. Below is a simple example to built the shortcode. function my_short_code( $atts ){ $code = "Shortcode is really easy."; return $code ; } add_shortcode( 'my_code', 'get_zipcode' ); Now we can use [my_code] as short code in our post/page content. It will generate "Shortcode is really easy" as output.

Related Posts

from my blog


Hire WordPress Experts: Building Your Online Presence with Confidence

April 10, 2024

WordPress can help you create an online presence that is effective for your company. WordPress is a top-rated content management system. To harness its power, you need WordPress specialists. What...

Why Should Your Hire Freelance Web Developer: The Top Benefits

May 17, 2022

When developing a website or an app, there are two major ways to do it - outsource the job to a web development company or hire a freelancer to get...

Improve The Reach of Your Business With WordPress Development Services

December 28, 2015

Social media marketing has undoubtedly changed the game between companies that are constantly in competition with each other. Not only has social media allowed better access to customer thought and...