Add a shortcode to add_shortcode in functions.php

This drove me a little crazy one afternoon. I had to add a gravity forms shortcode to a new add_shortcode script in functions.php

To accomplish this, I added this to my code:

' . do_shortcode($content) . '

Here is how it looks in its working example. I work best by watching. Too many people just give the answer without providing the question:

Implementation

On the WordPress.org side, I used this to implement the shortcode:

Hope this saves you a bit of time.

Isaac Adams-Hands

Full Stack Developer, Digital Marketer, and InfoSec enthusiast. He received his Bachelor’s Degree from the University of Western Sydney and his Business Diploma from Georgian College before joining various marketing positions in search portals, e-commerce, higher education, and addiction recovery services.

Follow @ twitter

Related posts

Dynamic Page Listings in #WP

Here is how-to dynamically list all children pages associated under a parent page in WordPress. This allows you to change and update pages without updating a sidebar widget/page, and removes the need to create numerous distinct sidebars/sections. To enable this code, add it to your WordPress themes functions.php file, then add the shortcode to the… Read More

HTML sitemap w/o a WP Plugin

Have you heard about HTML sitemap? Well, it offers easy navigation for your website visitors. To be more precise, it’s the bulleted outline text version of a website. The visitors can use the sitemap to easily find/locate any topic which they can’t find searching through the whole website menus. The best part is that HTML… Read More