Custom Content Shortcode



From a single field to entire pages, Custom Content Shortcode is a set of commands to display content where you need.

The [content] shortcode displays any of the following: posts, pages, custom post types, fields, images, menus, or widget areas.

The [loop] shortcode performs query loops. It can display, for example, available products in a category, or excerpts from the 5 most recent posts. You can query by parameters such as: post type, taxonomy, date, and field values.

There is a reference section under Settings -> Custom Content.


Here are some of the included features:

  • Wide range of query parameters to display site content
  • Conditional content based on field value, login status, etc.
  • Overview of your site’s content structure
  • Relative URLs for links and images
  • Cache the result of a query
  • Optional: Gallery field, Mobile Detect, Math

Support for other plugins: Advanced Custom Fields, WCK Fields and Post Types


  • Documentation and examples
  • Content overview page
  • Gallery field


  1. Install & activate from Plugins -> Add New
  2. See: Settings -> Custom Content


Installation Instructions
  1. Install & activate from Plugins -> Add New
  2. See: Settings -> Custom Content


Brilliant mid-level WP development

The plugin is perfect solution for intermediate web admins. As while as you know the basics of a programming language, you can do almost everything with this plugin in WP.


I wanted something simple: the current post’s excerpt in a widget (for readers who hate scrolling past header images). Should’ve been straightforward but all the advice I found was … wrong. By the time I installed Custom Content Shortcode, I’d miserably resigned myself to building my own widget after a crash immersion course in secondary loops. I really wasn’t expecting this plugin to do the job!

Within THREE MINUTES of activating, I had a one-line shortcode that runs the task perfectly. What’s more, the amazing documentation has shown me lots of ways to polish things up with interactive bells & whistles. I couldn’t be happier 😀

THANK YOU, Eliot Akira!

The person below me said it best

Perfect for intermediate users. I know PHP. I know how to code in WordPress. But this makes things much, much easier. I don’t even care about saving time as much as I do with it working. Writing your own code is fraught with the usual deductive process that naturally comes with it. This plugin seriously cuts down on this aspect. I’ve never been more seriously about a free plugin when I say you should consider giving this dev a word that starts with “D” and ends in “onation”.

Read all 130 reviews

Contributors & Developers

“Custom Content Shortcode” is open source software. The following people have contributed to this plugin.




  • [each] – Add default field count for each term’s post count


  • [if] – Add parameter count for field value array, such as relationship fields
  • [if] – Improve field=content,excerpt with parameter contains
  • [is] – Allow nested
  • Content overview: cleaner list of shortcodes


  • [loop], [loopage] – Add parameter query to use custom query variable for pagination


  • [user] – Add field registered and parameter format (“relative” or custom format)
  • Settings – Add option to enable shortcodes in widget title


  • [format] – Add parameters split and part; handle field values of number type in list
  • [attached] – Add field download-url, to get URL to actual PDF file instead of generated preview image
  • [url register] – URL to registration form under wp-login
  • [pass] – Add parameter trim=all to remove all white space, new lines, tabs
  • ACF [related] – Add parameters start and count
  • Improve use of content filter with other plugins; support for Beaver Themer in progress


  • Minor fixes in reference pages


  • [attached] – Support parameter count for gallery field
  • Meta Shortcodes – Improve code editor


  • Improve compatibility with PHP <5.3
  • Correct static function call to get_image_field()


  • [attached] – Add parameter orderby=random
  • [is] – Improve check for login/logout status
  • [loop include=children] – When list=true, append children after their parent


This update includes a newly rewritten feature for [loop include=children]. Previously, children were appended after their parent wherever they occurred; now all descendants are included as equals and follow loop query parameters like orderby. If you were using this feature, please test before deploying to production.

  • [loop] – Add parameter level to set descendant level (number of generations)
  • [loop include=children] – Complete rewrite and update: improve handling of additional queries, internal [if] conditions, counting levels
  • [pass] – Add support for date_format


  • [loop] – Add predefined values published and modified for field query
  • [loop], [comment] – Optimize getting total comment count
  • [if field] – Support WCK fields: inside [metabox] loop, or add parameter metabox


  • [for type] – Post type rewrite slug for use in URLs: [each prefix]
  • [for type] – Post type archive URL: [each url]
  • [if] – Support for post type loop: if first, last, every, archive, prefix


  • [if] – Fix refactored code to handle default condition
  • Pagination – Fix warning when permalink slug does not exist
  • [if] – Optimize/refactor code
  • [note] – Ignore note content completely: do nothing
  • [for type] – Correctly pass post type slugs to [loop-count]
  • [for type] – Add debug=true to inspect post type query
  • [if] – Improve check for empty or zero value
  • [loop] – Add debug=true to inspect query
  • [pass] – Add documentation for nested levels
  • Improve support for The Events Calendar plugin: display=custom


  • [loop] – Add parameter orderby=child-date
  • [for type] – Improve check for included post types
  • [loop-count] – By default, perform query to count posts when inside [for type]


  • [field] – Add predefined fields: post-class, gallery-url
  • [field] – Add parameter until to trim value until specified character(s)
  • [related] – Add parameter fill=true to include unrelated posts until post count is met
  • [related] – Add parameter status to get future or draft posts
  • [loop exists] – Support [if empty] to display something if no post exists
  • [loop-count] – Display post count of query result if loop parameters are given
  • [the-loop] – Allow nesting by - prefix
  • [pass field] – Add parameter escape=true to escape HTML special characters


  • [array] – Add parameters slugify and glue
  • [calc] – Share variables with get/set shortcodes
  • [field] – Add default field after-excerpt to show content after read more tag
  • [field] – Add https=true to prepend protocol to field value
  • [field excerpt] – Apply get_the_excerpt filter to result
  • [format] – Add parameters: ucfirst, ucwords, plural
  • [if empty] – Improve check for empty ACF repeaters
  • [if every] – Improve when combined with first or last parameters
  • [if total] – Condition to check total post count
  • [if var] – Check variable set by [set] or [calc]
  • [loop] – Add parameters tax_compare and field_compare
  • [loop exists] – Improve check for empty query result
  • [loop name] – Support query by multiple post names
  • [pass list=$var] – Use variable as parameter value
  • [repeater] – Improve handling of nested repeaters
  • [set] – Add trim=true to trim spaces and new lines from start/end of value
  • [users] – Support query by multiple roles, for example: role=admin,editor
  • [when start] – Switch condition when value starts with a string
  • Gallery field – Improve sort function and thumbnail display
  • New optional module: Meta Shortcodes


  • [loop] – Improve published and modified date query for specific value


  • [field modified] – Support date_format=relative
  • [loop child=this] – Correctly handle include=this when current post is top parent
  • [if route], [switch route] – Support matching URL routes by wildcards
  • [get], [set], [pass] – Get/set/pass variables; see Advanced > Extras > Variables
  • Documentation – Update to Parsedown v1.6.0


  • [loop child=this] – Loop through current post’s parents from the top
  • [comments] – Support filter by taxonomy term ID
  • [if host] – Check server host name: can be used to distinguish between localhost or staging/public site


  • [loop exists] – Perform a query first to check if any post matches the given parameters
  • [format] – Format number or date; see Advanced: Extras
  • [calc] – Perform spreadsheet-like calculations; see Optional: Math
  • Documentation – Add a note about how to create a custom image size using Simple Image Sizes


  • [if] – Add parameter compare=not
  • [loop] – Correctly handle list_class and item_class as before
  • Improving multisite compatibility – thanks to @keyra


  • [users] – Add list parameter
  • [flex], [layout] – Add default layout
  • [if] – Improve condition with and


  • [loop] – Sort by multiple fields: orderby_2, orderby_3..
  • [loop] – Improve menu title links
  • [if], [switch] – Add parameters today and day_of_week
  • [user] – Support custom user image fields
  • [block] – Support nested blocks


  • [content] – silently catch get_term_link error when the term does not exist


  • [loopage] – Correct default text for next post
  • [pass] – Add feature to create a range: list=1~10, list=A~Z
  • [pass array] – Clarify documentation for array as a series of values
  • WP 4.4 compatibility – Adapt to admin style changes
  • PHP 7 compatibility – Adapt to syntax changes


  • [field] – Add parameters: site=name and site=description
  • [field] – Enable getting value from another post when inside ACF repeater or flexible content


  • [attached] – Correct getting field by specific attachment ID


  • [field], [if], [pass] – Better support for ACF gallery field
  • [field] – Parameter id takes priority even inside repeater/flex field
  • Support getting fields from ACF option pages: option=true
  • Add change log to documentation


  • [if] – Add parameter and for multiple conditions
  • [if] – Add parameter decode=true when comparing a value that is URL encoded
  • [if each] – Support multiple terms; matches any of given
  • [field] – Support multiple classes separated by comma
  • [field] – Add parameter glue to use as separator when field is array; default is a comma with space after it
  • [switch], [when] – New – Check condition against multiple values
  • [url current] – Return current URL


  • [if check] – Condition to check passed value
  • [if exists] – Condition to check if enclosed content is not empty
  • [get-blog] – Improve shortcode processing


  • [is login] – Keep current user when used inside [users] loop


  • [loop] – WP_Query needs uppercase “ID” for orderby=id


  • [if before/after] – Add parameter field_2 to use as reference for relative date


This update includes a number of changes to correct date/time field comparisons, adjusting for differences between WordPress and PHP time functions. This changes existing behavior, especially regarding timezone offset. If you’re doing date comparisons, please test your code before using it in production.

  • [loop], [if] – Correct date/time field comparisons
  • [attached] – Improve use inside nested loops


  • [attached field] – Get attachment ID from field
  • [if field contains] – Improve loose keyword search
  • [field date] – Add date_format=relative
  • [loop] – Correct compare between numeric field values
  • [pass] – Add parameter date_format
  • Add settings for loop pagination permalink


  • [if] – Add parameters query and route
  • [field] – Add predefined fields: parent-id, parent-slug


  • [content], [field] – When trimmed by length parameter, add html=true to keep HTML tags
  • [if field] – Add contains parameter to search for keywords; support searching multiple fields
  • [the-pagination] – Use same function and parameters as [loopage] for paginating default query


  • [loop] – Support offset and paged together