WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] [closed] Embedding YouTube videos into an event? (9 posts)

  1. Creight
    Member
    Posted 1 year ago #

    Hi - is it possible to embed a You Tube video into an event. We have tried the usual WordPress [embed] youtubevideoURL [/embed] but it appears to get stripped out by EM.

    Thanks.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    hi,

    you can try something like

    <iframe width="560" height="315" src="http://www.youtube.com/embed/video_id" frameborder="0" allowfullscreen></iframe>

    in event details then use #_EVENTNOTES at settings > formatting > events > default single event format

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    The WP ways should work, we don't strip out any shortcodes. Where are you adding it?

  4. ibcreative
    Member
    Posted 1 year ago #

    Yeah, it´s not working for me either. So the next thing i´m trying is to set a new attribute #_ATT{#youTube} and hopefully check if its not empty, if not empty, show a div and load the video in it.

    The thing is, i haven´t figured out how to do that check yes? Any thoughts on that?

    Thank You.

  5. agelonwl
    Member
    Posted 1 year ago #

    try #_ATT{youTube} instead of #_ATT{#youTube}

  6. ibcreative
    Member
    Posted 1 year ago #

    Thank you agelonwl, you were right about that.

    So i got the solution i was looking for, maybe someone needs something like this so here´s the code (be sure to set the custom att #_ATT{#youTube} first ):

    <?php
    $youtubeurl = $event->output('#_ATT{youTube}');
    if (youtubeurl!= "0")
    {
    global $wp_embed;
    $post_embed = $wp_embed->run_shortcode('[embed width="320" height="240"]'.$youtubeurl.'[/embed]');
    echo $post_embed;
    }
    ?>

    This script checks if there´s anything stored on the custom att, namely a youtube url in this case, and if so then proceeds to embed the video.

  7. dwaber
    Member
    Posted 1 year ago #

    And where you have this script to put? functions.php in the local theme?

  8. agelonwl
    Member
    Posted 1 year ago #

    you can try to use template file at wp-content/plugins/events-manager/templates/templates/event-single.php

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

  9. dwaber
    Member
    Posted 1 year ago #

    Thanks for your very fast help. It worked now (also for vimeo).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic