How get wordpress post content by post id: WordPress


Hello Friends!

If you want to get the post content anywhere in your templates files using post id, then use my code, hope this will be help full to all my friends 🙂

<?php
$post_7 = get_post(7); 
$title = $post_7->post_title; //get the post title
$content = $post_7->post_content; //get post content
?> 

Enjoy Raghunath Code!

Advertisements

Sr. Software Engineer

Tagged with: , , ,
Posted in Wordpress
2 comments on “How get wordpress post content by post id: WordPress
  1. Tamisha Exon says:

    Hmm, there will probably be several difficulties with the main link, simply because it gives me a 404 fault.

  2. Cara says:

    TҺe gameplay for dгiving more iոterest aand potenntial clients to your site
    haas changed, aոd linkwheel iis one of the driving forces tto this
    change. Thіs will automaticаlly incrеɑse
    maximum benefits to the client’s businеss aand wikl justify his iոvestment on SEO.
    Each page on your website should bе written for one keyword or one keyword phrase only.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: