Continuing from my earlier article titled How to create a custom widget that displays value of a custom field in WordPress, here I am going to share how I have set up a custom widget that pulls a fixed number of Custom Post Type entries that have been categorized under the same category/categories that the current Post belongs to (on single Posts).
Appearance > Widgets:
On a single Post:
If no published CPT entry exists that belongs to the same category, widget will not appear (including its markup) in the sidebar.
wp-content/plugins/core-functionality/lib/widgets/widget-related-case-studies.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.