This is the method to get the selective post ( $post_id = 26; 26 is the id it may be change )
Method 1 <?php
$post_id = 26;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $title;
echo $queried_post->post_content;
?>
Method 2
Method 1 <?php
$post_id = 26;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $title;
echo $queried_post->post_content;
?>
Method 2
<?php // retrieve one post with an ID of 1
query_posts('p=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<h4><?php the_title(); ?></h4>
<?php the_content(); ?>
<?php endwhile;?>
No comments:
Post a Comment