Tagged: display issue, oembed
when i try to post in frontend buddyblog section, the new post have a oembed field that dont proper function with the oembed display value form a shortcode:
` add_shortcode (‘youtube’, ‘youtube_shortcode’);
function youtube_shortcode() {
$youtube = get_field( ‘oembed’);
return $youtube;
} `this shortcode display the oembed field normal in backend post, but in the buddyblog posting from frontend, this just show a display html:
https://prnt.sc/Mb9h6vvd781uHi,
It does not seem it has any relationship with BuddyBlog as you are using a third party function to return a variable.I am assuming that you are using ACF or something similar. You will need to generate the embed markup on your own.
Here is a way to generate the markup from your value. You can update your shortcode with this
add_shortcode( 'youtube', 'youtube_shortcode' ); function youtube_shortcode() { $youtube = get_field( 'oembed' ); global $wp_embed; return empty( $youtube ) ? '' : $wp_embed->shortcode( array(), $youtube ); }
Regards
Brajeshthis code work perfect but after some time this is happening with the new posts (not old posts)
Are you putting the shortcode inside the post content?
Can you please share me the steps to re-create it?Thank you
BrajeshHey Brajesh, thanks you for all attention, the issue as resolved using the display in the elementor “video” element with the dinamic acf field url and not the oembed shortcode.
Thank You
You must be logged in to reply to this topic.