Content Parts


This plugin allows you to split your editable content into multiple parts and display each part using template tags within your theme, allowing you to create complex content layouts.

It works in a similar way to how you split your content area into multiple pages…

Splitting your content into multiple parts

The plugin adds a new button to the rich text editor.

Clicking this button will insert a break to divide your content into multiple parts. The break will be define by a dotted line and tag.

In the HTML these dividers are defined by HTML comments so they degrade seamlessly if you deactivate the plugin – they don’t display to the user.

Adding template tags to your theme

To display the content parts you will need to add some template tags to your theme. Without adding tags the content will continue to display as normal using the the_content() template tag.

The Content Parts plugin has several template tags to display your content:

  • the_content_part( $page = 1, $args = null );
  • get_the_content_part( $page = 1, $args = null );
  • the_content_parts( $args = null );
  • get_the_content_parts( $args = null );
  • has_content_parts( $args = null );
  • count_content_parts( $args = null );

Example 1

To correctly show the first content part instead of the main the_content() tag.

if ( function_exists( 'the_content_part' ) ) {
	the_content_part( 1 );
} else {

Example 2

Display the second content part. Checking that the function exists first will ensure compatibility if you deactivate the plugin.

<?php if ( function_exists( 'the_content_part' ) ) the_content_part( 2 ); ?>

Example 3

Display the third content part surrounded by a div.

<?php if ( function_exists( 'the_content_part' ) ) the_content_part( 3, array( 'before' => '<div class="content-area-3">', 'after' => '</div>' ) ); ?>

Example 4

A complex example. If there are multiple content parts, show the first content part followed by the next 3 content parts in a repeating set of styled divs. If you want to include all remaining content parts in the list, omit the ‘limit’ parameter.

if ( function_exists( 'the_content_part' ) && has_content_parts() ) {
	the_content_part( 1, '<div class="header">', '</div>' );
	the_content_parts( array(
		'before' => '<div class="item">',
		'after' => '</div>',
		'start' => 2,
		'limit' => 3
	) );
} else {


Top Downloaded Mp3s
best dentist in los angeles
best web host
web hosting
vps hosting