wordpress:如何在一页上显示多个页面? [英] wordpress: How can I display multiple pages on one page?

查看:37
本文介绍了wordpress:如何在一页上显示多个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有三个不同的页面,page1、page2 和 page3.

Let's say I have three different pages, page1, page2, and page3.

我希望 page1 和 page2 显示在我的静态首页上.我是否将循环限制为仅拉出 page1 和 page2,或者我是否需要开始循环,测试 name="page1" 或类似的东西,然后打印?谢谢!-乔

I want page1 and page2 to display on my static front page. Do I restrict the loop to only pull page1 and page2, or do I need to start the loop, test for name="page1" or something like that, and then print? Thanks! -Joe

推荐答案

我会跳过循环并简单地使用 get_page($id) 如下所述:

I would skip the loop and simply use get_page($id) as described here:

http://codex.wordpress.org/Function_Reference/get_page

您只需要知道页面的 ID,您就可以在任何地方一次拉取一个.

All you need to know is the ID's of your pages, and you can pull them one at a time anywhere you want.

这篇关于wordpress:如何在一页上显示多个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆