Embed Posts in WordPress 4.4

WordPress 4.4 includes a new function which enables the easy embedding of post excerpts for:

  1. Your own internal posts
  2. External posts on your site

Here’s an example of the Twitter like embed:

embed-external-post-url

All you need to do is paste the URL in your editor and it renders like a Twitter embed as seen above.

To control the width and height on a per post basis, simply use embed shortcodes like this:

Otherwise you can control your embed width and height using other methods via your functions file.

On top of embedding posts, this function enables you to offer the embedding of your own posts.

embed-post

When the share icon is clicked, your readers can choose to embed your URL in any WordPress site ( WordPress Embed ) or they can copy the Javascript into any site whether that be WordPress or not ( HTML Embed ).

Embedding Outside The Content Area

If you want to display an excerpt of your own posts for embedding in other sites, you can hook theme in using any WordPress or theme specific hook.

Or

You can hook in one specific post by adding your post id to the following code.

Code Snippets


Comments

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.