QuickCodes are used inside the HTML block of a WPCoder item.
β οΈ If you use QuickCodes in the WPCoder Pro plugin, all shortcodes must be closed, e.g.:
QuickCodes are divided into 4 main groups: General, Menu, Post/Page, Archive.
πΉ General
Current Object
{{obj.id}}
Get the current object ID.
Get Option
{{option.key_name}}
Get option by name.
Examples:
{{option.blogdescription}}β Site description (default: βJust another WordPress blogβ).{{option.blogname}}β Site name.{{option.home}}β Site URL.
Languages
{{language.en_US}}This is English Text{{/language}}
{{language.es_ES}}Este es texto en EspaΓ±ol{{/language}}
Output different content per site language.
Term
{{term.link.ID}}β link for a term by ID{{term.name.ID}}β term name by ID{{term.description.ID}}β term description by ID{{term.count.ID}}β number of posts in term
Empty
Check if a variable is empty:
{{empty.option._wpcoder_tax_icon_35}}
{{option._wpcoder_tax_icon_35}}
{{/empty}}
- If
{{option._wpcoder_tax_icon_35}}is empty β outputs nothing. - If not empty β outputs its value.
Get Posts
{{get_posts}}Your loop code here{{/get_posts}}
Retrieve posts with arguments.
- Use dot (.) to separate argument keys.
- Use pipe (|) to separate values. Arrays allowed.
Example β get 5 posts from categories 27 and 32:
<ul>
{{get_posts.numberposts|5.category|27,32}}
<li class="snippet__item">
<a href="{{post.link}}">{{post.title}}</a>
</li>
{{/get_posts}}
</ul>
Menu
{{menu.menu_id}}Your loop code here{{/menu}}
Loop through menu items.
Available QuickCodes:
{{item.label}}β menu item text{{item.link}}β menu item link{{item.title}}β item title attribute{{item.description}}β description{{item.class}}β item class{{item.current_class}}β adds current-menu-item class to active item{{item.current}}β adds aria-current=”page” attribute to active item
Example:
{{menu.886}}
<a href="{{item.link}}" class="navbar-item {{item.current_class}}"{{item.current}}>
<span class="{{item.class}}"></span>
<span class="ml-1">{{item.label}}</span>
</a>
{{/menu}}
Post / Page
{{post.title}}β post/page title{{post.excerpt}}β excerpt{{post.content}}β content{{post.clean_content}}β content without<p>/<br>auto formatting{{post.comments}}β comments block{{post.image}}β featured image<img>tag{{post.image_url}}β featured image URL{{post.link}}β post/page URL{{post.cat_name}}β first category name{{post.cat_link}}β first category link{{post.cat_count}}β number of posts in first category{{post.author_name}}β author name{{post.author_bio}}β author bio{{post.author_avatar}}β author avatar (96px){{post.author_link}}β author link{{post.publish_datetime}}β published date (datetime format){{post.publish_date}}β published date (site format){{post.update_datetime}}β updated date (datetime format){{post.update_date}}β updated date (site format){{post.comments_count}}β comment count{{post.meta.key_name}}β custom field value{{post.meta.key_name.int}}β custom field as integer{{post.link.id.post_id}}β link for a post by ID{{post.title.id.post_id}}β title for a post by ID{{post.excerpt.id.post_id}}β excerpt for a post by ID{{post.image.id.post_id}}β featured image for a post by ID
Tags
Loop through post tags:
{{tags}}
{{tag.id}}
{{tag.link}}
{{tag.name}}
{{tag.description}}
{{tag.count}}
{{/tags}}
Example:
{{tags}}
<a href="{{tag.link}}">{{tag.name}}</a>
{{/tags}}
Posts Navigation
Navigation for next/previous posts:
{{post.next}}β ID of next post{{post.previous}}β ID of previous post
Often combined with {{empty}}β¦{{/empty}} for safe output.
Example:
{{empty.{{post.previous}}}}
<a href="{{post.link.id.{{post.previous}}}}">
{{post.title.id.{{post.previous}}}}
</a>
{{/empty}}
{{empty.{{post.next}}}}
<a href="{{post.link.id.{{post.next}}}}">
{{post.title.id.{{post.next}}}}
</a>
{{/empty}}
Archive
For use only on archive pages:
{{archive.title}}β archive title (without prefix){{archive.description}}β archive description{{posts.pagination}}β pagination links{{posts}}β¦{{/posts}}β loop through archive posts (supports all post QuickCodes)
Example:
<ul class="card__list -snippet">
{{posts}}
<li class="snippet__item">
<a href="{{post.link}}">
<p class="title _size-1">{{post.title}}</p>
<p class="_size-0_75">{{post.excerpt}}</p>
</a>
</li>
{{/posts}}
</ul>