Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Conditional display of a “ad” badge based on post tags

  • Hello GenerateBlocks Support Team,

    I’m currently working with GeneratePress and GenerateBlocks Pro (latest versions) and I’m trying to implement what I believe should be a fairly straightforward use case, but I seem to be running into limitations or inconsistencies in the UI.

    What I want to achieve:
    On my homepage I have a post grid / query loop showing featured articles.
    For some posts, I would like to display a small badge (e.g. a button or label reading “Werbung” (ad) ) only if the post has a specific tag (for example the tag “Werbung”).
    If the post does not have this tag, the badge should not render at all.

    My expectation:
    I expected to be able to do this either via:
    Block-level Display Conditions (e.g. Post → Terms → Tags), or
    Dynamic Data / Dynamic Tags outputting post terms and using “required to render”.

    What I am actually seeing:
    Block-level “Display Conditions” always open the global GeneratePress Condition Builder (device, user role, query parameter, etc.), even when selecting a GenerateBlocks v2 block (Button, Container, Headline).
    In the Dynamic Tags modal, I only have options like “Post Meta” and “Term Meta”, but no option to output post terms (tags/categories) directly.

    There is no “Post Terms”, “Terms”, or similar option available in my interface, neither in English nor German.
    As a result, I cannot conditionally render a block based on a post tag without resorting to custom PHP.

    My question:
    Is conditional rendering based on post tags currently supported in GenerateBlocks Pro in this context (query loop / GeneratePress Elements)?
    If yes, could you please clarify where exactly in the UI this is supposed to be configured?
    If not, I would appreciate confirmation so I can plan a different approach.

    I’m happy to provide screenshots, version numbers, or a short screen recording if that helps.
    Thank you very much for your time and support.

    Best regards
    Stephan

  • Hi Stephan,

    In the Dynamic Tags modal, I only have options like “Post Meta” and “Term Meta”, but no option to output post terms (tags/categories) directly.

    It’s called Term List.

    However, I don’t think what you want to achieve can be done out of the box. The condition does not support certain tag.
    As there isn’t a way to only show 1 specific tag.

    I would recommend using ACF plugin or WP’s native custom fields to create a post meta, and in the meta field, you enter the value “Werbung”.

    Then you can use GB’s text block to pull the post meta dynamically; if the value does not exist, then the text block will not be output.

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