I’m looking to reuse some small portions of html inside several pages/post but I don’t know how to obtain this on WordPress.

It would be nice if I could have a helper in the editor to include them, but this is only a nice to have feature, for the moment I need a solution for this.

3 Answers
3

Shortcodes work via Shortcode API. Essentially shortcode is just a human-friendly form of writing out data that is processed and passed to associated PHP function.

So adding your own shortcode involves:

  1. Coding PHP function that would process data, passed by API from shortcode.
  2. Registering that function as shortcode handler.

I also remember WP Utility Short Codes plugin was recommended in answer to some question while back as good way to insert snippets and such in editor.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *