“Function Reference/get page”的版本间的差异

来自WordPress中文文档
跳转至: 导航搜索
Description
 
(1个修订)
(没有差异)

2009年3月14日 (六) 09:23的版本

includeonlydiv style=clear:both; background-color:#FAEBD7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;This page is marked as incomplete. You can help Codex by expanding it./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude

Description

Retrieves page data given a page ID or page object. Pages provide a way to have static content that will not affect things like articles or archives, or any other blog entry features of wordpress. Its simply a way to turn a blog entry into static content.

Wrong way: $p = get_page(2); // Error: Only variables can be passed by reference

Right Way: $n = 2; $p = get_page($n);

Why? I think it's a PHP bug

Get title: $p-post_title

Get Content $p-post_content