• Hi,

    I’m using GenerateBlocks Pro 2.4.0 with the new Query Loop.

    I’m trying to display the current post’s tags inside the Post Template.

    I tried using a shortcode that calls get_the_tags() / get_the_terms(), but every post card displays the same tags.

    Is there an official GenerateBlocks way to output the current post’s tags as separate items (pills) inside the Query Loop?

    I’d prefer to avoid custom workarounds so the solution remains compatible with future updates.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support ying

    (@yingscarlett)

    Hi there,

    You can use a GB text block to pull the {{term_list}} dynamic tag in the loop item block.

    https://learn.generatepress.com/blocks/dynamic-tags/term-list/

    Thread Starter brentcredle

    (@brentcredle)

    Thanks Ying, I’ll try that.

    Thread Starter brentcredle

    (@brentcredle)

    Just got around to try it. {{term_list}} works, but it renders all terms as a single string. Is there a way to output each term as a separate HTML element (or wrap each term in its own span) so they can be styled as pills?

    George

    (@quantum_leap)

    Hello,

    You would need to select the dynamic {{term_list}} block and set it to display as flex with a column gap value (to separate the pill items). Then, you would need to style the dynamic block’s link selector accordingly, like adding paddings, background color and border radius.

    Thread Starter brentcredle

    (@brentcredle)

    Hi George, thank you for sharing that solution. I just follow your steps and it worked perfectly.

    George

    (@quantum_leap)

    Great, no problem!

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

You must be logged in to reply to this topic.