DOCS

Event Card

FREE block. Shows the event a page belongs to as a small card. Added in 2.9.0, alongside the move of get_fund_event from a taxonomy to a post type. Block name get-fund/event-card.

Event card example

Why use this

When campaigns and fundraisers sit under an event (a gala, a marathon, a giving day), a visitor on one of those pages benefits from seeing which event it is part of and a link back to it. The Event Card surfaces that relationship without you having to wire it up by hand.

What it does

The block reads the event a page resolves to. That is either the page’s own _get_fund_event_id, or the event it inherits from the campaign it joined, resolved up the _get_fund_campaign_id chain. It then renders the event name (and links to the event) in a card.

It is deliberate about when it appears, so it does not clutter listing pages. It renders in two situations only:

  1. On a single fundation page, showing that page’s event.
  2. When an event filter is active on an archive, as a banner for the filtered event.

It does not render on the unfiltered fundations overview, and it does not render once per card inside a Query Loop. The block always outputs its wrapper element, even when there is no event to show, so the Pro Filter Bar can replace its contents over AJAX when the visitor switches events.

How to use it

  1. Add the Event Card block to a single fundation template, or near a filterable archive.
  2. Choose whether to show the event name.
  3. Adjust the card padding, corner radius, background, and the name color and size.

Settings and options

OptionAttributeTypeDefault
Show event nameshowNamebooleantrue
Corner radiuscardBorderRadiusnumber8
Paddingpaddingnumber24
Background colorbackgroundColorstring(theme default)
Name colornameColorstring(theme default)
Name font sizenameFontSizenumber0 (inherit)
Name font weightnameFontWeightnumber0 (inherit)

What you can and cannot do

You can show the current event on single pages and as a filter banner, and style the card. You cannot use it as a per-item badge inside a Query Loop: it is scoped to a single resolved event per render. On pages with no event, it stays empty (the wrapper is still output for the Filter Bar to use).

Troubleshooting

The card is empty on a fundation page. The page has no event, directly or inherited. Assign an event, or join it to a campaign that has one.

It shows the campaign’s event, not the one I set on the page. That is event inheritance working as intended. When a page joins a campaign that already has an event, the campaign’s event wins.