[Resolved] get specific post in a template
Hello, I would like to show a specific post (I know its ID) in a template.
I was using the plugin get-a-post, but there is a problem when the rich text editor when I use it.
I read in the CODEX that there were a “get_post” function in wordpress, I’ve read the doc but it’s seems a little vague.
I would like to know if you could tell me how I can use it.
My previous template code (with get-a-post) was :
get_a_post(145); ?> <div class="post-intro" id="intro"> <h3><?php the_title();?></h3> <?php the_content(); ?> <p class="postmetadata"><?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </div>
How can I do the same without the get-a-post plugin ?
(this is outside the loop)
I also see there is a query_posts function. But I think if I use it, the other “default” posts will not be shown anymore, i’m I wrong ? I think this function restricts the query to one post, and what I want is one specific post on the top of the page, then the others…
- The topic ‘[Resolved] get specific post in a template’ is closed to new replies.