WordPress plugin intelligence profile

Content Sectioner

Content Sectioner is a developer plugin that makes it easy to insert formatting markup (div and img tags) into long pieces of content.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.6
Current version1.0.0
WordPress coverageTested up to WordPress 4.6
Minimum stackWP 3.1.0 · PHP —
Directory statusactive
Last directory update3 Sept 201610y ago
Active installations10Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Content Sectioner version 1.0.0 as active, updated 10y ago and tested up to WordPress 4.6.

Overview

About this plugin

Most modern websites have pages that break the content into multiple sections, with changing background colors and graphics marking the breaks between sections. In order for a page to be broken into sections, typically there needs to be additional markup within the HTML (ie. div tags) that can be targeted in the stylesheet for formatting.

).

Content Sectioner takes advantage of WordPress’s content filtering mechanism and makes it easy for a theme developer to insert the necessary sectioning markup auto-magically while allowing content authors to still work as they prefer. It looks for specified landmarks within the content (such as h3 tags) and performs the necessary code insertions or replacements.

It does this using a concise and easy-to-use notation, relieving the theme developer from having to write (often repetitive) regular expressions and string manipulation.

A concrete example

Suppose you’re working on a site and you want the About page (with slug about ) to have an inset in the middle of it with a blue background setting it apart. The inset should contain the first occurence of a “Heading 3” and all the paragraphs up until just before the next “Heading 2”. inset.

php file contains something like this:

php

$current_slug = get_queried_object()->post_name;

get_template_part('content', $current_slug);

>

php, you can set up the Content Sectioner like so:

php

$sectioner = new ContentSectioner();

$sectioner->replace_first( array( 'open_tag' => 'h3', 'open_insert' => '<div class="inset">', 'open_policy' => 'before', 'close_tag' => 'h2', 'close_insert' => '</div>', 'close_policy' => 'before' ) );

// Do the usual Loop thing here... >

The About page (and only the About page) will have this inset section inserted.

You can provide replacement rules that replace/insert at the first occurrence of a match, the next occurrence, all remaining occurrences, or all occurrences in the entire piece of content. You can place the inserted HTML before or after a match, or replace the match. Also, you can match a closing tag by simply providing the preceding slash character (eg.

‘/h2’). Tag matches will match against any variant of a tag (upper or lowercase, with or without attributes, as an opening tag or as a self-closing tag like <hr /> ). In the rare case that something other than a tag needs to be matched, you can supply a raw regex instead of a tag.

Providing instructions

As the theme developer, you likely would want to let the content authors know that this magic insertion of sections will occur, and what landmarks need to be present in their content to trigger the sectioning.

php ), you can provide such instructions along with the slug for the page to which the instructions apply. The instructions will appear at the top of the Edit Page page in the admin.

");

Full User Guide

For full documentation and more sample use cases, visit the Content Sectioner homepage.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • content filtering
  • content formatting
  • developer
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.6

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.6.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.6
Minimum requirementsWordPress 3.1.0 · PHP not listed
Update activity3 Sept 201610y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.