Embedded Posts

Descripcion

Reuse any piece of your content anywhere on your site. Display related content via category, tags, author, post ID or title using either a block or a shortcode.

Choose from:

  • a single Specific Post (post/page/CPT) with a specific title or post ID
  • a number of Related Posts (posts/pages/CPTs) which are related to the content you are creating through tags, categories, or the author of the original post.

You can us the Embedded Posts block in your content directly on Posts, Pages, Custom Content in the WordPress Block Editor and in Templates using the WordPress Site Editor. If you are not using a Block Theme you can use shortcode both on Posts, Pages, Custom Content or directory into your php templates.

Perfect for Portfolio sites, Magazine sites, Portals, your Home page and News pages. Anywhere you need to showcase your existing content.

Increase your visitor engagement by automatically directing your visitors to other content they might enjoy.

The Embedded Posts block ensures content embedded in multiple places on your site remains up to date with the original, saving you from duplicating effort and eliminating errors.

Key Features

  • embed one or more existing pieces of content anywhere you can use the WordPress Block Editor.
  • display as much or as little of the content as you like: Featured image, excerpt, the full content and even your custom fields.
  • define the exact content to display (the same Post, every time) or choose how content will be displayed (Related Posts).
  • works with Posts, Pages and Custom Post Types.
    . lots of sorting and ordering options.
  • mix and match content as you please.
  • all settings are in the editor: no coding required.
  • use Site Editor’s built-in tools to style your embedded content.
  • works with Site Editor or traditional PHP templates, from template parts to your whole theme.
  • no other plugins required.

Related Posts can show a mix of posts, pages, CPTs, or any specific selection, offering you the flexibility to curate your content as you like.

You have the option to sort the embedded content by date or name order, in both ascending and descending formats. Additionally, there is a feature for random sorting.

The Embedded Posts block seamlessly integrates with the WordPress Block Editor and the WordPress Site Editor or can be implemented through a WordPress shortcode. As Embedded Posts is a block variation of a Query Loop you have full control of the appearance of the Embedded Post within the WordPress Block Editor and WordPress Site Editor.

Another feature included in Embedded Posts is the ability to enable taxonomies on pages, a functionality not found in basic WordPress features.

Examples

You could use Embedded Posts to:

  • show 3 (or any number of) of the most recent news items on your Home page.
  • show a nicely formatted image, title, and excerpt of the last three posts by the author of a post at the end of that post.
  • show the content of a post called « My First Blog Post » in the middle of a post called « My Second Blog Post ».
  • show the titles and excerpts of 5 (or any number of) other posts that are also tagged « environment ».
  • show a mixture of pages, posts, and custom post types that also have the category « trees » on a page that is in the « trees » category.
  • show post 2 on page 1.
  • add a block to show other projects you’ve done with the same tag on your Portfolio site.
  • show readers « Other articles they may be interested in » on your Magazine site.

You can of course also sort those pieces of content, randomly, by date, or title, in ascending or descending order.

Support/Issues

Please use either the support forum or the official GitLab repository for any questions or to log issues.

Using Embedded Posts

Once the plugin is installed you can add an Embedded Post block or shortcode to your templates, posts, pages or custom posts types.

Simply go to the place where you want to display the Embedded Posts and either paste in one of the shortcodes given below, or add a new block of type ‘Embedded Posts’ and configure it as you would any other block in the WordPress Block Editor.

NOTE: If you want to use Embedded Posts to show Related Content (for example by Category/Tag/Author) make sure the content you are creating also has that Category/Tag/Author otherwise there will be nothing to relate to.

At it’s heart the Embedded Posts is a block variation of the standard Query Loop block and therefore is fairly similar in some of the functionality, some of which you may already be familiar with and is in WordPress by default.

Embedded Posts Settings

Embedded Posts settings can be found in the main WordPress dashboard.

Enable Taxonomies For Pages

Selecting the Enable taxonomies for pages box and clicking Save Page Taxonomies will enable Page Taxonomies.

Select Visible Components For The Shortcode

In this section you can select which component you would like to be visible when using the shortcode. Included along side each of these components is the relevant CSS class which will allow custom formatting. Once your selection has been made click Save Template Settings will enable on the frontend.

Available Controls

The following section outlines descriptions for all available options, each providing instructions on enabling the setting in either the WordPress Block Editor or the Wordpree Site Editor, along with the corresponding shortcode for alternative usage.

The term ‘Editor’ will represent either the WordPress Block Editor or the WordPress Site Editor.

Related By Tags

This is the default action for Embedded Posts and is enabled by the toggle in the Related By section of the settings panel in the Editor.

[embeddedposts]

or

[embeddedposts related_by_tag=1]

Related By Category

This can be enabled by the toggle in the Related By section of the settings panel in the Editor.

[embeddedposts related_by_tag=0 related_by_category=1]

Related by Tag AND Related By Category

By enabling both toggles for Related by Tags and Related by Category in the Related By section of the settings panel in the Editor and ensuring that the AND operator radio button is enabled.

[embeddedposts related_by_tag=1 related_by_category=1]

or

[embeddedposts related_by_tag=1 related_by_category=1 related_by_operator='AND']

Related by Tag OR Related By Category

By enabling both toggles for Related by Tags and Related by Category in the Related By section of the settings panel in the Editor and ensuring that the OR operator radio button is enabled.

[embeddedposts related_by_tag=1 related_by_category=1 related_by_operator='OR']

Related By Author

This can be enabled by the toggle in the Related By section of the settings panel in the Editor.

[embeddedposts related_by_tag=0 author=1]

Search By Title

Enter the title that is to be searched for in the Title box in the Single Post section of the settings panel in the Editor. The title needs to be an exact match although it is not case sensitive.

[embeddedposts title='string']

Search By ID

Enter the Post ID that is to be searched for in the Post ID box in the Single Post section of the settings panel in the Editor.

[embeddedposts post_id=(number)]

Posts Per Page

This can be set by using the slider in the settings panel in the Embedded Posts Settings in the Editor. The current range is from 1 * 10.

[embeddedposts posts_per_page=(number)[default: all]]

Post Types

Post types can be entered into the Post Type box in the Embedded Posts Settings in the settings panel in the Editor. You have the flexibility to modify the post type for searching or add additional post types, enabling simultaneous searching across multiple post types.

[embeddedposts post_type='post']

This can take multiple values; these values should be comma-separated.

Order of Returned Posts

The order of the returned posts can be selected using the Order By drop-down in the Embedded Posts Settings in the settings panel in the Editor. Alternatively, the random toggle in the same area can be enabled for a random order of the returned posts.

[embeddedposts order_by=[AZ, ZA, 123, 321, random]]

Alphabetically, reverse alphabetically, date ascending, date descending, or random

Screenshots

  • Embedded Post by Post ID
  • Embedded Post by Title
  • Embedded Post by Author
  • Embedded Post Related by Category OR Tags
  • Embedded Post Related by Category AND Tags
  • Embedded Post Related by Category
  • Embedded Post Related by Tag

Installacion

  1. Install easily with the WordPress plugin control panel or manually download the plugin and upload the folder embedded-posts to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

Should I use a shortcode or a block?

Blocks are more configurable by the end user in terms of the content they show and their style.

Shortcodes come with their own template, some of which is customizable, and hence a slightly more fixed appearance.

How do I change the appearance of the block if I use a shortcode?

The Embedded Posts setting menu allows you to select components to be visible along side the corresponding CSS for custom formatting.

If you require anymore functionality than this we would recommend exploring the block side of Embedded Posts.

Should I use an Embedded Block in my templates or directly on a page (or post)?

You can use either. If you always want to show some related posts for example every time someone creates a blog post, then by all means add a embedded block with your criteria to a template.

You may just want the odd bit of embedded content every now and again, in which case just add it to your content as you go.

Does the embedded content automatically update?

Yes. The post or page that has an embedded block in it will update with your site.

So for example a block with the ‘last three posts’ from an author will always show the last three.

If you wanted to fix those posts, you could create three blocks that matched to a single post by title or ID. (Note: These will not change unless you deleted the post or changed the post ID or Title of the related content.)

Equally, if you change the content in the post/page/CPT that has been embedded in another post/page/CPT, that embedded content will also show as changed/updated.

How do I search Pages or Custom Post Types?

Embedded Posts functionality enables you to search for Posts, Pages, Custom Post Types, or any combination thereof. You can achieve this by utilizing the Post Type box or by setting the post_type variable in the shortcode.

Doesn’t the Query Block do all of this?

There may be cases when you want to use the query block instead of Embedded Posts e.g. if you want to show a list of unrelated content * maybe posts about « trees » on a page that is not in the « trees » category.

Embedded Posts was built to deal with some of the cases that the Query Block doesn’t offer.

Embedded Posts is really good if

  • you want to show just single post/page/CPT selected by title or ID.
  • you have a number of Tags AND/OR Categories that you want to match content with.
  • you want to gather content in pages, posts, and custom content types together.
  • you want to set up page/post templates that automagically show related content.

I have a caching plugin. Will that effect how Embedded Posts work?

We’ve tested Embedded Posts with a number of caching plugins, and we’ve not found any problems.

The cases where caching could interfere are:
1. When content which is embedded and reused elsewhere on the site is updated it should also be updated in the embedded block where it is being reused.
2. Where an Embedded Post block shows the ‘most recent three posts’ and a new post of that type is added, it should automatically update the embedded content if a more recent post is created.

The behaviour described above does not seem to be effected by caching plugins.

If you are experiencing a problem with this behaviour, please disable your caching plugin, test, and report your findings to us. See the Support Section above for details on how to do that.

What happens when I uninstall Embedded Posts

Embedded Posts will save some data in your database about the default options for the plugin and any other options you choose in the Embedded Posts settings. When you deactivate the plugin those options will remain in the database, so if you then reactivate the plugin those settings will still apply. However, if you uninstall the plugin that data is deleted.

If you have created posts or pages with Embedded Posts on them and the plugin is deactivated or uninstalled, those posts and pages will still contain Embedded Posts data. If you used a shortcode, then the text for that shortcode will show up on the page. If you used the Embedded Posts block this will revert to a standard query loop block, meaning that some embedded posts will still show although probably not in the configuration you originally intended.

In order to tidy up those posts/pages you would need to edit each of them in turn.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Embedded Posts” is open source software. The following people have contributed to this plugin.

Contributors

“Embedded Posts” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Embedded Posts” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.8

  • Page taxonomies made available to archive pages

1.0.7

  • Page taxonomies logic bug fix

1.0.6

  • updated WordPress versions

1.0.5

  • typos fixed

1.0.4

  • blueprint.json added

1.0.3

  • title search bug fix

1.0.2

  • Internationalization

1.0.1

  • Minor Bug fixes

1.0.0

  • First stable release
  • Adds information to the FAQs about uninstalling the plugin

0.9.6

  • Escape echos on shortcodes
  • Stop direct access to php files
  • no generic function names

0.9.5

  • Post types more dynamic
  • Random order behaviour amended
  • minor bugs
  • update_version script

0.9.1

  • readme.txt added