WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get the content

Description

Retrieve the post content. (Must be used in a Loop)

An important difference from the_content() is that get_the_content() does not pass the content through the 'the_content' filter. This means that get_the_content() will not auto-embed videos or expand shortcodes, among other things.

Usage

<?php get_the_content$more_link_text$stripteaser ?>

Parameters

$more_link_text
(string) (optional) Content for when there is more text.
Default: null
$stripteaser
(boolean) (optional) Strip teaser content before the more text.
Default: false

Return Values

(string) 

Examples

Display the post content, ending with "Read more" if needed

<?php
$content = get_the_content('Read more');
print $content;
?>

Notes

If you use plugins that filter content (add_filter('the_content')), then this will not apply the filters, unless you call it this way (using apply_filters):

<?php apply_filters('the_content',get_the_content$more_link_text$stripteaser$more_file )) ?>

Change Log

Since: 0.71

Source File

get_the_content() is located in wp-includes/post-template.php.

Related

See also index of Function Reference and index of Template Tags.