It will work for Tweets, YouTube, Vimeo, Hulu, Flickr and many more WordPress Dashboard => Settings Menu => Media sub-menu => Embed section Set the width and height of embedded media inside posts or pages. If you want to customize the width and height of the embedded tweet, you can do that from following location, īe default, the embedded tweet will take max-width of the installed theme template. To get the above status inside the post, I just paste the below URL in the edit post window. Not Sure If Your PC is Infected with Malware or Virus? Use Free Scan Tools from Market Laders Here is an example showing embedded tweet from my Twitter account. To embed a tweet inside a post, you only need to paste the Tweet URL which you can get by clicking the ‘details’ link just below a tweet on the timeline. Apart from the new features mentioned earlier, 3.4 is also having capability to embed Twitter Status (also known as Tweets) inside the post area. WordPress team keeps coming with new features and enhancements in every upgrade. But I think the first method is more stable, since it's harder to inject the attribute into a possibly dynamic HTML structure.WordPress 3.4 has been released with new features like Theme Previewer and Customizer, better Caption, header and background image coming from media gallery and many more performance improvements. We could also use the embed_oembed_html filter to dynamically add the data-cards="hidden" attribute, even on a per post basis or check for our own custom query parameters. Then there's the oembed_result to filter HTML returned by the provider. Here's how the Twitter provider url looks before: $provider = add_query_arg( 'hide_media', 1, $provider ) If( '' = parse_url( $provider, PHP_URL_HOST ) ) * Hide media for all twitter oEmbeds, using the hide_media=1 query argumentĪdd_filter( 'oembed_fetch_url', function( $provider, $url, $args ) Set an oEmbed query parameter of hide_media=true or add aĭata-cards="hidden" attribute to the resulting element to Here's one way using the oembed_fetch_url filter to add the hide_media query parameter, that's also mentioned in the Twitter doc page you linked to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |