Quick and Simple WordPress® Shortcode – Straight from the Developers Desk

A white, rounded square logo with an abstract S-shaped design on a gradient blue and purple background.

Interested in creating custom shortcodes in WordPress®? It is really easy.  Below is an example of a shortcode that we recently used:

Screenshot of a PHP code snippet defining a shortcode function named listpractices_function to list pages with a specific post type. The quick and simple WordPress shortcode returns an unordered list and is registered with add_shortcode, straight from the developers desk.

You can add this directly to the functions.php file.  Something to keep in mind is that you do not want to echo anything, so just set variables then return whatever at the end.  This short code lists all practice areas when you enter “[list_practices]” in the text editor in WordPress®.

Share This
Blog Decorative Background

Join the Sales and Marketing News, receive our last insights, tips and best practices.

Our 7 Guarantees

Keeping 2,000+ Clients Happy Since 2001.

1
You Will Love Your Design We design to please you and your clients
2
Same-Day Support 24-hour turnaround edits during business hours
3
Free Education We provide knowledge to help you expand
4
No Hidden Charges We quote flat-rate projects
5
Own Your Site No strings attached
6
We Create Results SEO, PPC, content + design = clients
7
We Make Life Easier One agency for web, branding and marketing