Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #838242

    Hi there,

    I’m creating a ‘video’ blog post and i’m pasting the link to the video in the beginning of the post.
    The problem is, the link shows up in the preview text of the post, which impacts readability. Is there any way to fix that please?

    View post on imgur.com

    Many thanks
    Anya

    • This topic was modified 7 years, 4 months ago by annajou.
    #838257

    Hey annajou,
    One option is to manually change the excerpt by using the excerpt field below each post, this allows you to set the excerpt you wish to show. To use this option go to a post, and at the top of the page click “Screen Options” and choose the “Excerpt” box.
    In my testing, adding the embed iframe link from Youtube does not show in the excepts on the blog page, nor does using the video element within the builder. How are you adding the videos?
    Another option is to add this code to the end of your functions.php file in Appearance > Editor:

    add_filter('wpv_filter_post_excerpt', 'remove_youtubelinks_func');
    function remove_youtubelinks_func($excerpt){
    return $excerpt = preg_replace('~(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@?&%=+\/\$_.-]*~i', '', $excerpt);
    }

    Best regards,
    Mike

    #838268

    Hi @Mike,

    Thanks for the quick reply!

    I am just pasting the link into the type field, and it turns into a youtube video. So, I don’t see the text link int he actual post. But in the preview, it shows as text. Maybe I am embedding it wrong?

    I will try your suggestions above!

    #838306

    Hi,
    Please try going to Youtube > Share > Embed > and copy the link, then paste it in your post.
    2017-08-13_134146

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.