Well that is the thing with WordPress in general.
You could just make a secondary shortcode with the same slug but no template then alternate their state.
Hi David,
thanks for your fast response and your suggestion. I tried it but it didn’t work:
I created a second shortcode with the same slug and a different html code, hoping that when I switch off the first shortcode and activate the second, then the second html would also be displayed. But it wasn’t – it kept displaying the html from the first shortcode, even if the first one was deactivated and the second was activated.
To be sure, I also tried it exactly as you said: The second shortcode without any html / template, but it still kept displaying the html of the first shortcode…
Hmmm – Could I have done something wrong?
David,
do you think you could implement this feature in your plugin: being able to switch between two (or more) shortcodes with the same slug but different contents?
That would be awesome!
Thanks so much
Thomas
Hi Thomas,
I did some testing and found that it would always use the code from the first.
I’ll make a fix for it asap.
I have just pushed an update that will fix this.
now you can alternate between two of the same slug elements and it will only use the active one.
Hi David,
thanks so much for releasing an update to fix this issue!
One last question before I mark this thread as solved (and give your plugin a 5 star rating 😉 ):
This alternating is also possible with more than two elements with the same slug, I assume? Theoretically, with limitless elements with the same slug – is it not?
I’m so sorry I missed this.
You can theoretically have many elements with the same slug, but only 1 activated at a time.