Title: load posts by category
Last modified: January 17, 2019

---

# load posts by category

 *  Resolved [webskitter](https://wordpress.org/support/users/webskitter/)
 * (@webskitter)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/load-posts-by-category/)
 * Why isn’t this working in a custom text block?
 * [pods name=”post”  where=”category.name='{@post_title}'” template=”latest news”]

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Jim True](https://wordpress.org/support/users/jimtrue/)
 * (@jimtrue)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/load-posts-by-category/#post-11100250)
 * [Magic Tags](https://docs.pods.io/displaying-pods/magic-tags/using-magic-tags/)
   have a very specific context where they will work. They can only be called in
   a Pods Template or Custom Template (the space between [pods]…[/pods]). Only our
   [Special Magic Tags](https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/)
   can be used in where clauses in shortcodes.
 * That seems like an odd where clause trying to find the category based on the 
   Post’s Title. What are you trying to accomplish? I can tell you’re trying to 
   grab a list of posts that match a specific category, but I’m looking for a little
   context as to how that would relate to the current post title.
 * Also when you refer to ‘custom text block’, do you mean in the new Block Editor
   or are you in a Builder of some kind (like Beaver Builder, Elementor, etc.?)
 *  Thread Starter [webskitter](https://wordpress.org/support/users/webskitter/)
 * (@webskitter)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/load-posts-by-category/#post-11100437)
 * What I’m trying to do is that news items from this particular category (category
   name is based on pagetitle) is loaded on each page.
 * eg. On page ‘Energy’ news items from category ‘Energy’ is loaded.
 *  Plugin Contributor [Jim True](https://wordpress.org/support/users/jimtrue/)
 * (@jimtrue)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/load-posts-by-category/#post-11108356)
 * So you’re in a WordPress Page in the Editor block and typing the shortcode? As
   noted above, you can’t use a magic tag for the post title in the where clause.
 * Ideally, you should just use a Taxonomy filter the normal way, especially since
   these are WordPress Posts:
 * /category/news/
 * If you’re going to be creating individual WordPress pages for each of those categories,
   you’re going to have to just use the shortcode in the WordPress editor of:
 * `[pods name="post" where="category.slug = 'news' template="Latest News"]`
 * because the magic tag `{@post_title}` will not work there. You could create a
   template called ‘Call Latest News’ that only had one line in it:
 * `[pods name="post" where="category.name = '{@post_title}' template="Latest News"]`
 * And then in your ‘Energy’ page, you could put `[pods template="Call Latest News"]`
   where you wanted the Latest News and that would work, but you’d have to make 
   sure you configured Pods Templates to Call Shortcodes:
    [https://docs.pods.io/displaying-pods/pods-templates/using-shortcodes-in-pods-templates/](https://docs.pods.io/displaying-pods/pods-templates/using-shortcodes-in-pods-templates/)
 * In this way, the template ‘Call Latest News’ would from the page titled ‘News’
   pass the post_title ‘News’ into the shortcode above and then output the ‘Latest
   News’.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘load posts by category’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jim True](https://wordpress.org/support/users/jimtrue/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/load-posts-by-category/#post-11108356)
 * Status: resolved