• Resolved Philljc

    (@philljc)


    Hello, here’s what I’m currently using with another plugin and ACF (advanced custom fields):

    <?php
    $videoId = get_sub_field(‘youtube_video_id’);
    echo youtube_video_embed( $videoId );
    ?>

    But that plugin is slow. How can I use my videoID here with YouTube Lyte in a theme file as per the above?

    Thanks

    http://wordpress.org/extend/plugins/wp-youtube-lyte/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Hi Philljc;
    This should work;

    if(function_exists('lyte_parse')) { echo lyte_parse($video); }

    frank

    Thread Starter Philljc

    (@philljc)

    If I use:

    <?php if(function_exists(‘lyte_parse’)) { echo lyte_parse($videoId); } ?>

    It just shows the video ID on the page 🙁

    Plugin Author Frank Goossens

    (@futtta)

    Yeah, sorry about that; I based my answer on feedback I received a long time ago, but the plugin evolved in the mean time and that doesn’t work any more.

    You’ll need to put something like this in your functions.php;

    function lyte_preparse($videoId) {
        return lyte_parse('httpv://www.youtube.com/watch?v='.$videoId);
        }

    and then indeed call lyte_preparse instead of lyte_parse.

    hope this helps,
    frank

    Thread Starter Philljc

    (@philljc)

    That did it, thanks!

    May I ask why you’re using widths for the players, and why there isn’t a 100% width? If there is I apologise, I wasn’t able to find it.

    When I used the following (in conjunction with a container), it worked perfectly in my responsive layout for desktop/iPad/iPhone:

    .fourthree .lyte, .lyte {
    position: inherit !important;
    }

    Thanks

    Plugin Author Frank Goossens

    (@futtta)

    well, the fixed widths in the admin screen are in reality max-widths. if the video doesn’t fit, it’ll automatically resize to 100% of the available width 🙂

    Plugin Author Frank Goossens

    (@futtta)

    Hi Philljc;
    I’m working on a new version of my plugin which will have the lyte_preparse function by default and which features an API as well.
    In case you guys want to test it, you can download the development version from http://downloads.wordpress.org/plugin/wp-youtube-lyte.zip

    Looking forward to your feedback! 🙂

    frank

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I use this plugin in a theme?’ is closed to new replies.