WordPress 4.4 includes a new function which enables the easy embedding of post excerpts for:
- Your own internal posts
- External posts on your site
Here’s an example of the Twitter like embed:
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.
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.
Was This Tutorial Helpful?