Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
obtener el contenido por id del post
<div class="post-resume">
$my_postid = get_the_ID();//This is page id or post id
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
echo wp_trim_words( $content, 40, '<a href="'. get_permalink() .'"> ...Read More</a>' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment