Skip to content

Related Content Widget

The Related Content (NCR) widget displays related posts in sidebars or any widget area. It uses the same data and markup as the shortcode; only the configuration UI is different.


Where to add it

Appearance → Widgets (or Appearance → Customize → Widgets in block themes). Add the widget Related Content (NCR) to a sidebar or widget block.


Widget options

OptionDescription
TitleOptional widget title. Leave blank to use the shortcode default heading (“Related Content”).
Relationship typee.g. Related To, Parent Of, Depends On. Same as shortcode type.
Number of items1–50. Same as shortcode limit.
Order byDate or Title. Same as shortcode order.
Post ID (optional)Leave 0 to use the current post (in the loop). Set a post ID to show relations for a specific post.

Behavior

  • Context: On single post/page, “current post” is the one being viewed. On archives or when no post is in context, set Post ID explicitly or the widget may output nothing.
  • Output: Same HTML and CSS as [naticore_related_posts] (list layout, same wrapper classes). Shortcode CSS is enqueued when the widget renders.
  • Empty: If there are no related posts, the widget outputs nothing (no empty box).

Example

Add “Related Content (NCR)” to the main sidebar with:

  • Title: You might also like
  • Relationship type: Related To
  • Number of items: 5
  • Order by: Date
  • Post ID: 0

Every single post will show up to 5 “related to” posts in the sidebar.


See also

Schema stable from 1.x onward. Backward compatibility guaranteed.