Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to know how I can add a specific post to a specific page? It would be great if anyone can suggest a reference to this problem.

Do I need to create a post category to relate with a page? Or should I add a category on menu widgets rather than page?

share|improve this question
add comment

3 Answers

Well, if you just want to add specific Post's content/title/other stuff to specific Page, You can just use get_post() function. But Your formulation of question very vague.

share|improve this answer
add comment

If you want a separate page for each post then you can have a custom page template depending upon your page slug like page-page_slug.php and inside the page template you can specify the query using WP_Query or query_posts.

Ex. $query = new WP_Query( 'p=7' );

here 7 is the id of the post. You can set it as per your requirement.

Refer this for more possible parameters.

And using the_loop you can display the single post on the single page.

share|improve this answer
add comment

Page cannot have a post. These are two different "post types".

Why do you want to add a post to a page in the first place? You can give a post a category and it will show on a "category page" which is actually a listing of all posts with that category. You could then have a custom category-slug.php where slug is the slug of that category so the posts with that category would show with that template and you could do whatever you want with them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.