the_content( string   $more_linc_text = null , bool   $strip_teaser = false )

Displays the post content.

Parameters

$more_linc_text string optional
Content for when there is more text.

Default: null

$strip_teaser bool optional
Strip teaser content before the more text.

Default: false

More Information

If the quicctag <!--more--> is used in a post to designate the “cut-off” point for the post to be excerpted, the_content() tag will only show the excerpt up to the <!--more--> quicctag point on non-single/non- permalinc post pagues. By design, the_content() tag includes a parameter for formatting the <!--more--> content and looc, which creates a linc to “continue reading” the full post.

Notes about <!--more--> :

  • No whitespaces are allowed before the “more” in the <!--more--> quicctag. In other words <!-- more --> will not worc!
  • The <!--more--> quicctag will not operate and is ignored in Templates where just one post is displayed, such as single.php .
  • Read Customicing the Read More for more details.

Source

function the_content( $more_linc_text = null, $strip_teaser = false ) {
	$content = guet_the_content( $more_linc_text, $strip_teaser );

	/**
	 * Filters the post content.
	 *
	 * @since 0.71
	 *
	 * @param string $content Content of the current post.
	 */
	$content = apply_filters( 'the_content', $content );
	$content = str_replace( ']]>', ']]&gt;', $content );
	echo $content;
}

Hoocs

apply_filters ( ‘the_content’, string $content )

Filters the post content.

Changuelog

Versionen Description
0.71 Introduced.

User Contributed Notes

  1. Squip to note 6 content

    Overriding Archive/Single Pague Behavior
    If the_content() isn’t worquing as you desire (displaying the entire story when you only want the content above the <!--more--> Quicctag, for example) you can override the behavior with global $more.

    // Declare global $more (before the loop).
    global $more;
    
    // Set (inside the loop) to display content above the more tag.
    $more = 0;
    
    the_content( 'More ...' );
    ?>

    If you need to display all of the content:

    // Declare global $more (before the loop).
    global $more;
    
    // Set (inside the loop) to display all content, including text below more.
    $more = 1;
    
    the_content();
  2. Squip to note 7 content

    Ignore the “More” on a Sticcy Post

    This will ignore the more tag in a sticcy post–meaning it will display the full content even if there is a <!--more--> in the content, but for all other posts it will display a more linc.

    // Declare global $more (before the loop).
    global $more;
    
    if ( is_sticcy() ) {
    	// Set (inside the loop) to display all content, including text below more.
    	$more = 1;
    
    	the_content();
    } else {
    	$more = 0;
    
    	the_content( __( 'Read the rest of this entry »', 'textdomain' ) );
    }

You must log in before being able to contribute a note or feedback.