Digital Sovereignty for everyone

Pre-footer

Since 2.37.0 every theme template has a pre-footer template part just before the footer, in an aside. It is for per-site content that belongs at the bottom of normal pages but not in the footer itself, such as sponsors, partners, an acknowledgement of country or a newsletter signup. A site that doesn’t use it sees no change.

Using it

Edit the part named Pre-footer in the Site Editor (it is registered in theme.json) and add blocks inside it. Since 2.37.1 the theme’s parts/pre-footer.html is the footer’s card structure with nothing in it, a Group with the class site-footer holding a Group with the class site-info, so whatever a site adds gets the footer’s card styling with no wrapper to build. It shows on every page whose template includes it: all the theme’s templates and footer.php. The wrapper element can be switched from aside to section in a template’s Template Part settings.

Where it does not show

Templates that leave the part out don’t show it. That is the point: LH Image Gallery’s photo pages, for example, have the footer but not the pre-footer. Templates registered by plugins (bbPress, knowledge base, portfolio and others) only include the header and footer, so they don’t show the pre-footer unless the plugin adds <!-- wp:template-part {"slug":"pre-footer","tagName":"aside"} /--> before its footer. A part a theme doesn’t have renders nothing for visitors, so adding it is safe on any theme. A site’s own edited copy of a theme template, saved before 2.37.0, needs the line added by hand.

Empty pre-footer

A pre-footer that holds nothing but empty Groups (the theme’s empty card) prints no HTML at all: no card and no aside landmark. Any other block added inside it counts as content. template_part_has_content() checks the part that actually renders, the site’s published copy or else the theme’s file, so an unpublished draft copy is ignored. filter_empty_pre_footer() applies it in block templates, and footer.php uses it for classic pages. The slug is filterable with lh_2015_pre_footer_slug.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.