-1

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?

3 Answers 3

1

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.

0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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