A
A
Alexdev9992021-08-13 14:22:21
WordPress
Alexdev999, 2021-08-13 14:22:21

Categories in the "Posts" widget on a wordpress blog?

The situation is as follows. There are two categories - beauty and recipes. How to implement, for example, if I read the "recipes" category, then only posts from the "recipes" category should be shown at the bottom of the post in the "Posts" widget. And vice versa, if I read a post from the beauty category, then posts from the "beauty" category were shown below in the "Posts" widget. That is, we set the theme, for example, (single post where we specify in the "Posts" widget to show posts of a certain category. But how to set it up so that at the bottom of a certain post, a certain category, posts from the same category are shown?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alyoshin, 2021-08-14
@Alexdev999

You can take a ready-made plugin https://wordpress.org/plugins/related-posts-by-tax...
It has a setting that allows you to set the same taxonomy. He knows how to display posts not only by category, but also by tags.
You can customize it both through the widget in the sidebar, and through the shortcode, where necessary.
If you want to implement it yourself using code, then there is such a guide, for example: https://code.tutsplus.com/tutorials/creating-a-lis...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question