pages

This global variable is an array related to multi-paged posts. multipage global variable indicates whether the current post is to be shown in multiple pages. pages is set in the function setup_postdata($post) defined in [wordpress root folder]/wp-includes/functions.php. A post is split into multiple pages wherever <!--nextpage--> is inserted. Every element in the pages array corresponds to the split page. The page to be displayed is determined by the global variable page.

The template function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = ''), defined in [wordpress root folder]/wp-includes/template-functions-post.php, uses this global variable to return post content corresponding to the requested page.

Plugin and theme developers can use this global variable to determine number of pages the current post has been split into.

Back to full list of global variables.

Technorati tags: ,

About these ads

4 Responses to “pages”

  1. Abhijit Nadgouda @ iface » Blog Archive » numpages Says:

    [...] WordPress uses numpages global variable to store the number of pages in a multipage post. It is set in the function setup_postdata($post) defined in [wordpress root folder]/wp-includes/functions.php. The split pages are stored in the global variable pages. [...]

  2. Abhijit Nadgouda @ iface » more Says:

    [...] A WordPress post can be forced to have a teaser by including the HTML markup <!– more –> in the post. WordPress then splits this into the teaser and the main post. When an explicit excerpt for a post is not specified, this teaser is used as an excerpt. more global variable is used to indicate whether the entire page of the post is to be displayed or only the teaser. Teasers can be included in every page of the post. It is set in the function setup_postdata($post) defined in [wordpress root folder]/wp-includes/functions.php. [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: