Custom Shortcode: Attribute Values Not Being Replaced
-
Hi,
I’ve created a shortcode with the slug premium_player as follows:
<script type="text/javascript" src="https://cdn-static.liverail.com/js/LiveRail.AdManager.Flowplayer-5.4.6.1.plugin.js"></script> <!-- Flowplayer global options --> <script> flowplayer.conf = { 'LR_PUBLISHER_ID': "73995", 'LR_AUTOPLAY': "1", 'LR_TITLE': "{{videoTitle}}", 'LR_VIDEO_ID': "1", 'LR_TAGS': "{{videoTags}}", 'LR_CONTENT': "1", 'LR_URL': "[LR_URL]", 'LR_VIDEO_DURATION': "{{videoDuration}}", 'LR_DESCRIPTION': "{{videoDescription}}", 'LR_MUTED': "0", // add other optional LR_ params here }; </script> <div class="flowplayer" data-key="$399222213207867" data-analytics="UA-56645510-1" style="background-color:#777" data-LR_PUBLISHER_ID="73995"> <video autoplay="true"> <source type="video/mp4" src="{{videoUrl}}"/> </video> </div>
I’ve then built a shortcode using the button in the WYSIWYG editor as follows:
[su_premium_player videourl="https://www.thepopjar.com/video/olympic-village.mp4" videodescription="These incredible images show what happens to an Olympic venue long after the closing ceremony is a distant memory." videoduration="63" videotags="olympics, photography, architecture" videotitle="This Is What Happened To 8 Famous Abandoned Olympic Venues After The Games Ended"]
However, the generated HTML on the frontend of the site looks identical to the code I’ve entered into the shortcode. In other words, the attributes are not being populated by the values I have declared in the shortcode.
Instead, they are pulling through as {{videourl}}, {{videodescription}}, {{videoduration}}, {{videotags}}, {{videotitle}}.
This means the browser is looking for videoUrl at {{videourl}} instead of https://www.thepopjar.com/video/olympic-village.mp4.
Do you know why this would be happening?
You can view the page where this code is here: https://www.thepopjar.com/cool/happened-8-famous-abandoned-olympic-venues-games-ended/
- The topic ‘Custom Shortcode: Attribute Values Not Being Replaced’ is closed to new replies.