• Resolved valiik

    (@valiik)


    I am adding a YouTube video inside a “one_half” shortcode but it is not working for some reason. I am hoping maybe someone could help me out.

    Here is my shortcode code:

    function one_half_shortcode( $atts, $content = null ) {
    	return '<div class="one_half">' . do_shortcode($content) . '</div>';
    }
    add_shortcode( 'one_half', 'one_half_shortcode' );

    And here is what I am adding into the editor:

    [one_half]https://www.youtube.com/watch?v=ya17jbkOKDk[/one_half]

    Also tried:

    [one_half][youtube=https://www.youtube.com/watch?v=ya17jbkOKDk][/one_half]

    Not working, just shows the URL right on the page instead of rendering the video.

Viewing 1 replies (of 1 total)
  • Thread Starter valiik

    (@valiik)

    Ok, figured it out.

    The trick is to put the YouTube call on it’s own line. Like this:

    [one_half]
    https://www.youtube.com/watch?v=ya17jbkOKDk
    [/one_half]

    This worked for me.

Viewing 1 replies (of 1 total)
  • The topic ‘Embed youtube inside one_half shortcode’ is closed to new replies.