Using shortcodes with slugs

[Before reading this article, make sure you know how to retrieve slugs of categories and posts.]

 

Let’s illustrate usage of shortcodes that utilizes slugs.

Portfolio (uses category slug)

Click the portfolio adding button in your Text Editor and select one of displaying modes, e.g. “slider” (fig. 1):

Fig. 1. Portfolio shortcode.

Fig. 1. Portfolio shortcode.

Code like this will be pasted to your Text Editor:

[dt_portfolio type="slider" category="" order="" orderby="" number="6" show_title="true" show_excerpt="true" show_details="true" show_link="true" height="270" width="" show_text_hoovers="true" arrows="true" margin_top="" margin_bottom=""]SLIDER_TITLE[/dt_portfolio]

It looks a bit messy, but all attributes and parameters have self-explaining names.

All you need to do is to add value of “category” parameter. That’s where you put your portfolio category(s) slug. Like so:¬†category="art, design"
As you’ve probably noticed, you can add multiple categories, simply separating them by comma.

 

Slideshow (uses individual slideshow slug)

Adding slideshow shortcode is even simple. Click the slideshow shortcode button (fig. 2):

Fig. 2. Slider shortcode.

Fig. 2. Slider shortcode.

Following code will appear:

[dt_slideshow width="1200" height="500" posts="" /]

Simply add slug(s) of slideshow(s) to “posts” attribute. Like so: posts="porthole"