WordPress.org

Ready to get started?Download WordPress

Forums

Featured Video Plus
[resolved] Trying to echo get_the_post_video_url but no luck (2 posts)

  1. Native Imaging
    Member
    Posted 2 months ago #

    My apologies for poor php skills..

    I'm trying to echo the video url like this: (for better schema & Google Rich Snippets)

    <meta itemprop="embedUrl" content="<?php echo get_the_post_video_url(); ?> />

    any help would be greatly appreciated! :)

    https://wordpress.org/plugins/featured-video-plus/

  2. Native Imaging
    Member
    Posted 2 months ago #

    Aha, I figured it out.
    incase any one else needs this snippet here's what I used. I used it for Schema, so if you want it to register on search engines, be sure to wrap it with <div itemscope="itemscope" itemtype="VideoObject">

    <?php if (function_exists('has_post_video') ) :
                        $post_id = get_the_post_video_url( $post_id ); { ?>
                    <meta itemprop="embedUrl" content="<?php echo $post_id; ?>" />
                <?php } endif; ?>

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.