A
A
aramtop2018-07-26 16:05:44
CMS
aramtop, 2018-07-26 16:05:44

Why doesn't shortcode work in code?

I use WordPress. Through the page editor, in the Text section, entered the following content:

<div id='plyr-youtube' data-type="youtube" data-video-id="[urlparam param='ytid' /]"></div>

But the [url../] shortcode is not parsed, and when the page is opened, it is not replaced with text. The shortcode itself is working, on the same page, after the player code, I entered:
[urlparam param='ytid' /].. and.. it works!
Tell me how to fix the code / get out of the situation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-07-26
@azerphoenix

If the shortcode does not work, then when inspecting the element, there should be nothing inside data-video-id=""... If there is at least something inside the quotes, then the shortcode is working.
Another question is why it did not perform the desired action, it depends on what exactly it outputs and in what form ....
I can say 100% that if inside the HTML in the TEMPLATE you use

.......data-video-id="<?php echo do_shortcode('[urlparam param='ytid' /]');?>" .....
, then it will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question