Mô tả
Kayce Custom Archive Sections lets you create and manage reusable content areas that appear automatically before or after the post loop on your WordPress archive pages — no theme file editing required.
Each section is a regular WordPress post, so you can design it with the block editor (Gutenberg) or Elementor, publish it once, and it shows up exactly where you set it.
The plugin works with both classic PHP themes and modern Full Site Editing (FSE) / block themes like Twenty Twenty-Five — out of the box, with no extra configuration.
Archive locations supported:
- Blog index (Posts page)
- All category archives
- Specific category archives — target individual categories with a built-in category picker
- Tag archives
- Author archives
- Search results pages
- Date archives
Display controls:
- Before or after the post loop — per section
- Active / Inactive toggle — publish a section without displaying it yet
- Visibility by login state — show to everyone, logged-in users only, or logged-out visitors only
Admin experience:
- At-a-glance list table with Active, Location, Position, and Visibility columns
- One-click Duplicate action to clone any section as a draft
- Preview link in the meta box that jumps straight to the relevant archive page
- Display order controlled via the standard Order field (Page Attributes)
Performance & security:
- Transient caching — sections are cached per location, position, and login state; cache is busted automatically when a section is saved or the plugin is deactivated
- Admin CSS and JavaScript load only on the Archive Sections edit screen — zero frontend asset overhead
- All inputs validated against whitelists; category IDs cast with
absint(); nonces verified withsanitize_key() - Works with all standard caching plugins
For developers:
kcas_query_args— filter the WP_Query args before sections are fetchedkcas_section_html— filter the HTML of an individual sectionkcas_sections_html— filter the complete output wrapper HTMLkcas_before_sections— action fires before the sections wrapper is outputkcas_after_sections— action fires after the sections wrapper is output- Sections are wrapped in
<section class="kcas-archive-section" id="kcas-section-{ID}">and<div class="kcas-archive-sections kcas-archive-sections--{before|after}">for easy CSS targeting
Perfect for:
- Hero banners or intro text above your blog feed
- Promotional blocks, CTA banners, or newsletter sign-ups below posts
- Category-specific messaging (e.g. a disclaimer on a legal advice category)
- Showing different content to logged-in members vs. public visitors
- Search results page enhancements
Cài đặt
From the WordPress Plugin Directory
- Go to Plugins Add New in your WordPress admin.
- Search for Kayce Custom Archive Sections.
- Click Install Now, then Activate.
Manual Installation
- Download the plugin ZIP file.
- Go to Plugins Add New Upload Plugin.
- Upload the ZIP and click Install Now, then Activate.
Getting Started
- After activation, go to Archive Sections Add New in the admin menu.
- Write or design your section content using the block editor or Elementor.
- In the Archive Section Settings meta box on the right, configure:
- Location — choose which archive page(s) to target. Selecting Specific Categories reveals a category picker.
- Position — before or after the post loop.
- Active — tick to enable the section immediately.
- Visibility — show to everyone, logged-in users only, or logged-out visitors only.
- Click Publish.
- Visit the matching archive page — your section will appear automatically.
Tip: Use the Order field (Page Attributes panel) to control display order when multiple sections share the same location and position. Lower numbers appear first.
Hỏi đáp
-
Does this work with any theme?
-
Yes — including Full Site Editing (block) themes like Twenty Twenty-Five. The plugin automatically detects whether your active theme is a classic or block theme and uses the correct rendering pipeline for each.
-
Can I use Elementor to design my sections?
-
Yes. The Archive Section custom post type has
show_in_restenabled, making it fully compatible with the block editor. Elementor also supports editing custom post types, so you can build sections visually with Elementor as well. -
Can I target a specific category page?
-
Yes. Set the location to Specific Categories, then tick the categories you want in the category picker that appears below. The section will only display on those category archives.
-
Can I show different content to logged-in and logged-out users?
-
Yes. Each section has a Visibility setting: Everyone, Logged-in users only, or Logged-out visitors only.
-
How do I temporarily disable a section without deleting it?
-
Uncheck the Active checkbox in the meta box and update the post. The section will be saved but will no longer display on the front end.
-
How do I control the order of multiple sections?
-
Set the Order value in the Page Attributes panel (lower numbers appear first). Sections with the same order value are sorted alphabetically by title.
-
Will the sections appear on the front end straight away?
-
Yes — as soon as you publish an active section with a location and position set, it will appear on the matching archive page. The transient cache is cleared automatically on save.
-
Does the plugin add any database tables?
-
No. The plugin uses WordPress’s standard
wp_posts,wp_postmeta, andwp_optionstables only. -
Will it slow down my site?
-
No. Sections are cached in transients after the first load, so subsequent page views skip the database query entirely. The cache is split by location, position, and login state to ensure visitors always see the correct content. Admin assets (CSS/JS) are only loaded on the Archive Sections edit screen.
-
What happens when I delete the plugin?
-
The included
uninstall.phppermanently deletes all Archive Section posts and their meta data when the plugin is removed from Plugins Installed Plugins Delete.
Đánh giá
Không có đánh giá nào cho plugin này.
Người đóng góp & Lập trình viên
“Kayce Custom Archive Sections” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.
Những người đóng gópDịch “Kayce Custom Archive Sections” sang ngôn ngữ của bạn.
Muốn tham gia phát triển?
Duyệt code, check out SVN repository, hoặc theo dõi nhật ký phát triển qua RSS.
Nhật ký thay đổi
1.1.1
Bug fixes
- Fixed sections with the Single Post location not appearing on FSE / block themes — the render_block filter now targets
core/post-contentin addition tocore/query. - Fixed After Header and Before Posts positions on FSE singular pages injecting between the featured image and post body. Both positions now inject after the header template part, before the post title and featured image.
- Fixed section design breaking on every other page load. WordPress generates dynamic layout class names (
wp-container-*-is-layout-N) that increment globally; caching rendered HTML caused class/CSS mismatches on subsequent requests. The cache now stores raw section data and blocks are rendered fresh on each request. - Fixed post content disappearing after sections were rendered — missing
wp_reset_postdata()call after the section rendering loop. - Fixed stale section output after switching themes — cache is now busted automatically on
switch_theme. - Fixed After Header sections on classic themes with a sidebar (e.g. ColorMag) remaining inside the primary content column. The JS repositioner now loops until stable, correctly lifting the section to full-width outside the columns row.
1.1.0
New positions
- Added After header (
before_content) position — injects the section between the site header and the page content area, outside the posts grid. - Theme-specific hook cascade fires in the structurally correct location for Astra, Genesis Framework, OceanWP, Kadence, Neve, WooCommerce Storefront, Hestia, ColorMag, Blocksy, Hello Elementor, Divi, and Enfold.
- JavaScript safety net automatically repositions sections that land inside a posts-loop container on unsupported classic themes (detects
articlesiblings, moves section before the grid with no page reload). - Position field in the meta box is now hidden when Location is set to Disabled — no confusing options for inactive sections.
- Visibility options now display one option per row for full readability in the narrow sidebar meta box.
New features
- Quick Edit — update Active, Position, and Visibility directly from the list table without opening the edit screen.
- Bulk actions — activate or deactivate multiple sections at once from the list table.
- Sortable columns — Active, Location, Position, and Visibility column headers are all sortable.
- Settings page (Archive Sections Settings) — configure transient cache expiry (0–168 hours); set to 0 to disable caching entirely.
- Activation welcome notice — a one-time admin notice appears after activation with a direct link to create the first section.
- Single post support — sections can now target individual post pages (
is_single()), not just archive pages.
Admin UI redesign
- Archive Section Settings meta box fully redesigned: CSS toggle switch for Active state, two-column Dashicon card grid for Location, segmented button groups for Position and Visibility, styled category search with a leading icon, and a full-width Preview button.
- Category list items show a post-count badge; checked items are highlighted in blue.
- Friendly empty-state card with a Create CTA shown when no sections exist yet.
Dynamic block context fixes
- On single posts and static pages: dynamic blocks (
core/post-title,core/post-excerpt,core/post-featured-image, etc.) now correctly resolve against the viewed post rather than the section post itself. - On archive pages (category, tag, author, search, date): post-specific blocks return empty rather than showing the section’s own data; archive-aware blocks (
core/archive-title,core/term-description) are unaffected. - Cache for the
single_postlocation now includes the viewed post ID in the cache key, so each post gets its own cached copy.
Bug fixes
- FSE / block themes: fixed duplicate section injection on pages that render multiple Query Loop blocks with
inherit: true. - Cache:
single_postwas missing from the locations list used during cache bust anduninstall.phpcleanup. - Frontend assets now enqueued only on archive and singular pages — zero overhead on all other pages.
Developer / i18n
- All user-facing strings wrapped in the
kayce-custom-archive-sectionstext domain. - Added
languages/kayce-custom-archive-sections.pottemplate for translators. - Full CPT label set:
archives,attributes,items_list,items_list_navigation,filter_items_list, and more. - New frontend script (
frontend.js) enqueued only on relevant pages; sections exposekcas-archive-sections--before_contentclass for custom CSS targeting.
1.0.0
- Initial release.
- Custom post type (
kcas_section) for creating reusable archive sections. - Display sections before or after posts on the blog index and category archive pages.
- Support for specific category targeting with a scrollable category picker.
- Additional archive locations: tag archives, author archives, search results, date archives.
- Per-section Active / Inactive toggle.
- Per-section login-state visibility control (everyone / logged-in / logged-out).
- Admin list table columns: Active, Location, Position, Visibility.
- Duplicate / Clone row action with nonce and capability checks.
- Preview link in the meta box resolving the real archive URL per location type.
- Transient caching with version-stamped keys; login state included in cache key; targeted per-location cache busting on save.
- Admin CSS and JS enqueued only on the Archive Section edit screen (zero front-end overhead).
- Full compatibility with classic themes (loop_start / loop_end pipeline) and FSE / block themes (render_block filter pipeline).
- Fully compatible with Gutenberg and Elementor.
- Developer hooks:
kcas_query_args,kcas_section_html,kcas_sections_html,kcas_before_sections,kcas_after_sections. uninstall.phpfor clean removal.
