GP Elements Page Conditions
Hide/show GeneratePress elements based on paging.
by Paul Faulkner · github.com/headwalluk/gp-elements-page-conditions · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/headwalluk/gp-elements-page-conditions/archive/refs/heads/main.zipReadme
GP Elements Page Conditions
A small WordPress plugin by Headwall Hosting that adds a paging condition to GeneratePress Premium Elements.
GeneratePress Elements can target a taxonomy archive, but not a particular page of it. This plugin adds a Paging Condition meta box to every Element, so page one of an archive can carry a large hero with SEO copy and a featured-post layout, while pages two onwards use a compact hero and a plain list.
Conditions
| Condition | Behaviour |
|---|---|
| Pass through | No paging condition. The default. |
| Only show on page one | Hidden once the visitor pages past the first page. |
| Never show on page one | Hidden on the first page, shown from page two on. |
| Only show on pages… | Shown only on the page numbers listed. |
The page list is comma separated and accepts single pages (3), ranges (2-5) and open ranges (4- for page four onwards, -3 for up to page three). Unparseable segments are dropped on save, and an empty list passes through rather than hiding the Element everywhere.
Where it applies
Anywhere a page number is meaningful: term and post type archives, the blog index, search results, and multi-page single posts split with ``. On any unpaginated view the current page counts as page one.
The condition is applied on top of the Element's own display rules — it can only hide an Element that GeneratePress was already going to show, never reveal one that was excluded.
Installation
Drop the plugin into wp-content/plugins/ and activate it. It needs the Elements module of GeneratePress Premium; without it the plugin is inert and shows an admin notice.
There is no build step — no npm, no Composer, no bundler.
Migrating from the ACF implementation
This plugin replaces an ACF field group and a functions.php filter previously used on Headwall sites. The meta key is unchanged, so migration is:
- Activate this plugin.
- Delete the ACF field group that provided
archive_paging_visibility. - Remove the
generate_element_displayfilter from the theme.
Existing Elements keep their settings. The one behaviour change is scope: the theme version tested is_archive() only, so the blog index and search results were silently excluded. This plugin covers them, which means an Element set to Never show on page one with a broad display rule will now also be hidden on unpaginated views, since those count as page one.
Translations
Ships translations for de_DE, el_GR, en_GB, es_ES, fr_FR, it_IT, nl_NL and pl_PL in languages/, generated by wp-translate:
wp-translate . de_DE,el_GR,en_GB,es_ES,fr_FR,it_IT,nl_NL,pl_PL
The conventions for writing translatable strings in this plugin are in CLAUDE.md.
Developer documentation
- CHANGELOG.md — per-version release notes
- CLAUDE.md — architecture, conventions and file layout
License
Licensed under GPLv2 or later.