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

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.