Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter fii.digital

    (@noidoi)

    this one works for me, but how can i put in there a custom field?

    <?php echo apply_filters( 'the_content', '[flv]location[/flv]' ); ?>

    Plugin Contributor viper007bond

    (@viper007bond)

    https://codex.www.ads-software.com/Custom_Fields
    https://codex.www.ads-software.com/Function_Reference/get_post_meta

    Put the URL in the custom field.

    <?php
    $videourl = get_post_meta( $post->ID, 'some_key', true );
    if ( $videourl )
    	echo apply_filters( 'the_content', "[flv]$videourl[/flv]" );
    ?>
    Thread Starter fii.digital

    (@noidoi)

    thx a lot, man :).

    Hi,

    In my theme, i have a custom template file where i want to show youtube and daily motion video by the video URL. I have only raw URL nothing else.

    Why can’t I get this code to work in my theme? Here is my code,

    <div id=”video”>
    <div id=”video-inside”>
    <?php $videourl = get_post_meta( $post->ID, ‘video’, true ); if ( $videourl )echo apply_filters( ‘the_content’, “[flv]$videourl[/flv]” ); ?>
    </div>
    </div>

    But when I load the page if loads blank. Does this no longer work?

    Replace the ” ” around [flv]$videourl[/flv] with ‘ ‘

    scruff

    (@scruff)

    I am almost there – the video shows up in the right place but the URL isn’t quite right…

    code used (as above but with vimeo tags instead):

    <?php
    $videourl = get_post_meta( $post->ID, 'video', true );
    if ( $videourl )
    	echo apply_filters( 'the_content', '[vimeo]$videourl[/vimeo]' );
    ?>

    results on page:

    <span class="vvqbox vvqvimeo" style="width:635px;height:300px;"><iframe id="vvq-103-vimeo-1" src="https://player.vimeo.com/video/$videourl?title=1&byline=1&portrait=0&fullscreen=1" width="635" height="300" frameborder="0"><a href="https://www.vimeo.com/$videourl">https://www.vimeo.com/$videourl</a></iframe></span>

    it seems to be the $videourl bit that is going wrong, but i’m afraid i don’t know enough about PHP to figure out why!

    WP version: 3.2.1
    example page: https://www.braincubecorp.co.uk/eatme/media/video/this-is-the-title-of-a-video-post/
    video link: https://vimeo.com/30391279

    xave

    (@xave)

    Hiya

    The $videourl variable is being passed as a string.
    Try this:

    <?php
    $videourl = get_post_meta( $post->ID, ‘video’, true );
    if ( $videourl )
    echo apply_filters( ‘the_content’, ‘[vimeo]’ . $videourl . ‘[/vimeo]’ );
    ?>

    scruff

    (@scruff)

    xave, you are a star! works perfectly, thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Viper's Video Quicktags] Custom fields’ is closed to new replies.