[Resolved] How to display category in custom post type Block – Content Template

Home Forums Support [Resolved] How to display category in custom post type Block – Content Template

Home Forums Support How to display category in custom post type Block – Content Template

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2263604
    Len

    The Block – Content Template works for the page with page content and featured image. I want to show the page category.
    The block “Post Categories” doesn’t show the category for the page.
    What block do I use, if not what code do I use in the template, or is there a shortcode. I want to achieve this without editing the actual template file.

    #2264157
    David
    Staff
    Customer Support

    Hi there,

    you can add either a GB Headline Block or Buttons Block, and set the Dynamic Data options to List of Terms for the current post and select the taxonomy you need eg. Category.

    #2264190
    Len

    David

    Thanks, I would never have thought of that! With an additional step and it works well – see below.
    I have used two GB heading blocks both set to DIV, one under each other, then assigned a css class “display-inline” to both. This is then set to display:inline-block, so I now have on one line:
    Category: categoryname
    with categoryname as the dynamic data bit showing the term for the custom taxonomy of the post.
    Thanks again, LenW

    #2264206
    David
    Staff
    Customer Support

    As a note: in the Headline Block there is an Inline Width option under the blocks spacing settings that makes them Inline.
    Or, whilst you’re in a Block Element a Container Block has an option for Inline Meta. And everything in that container is inlined.

    Glad to be of help.

    #2264396
    Len

    David, thanks, I stumbled on the inline settings after I did this post, easier than messing with css.

    #2264670
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.