Possible to create dynamic slider based on a changing tag?

wes's Avatar


17 Sep, 2013 01:48 AM

Hi. Your slider has been working great (seriously: nice work), and I've got something new I want to do with it, but I'm not sure how (or even if) it's possible.

What I want to do is use some nested short codes or PHP to have the site create a custom slideshow for the user.

If a concrete example will help: I have a state where users have a registered home state in their user profile. If they're logged in, I want to show them only photos tagged as being from their state. If they're not logged in, I want it to just default to the everything slideshow.

In the mapping plugin I'm using, this is done something like this to show their state's map:

[mashup query="post_type=post&tag=[state_abrev]" ]

where "[state_abrev]" is the shortcode for that user's homestate. This exact code might not work, but I'm sure I can do it with PHP if I need to.

Is something like this possible with your plugin? I suppose I could set up slideshows for each tag, and use the short code to call them, but if I there's a way to use tags in the shortcode for RoyalSlider, that'd be easiest.


  1. Support Staff 1 Posted by Dmitry Semenov on 18 Sep, 2013 11:46 AM

    Dmitry Semenov's Avatar


    Can't say that I completely understand what you're trying to accomplish.

    If you wish to add shortcode in slider - you can paste it directly in edit slide popup (HTML content tab) or in Slide Markup Editor.

    If you wish to create something completely custom, and generate the markup of slider manually via PHP, take a look at HTML-docs - http://dimsemenov.com/plugins/royal-slider/documentation/

  2. 2 Posted by wes on 18 Sep, 2013 04:13 PM

    wes's Avatar

    Wow: reading back I realize I did a miserable job explaining what I was hoping to do. Let me try again (with more coffee) .

    I guess what I'm wondering if all slideshows need to be manually assembled on the backend of the site, or if I can generate them by using shortcode or php in the page?

    More concretely, can I use code (php or short codes) to have a slider on a page that shows images from posts with a certain tag? Or do I have to create the silder on the backnend of the site first?


  3. Support Staff 3 Posted by Dmitry Semenov on 19 Sep, 2013 11:39 AM

    Dmitry Semenov's Avatar

    Thanks, I get it now. Unfortunately there is no public PHP method to create a slider based on tag.

    As I suggested before, probably the best solution would be to generate the HTML of a slider completely manually, it's pretty simple http://help.dimsemenov.com/discussions/royalslider-wordpress/5247/r...

    You may use WP version just to include files http://help.dimsemenov.com/kb/wordpress-royalslider-tutorials/wp-in...


  4. 4 Posted by Todd Lambert on 16 Jun, 2019 07:54 PM

    Todd Lambert's Avatar

    I appear to be looking for the same thing as the OP here.

    I am trying to create a tag and category template file in WP and have a slideshow created programmatically on these pages. As it is now, I have to manually make a slideshow for each of my site's designated tags that show up in the wordpress tag cloud feature in WP. Basically, a tag cloud, where the results are shown via a slideshow.

    At minimum, it would be nice if I could link to a slideshow using the name of the slider rather than the id. Something like echo get_new_royalslider('mytag');

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac