[Resolved] Question on the “magic tags” (short-codes) in Elements > Header

Home Forums Support Question on the “magic tags” (short-codes) in Elements > Header

  • This topic has 5 replies, 2 voices, and was last updated 1 month ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1410730
    Henry

    In GP, there’s a great feature where you can pull out WP metadata like this:

    {{post_title}}

    This works great, but this does not:

    {{post_terms.taxonomy}}

    The page I am running this {{post_terms.taxonomy}} is to pull the “category” slug for the page but it doesn’t work. I tried:

    {{category.taxonomy}}

    And no joy.

    Is there something I am doing wrong?

    Also, in the ideal world I’ve love to add the same magic tag to a URL like this:

    https://my-site.com/filter/{{category.taxonomy}}

    So, in summary, what do I need to do to:

    1. Make it work to show the category slug?
    2. Embed it in a URL?

    Thanks!

    #1410864
    David
    Staff
    Customer Support

    Hi there,

    you would use this:

    {{post_terms.category}}

    as category is the taxonomy you want to be displayed.

    This is not something you can add to a URL – that would be defined by your Permalink structure or an SEO plugin

    #1412509
    Henry

    ok thanks, sorry David, I’m being a bit slow, can you give me an example?

    I guess my question is – what are “post_terms” is there a list of them that you can share? Thanks

    #1412545
    David
    Staff
    Customer Support

    Taxonomies can be Categories or Tags or a Custom taxonomy if you like e.g books.

    When you +new category to your post you’re creating a new Category > Post Term.
    Likewise +new tag your creating a new Tags > Term

    So adding this template tag to the header element:

    {{post_terms.category}}

    will display all the category > terms for the current post.

    #1415358
    Henry

    Thanks for your help.

    #1415736
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.