Possible to dynamically select category based on current post?

Would it be possible to modify the Query Parameter or extend the plugin via functions.php to allow Display Posts to dynamically select the category based on the current page’s category?

For instance, say I have 4 categories for the seasons – spring, summer, fall, and winter. I would like to pull the category from the current page and pass it along into the query, so if somebody lands on a spring post, then they’ll automatically see:

[display-posts category="spring"]

But if another reader lands on a summer post, the code for them would show:

[display-posts category="summer"]

And lastly if a third reader landed on a post containing all four categories, they’d see:

[display-posts category="spring,summer,fall,winter"]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer