get_extended WordPress Function

Get extended entry info ().

There should not be any space after the second dash and before the word ‘more’. There can be text or space(s) after the word ‘more’, but won’t be referenced.

The returned array has ‘main’ and ‘extended’ keys. Main has the text before the . The ‘extended’ key has the content after the comment.


<?php get_extended( $post_content ) ?>

(string) (required) Post content.
Default: None
Return Values
Post before (‘main’) and after (‘extended’).
Displaying small excerpts from latest posts.
If you want to display the latest posts on your WordPress blog, but only the content which comes before the

<ul><!–?php global $post; $args = array( ‘numberposts’ =&gt; 5 );&lt;br ?–> $myposts = get_posts( $args );</ul>
<ul>foreach( $myposts as $post ) : setup_postdata( $post );</ul>
<ul>$content_arr = get_extended ( $post-&gt;post_content ); ?&gt;
<li><!–?php the_title(); ?–>

<!–?php echo $content_arr[‘main’]; //Display the part before the more tag ?–></li>

tag, you can use this:


Note: $content_arr[‘extended’] contains the contents after the more tag.

Leave a Reply

Your email address will not be published. Required fields are marked *