Display posts from a category in the Single.php

Hi :slight_smile:

I would like display posts from a category in the Single.php. I found the code to do that: http://www.thibautsoufflet.fr/wordpress-afficher-des-articles-associes-de-meme-categorie/
But I would like to reproduce this code on Pinegrow. Do you know how I can do that?

Thanks for your help :slight_smile:

Hi @thvi try this. When you add “The Loop” to the part of the page you want to display your post enter a name for query into the “Custom WP Query Name” section, see screenshot (I used stuff_category_query but enter whatever you feel is appropriate).

Then in the Category Parameters section further down enter the name of the category you want to display (in my case the category I wanted to display was called “stuff”). At that stage I just saved/exported and it displayed only my chosen category posts.

Hope this works for you, let us know if you have any issues and we’ll try to help.

1 Like

Thanks a lot! It works :grinning:

1 Like

@thvi Glad to hear it worked, thanks for let us know.

Does anyone knows how to do this in Pinegrow for the “current category”?

Like on www.mydomain.com/category/thiscategory and then the loop shows all related posts that are members of thiscategory?

Thanks

Hi I am trying to do this as well in Pinegrow 5.7 and not getting through. Do I need the custom php code or can it be done completely inside PG?

@jcamachott have a read of this information about creating category pages on Wordpress Codex it might be useful. Try duplicating your archive/category page and rename it category-name (name being the name of the category you want to display).