Support » Plugins and Hacks » [Resolved] Taxonomy magic tags, and in the Pods shortcode

[Resolved] Taxonomy magic tags, and in the Pods shortcode

  • I am missing something, because in another support message, {@genres} supposedly outputs the terms. I’ve never gotten a magic tag to work for a taxonomy, and I’ve tried on four different sites. I must be missing something fundamental.

    Additionally, I am trying to list CPTs with a Pods shortcode, and I figured that I couldn’t load a custom taxonomy inline, so I refer to a template instead. I can get all the other fields to show, with using magic tags or PHP, except for any taxonomy. Is that not happening at this point, or am I missing something there, as well?


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Josh Pollock


    Listing taxonomies isn’t easy with the current version of Pods Templates, though that will change with the rewrite of that component that David Cramer is doing right now.

    For now, you should be able to get the first matching term from the taxonomy with {@NAME_OF_TAXONOMY} but to get all terms, you will need to open PHP tags and use get_the_terms() and loop through the results.

    Yeah, the thing is, {@NAME_OF_TAXONOMY} does not work for me, at all. I’ve been trying to debug this, but I could never get that basic thing working, hence asking if in the referenced post, {@genres} produced output; it doesn’t for me.

    I tested on four instances, all latest WP and Pods, and with no other plugins on. Is this a bug you are aware of? I can’t find it in the issue queue.

    Related, ETA on that component David Cramer is working on?

    Plugin Contributor Josh Pollock


    What is the name of your taxonomy and what is the magic tag you are using?

    I do not have an ETA on the templates component rewrite. Some of it has been merged into the 2.X branch, so it should be present in 2.3.19. Some will have to wait until 3.0.

    In two separate case, I have {@book_authors} and {@officers}. Neither of them return anything when I use them in an existing template, or an inline custom template, inside a Pods shortcode.

    Plugin Contributor Josh Pollock


    You should use get_the_terms. You can get the taxonomy terms like this <?php $terms= get_the_terms( $obj->ID(), 'book_authors' ); ?>. If you loop through the object that returns, you can get the name of each term, and if need be the ID, to pass to get_term_link.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Taxonomy magic tags, and in the Pods shortcode’ is closed to new replies.