• Resolved Anonymous User

    (@anonymized-18195298)


    Can someone suggest PHP or shortcode to display the content only of a particular post?

    By content only, I mean everything between <div class="entry-content"> and the closing </div> tag (at least in the theme I am using). In other words, just the blocks themselves (without the page wrappers, headers, title, featured image, meta data, sidebars, footers, etc.).

    Hoping this is simple, and I have just failed to find it so far. Thank you.

    • This topic was modified 3 years, 7 months ago by Anonymous User.
    • This topic was modified 3 years, 7 months ago by Anonymous User.
    • This topic was modified 3 years, 7 months ago by Anonymous User.
Viewing 1 replies (of 1 total)
  • Thread Starter Anonymous User

    (@anonymized-18195298)

    Found it:

    <?php
    $post = get_post ( $post = 9999 );
    return $post->post_content;
    ?>

    Where 9999 = the post ID. Depending on the context, you may need to substitute echo for return.

Viewing 1 replies (of 1 total)
  • The topic ‘How to display content only of a particular post?’ is closed to new replies.