Create a simple shortcode in WordPress

Use code snippet to create a simple WordPress shortcode. I have created a sample shortcode prefix-portfolio with 2 attributes.

Before use change:

  • Change the Prefix with your own unique prefix.
  • Change the prefix with your own unique prefix.

How to use?

  1. Create a new page and add shortcode.
  2. Open the page. It’ll show the output of the shortcode like below:

Code Snippet

Advertisements

Author: Mahesh Waghmare

I'm a professional WordPress theme/plugin developer since 2012.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.