Wordpress: include content of one page in another

后端 未结 8 1352
挽巷
挽巷 2020-12-23 23:18

How do I include the page content of one or more page in another page?

ex. I have pageA, pageB and pa

8条回答
  •  无人及你
    2020-12-23 23:39

    Pages are just posts, with a post_type of 'page' in the database. You can show the content of multiple pages on another page by writing a post query in your pageX template that gets the posts you specify and output them in a Loop.

    There are three ways to get post content from the database:

    1. get_posts
    2. query_posts
    3. WP_Query

    These links all point to the WordPress Codex. Get_posts and query_posts have an argument available, 'page_id', where you can specify the id of the page you'd like to retrieve and display.

提交回复
热议问题