Comments on: WordPress Template Tags: How They Show Post Content & More https://wpshout.com/wordpress-post-template-tags/ A hub for advanced WordPress users, developers & savvy business owners. Wed, 13 Mar 2019 17:03:28 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Luca R. https://wpshout.com/wordpress-post-template-tags/#comment-20734 Fri, 11 May 2018 09:42:54 +0000 https://wpshout.com/?p=4855#comment-20734 Uhm, code blocks are not displayed correctly. Let’s try again:

So, if you want to display the content of a post outside of the loop, you may want to do this:


$content = get_the_content( 1 );
echo apply_filters( 'the_content', $content );

If you want the unfiltered title, you must get it directly from a post object, i.e.:


global $post;
$title = $post->post_title;

]]>
By: Two Key Principles for Understanding WordPress Functions | WPShout.com https://wpshout.com/wordpress-post-template-tags/#comment-20732 Tue, 23 Sep 2014 20:51:46 +0000 https://wpshout.com/?p=4855#comment-20732 […] David covered this in a post a while back, but it bears emphasizing: […]

]]>
By: Everything You Should Know about WordPress Custom Fields | WPShout.com https://wpshout.com/wordpress-post-template-tags/#comment-20731 Tue, 01 Apr 2014 15:26:56 +0000 https://wpshout.com/?p=4855#comment-20731 […] — just like other template tags that start with the_ (here’s a recent post that talks about that convention in more detail), the_meta is meant to echo (display, print, etc) the content of a custom field so […]

]]>