• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Printing Shortcodes Efficiently in WordPress – Best Practice

Konstantin Koveshenin from Automattic publishes some great little tips on his personal blog occasionally.

His post titled Don’t do_shortcode is one example of 2 ways you can print short codes and which one is best practice.

In this post, we’ll look at examples of how the 2 methods work and how to use them via your child themes functions file in any theme.

Firstly, here’s a very basic function which creates a short code named [text_shortcode] for demonstration purposes.

Register for full access

Related Tutorials

  • Calling Gravity Forms Efficiently
  • Print WordPress Gallery Callback Function Rather Than do_shortcode

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems