• Resolved allm

    (@realblueorange)


    I have a page with a shortcode that generates a link to a youtube movie. The link does not turn into an embedded movie.

    If I put the youtube link into the page as plain text all is well and I see an embedded movie.

    Can anybody tell me why this is so? Is the content of the page first processed for youtube links and only then for shortcodes?

    By the way: If I generate the link between [embed]‘s the link dissapears and no embedded movie can be seen.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Can anybody tell me why this is so?

    Are you adding the shortcode to a Page or a page template?

    Thread Starter allm

    (@realblueorange)

    @esmi:
    The shortcode is on a page.
    If the shortcode evaluates to a youtube link the link is displayed. If the same link is on the page as plain text the embedded youtube movie is shown in stead.

    The shortcode itself is parsed as part of the_content() filter in WordPress core. With regard to YT videos, it is important to use the url of the video – not the link code supplied by YT. Have a look at Embeds for a more in-depth explanation.

    Thread Starter allm

    (@realblueorange)

    Maybe I am not precise.

    I have:

    https:// https://www.youtube.com/watch?v=xxxxxxxxxx

    (https:// only once of course. the second one added by the forum code)

    as result of my shortcode. That doesn’t work.

    Having that code as plain text on the page works.

    I checked the Embeds page again, but that did not help me further.

    Thanks for any insight you may have.

    You need the url of the video – not the link (for email) supplied by YT.

    Thread Starter allm

    (@realblueorange)

    I am trying to say that I am using the URL, not the link. The forum software does something funny with my input…

    Thread Starter allm

    (@realblueorange)

    After a lot of additional Googling I found the solution here:
    https://www.ads-software.com/support/topic/call-function-called-by-embed-shortcode-direct?replies=8

    Hope this helps others as well, as this is rather counter-intuitive.

    I’ll set this to resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘youtube embed using shortcode’ is closed to new replies.