General Electric
General Electric

Reputation: 1226

Get post content until read more Wordpress

I want to get content of a post until the read more that I set when I'm creating a new post, so far I'm able to get the content doing

apply_filters('the_content', $post->post_content);

I would like to get only until the Read More, I'm integrating a blog to the home page and I only need a brief description of the article.

Thanks

Upvotes: 0

Views: 2352

Answers (1)

epicallan
epicallan

Reputation: 66

This is a function in the WordPress codex that does that, hope it helps.

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

Upvotes: 1

Related Questions