I'm attempting to pull excerpts and custom fields from specific posts, I've attempted using publish game titles and publish id however i am only succeeding in tugging each and every publish by using this query. For instance I've this code attempting to pull only the title for that publish with id 182
<?php $map = new WP_Query(); $map->query('post_id=182'); ?> <?php while ($map->have_posts()) : $map->the_post(); ? <?php the_title(); ?> <?php endwhile; ?>
It pulls the title of each and every single publish that way and I am unable to work out how I will have multiple loops such as this each tugging content from only one specific publish. Can someone please explain where I went wrong?
Knowing the publish ID you'll be able to use
get_post($post_id); like so
$post_id = 182; $my_post = get_post($post_id); $title = $my_post->post_title; echo $title; echo $my_post->post_content;
I have had luck with