M Similar Posts

This plugin provides a list of similar / related entries to an article or a custom post type entry.

This list could be added in the form of a:

  1. Gutenberg Block
  2. Shortcode
  3. Widget

If you add a widget to the sidebar it will only appear when on the details view of an entry, as similarity cannot be calculated when on a list page of multiple entries.

The syntax for the shortcode is [magadanski-similar-posts id="" post_type="" taxonomy="" limit=""]

You can use the attributes as follows:

  1. ID — (integer) the ID of the post you’d like to get similar posts for. Default value: the current post ID.
  2. post_type — (string) the post type you’d like to query. Default value: “post”.
  3. taxonomy — (string) the taxonomy based on which you’d like to get similar items. Default value: “category”.
  4. limit — (integer) a maximum number of results you’d like to receive. Default value: 5.

The similarity is considered based on the number of common categories (or other taxonomy terms) for this post and the rest of the posts in your blog.

0

评论0

 
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
显示验证码
没有账号?注册  忘记密码?

社交账号快速登录