ifacethoughts

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: ,

Discussion [Participate or Link]

  1. Abhijit Nadgouda @ iface » Blog Archive » multipage said:

    [...] pages [...]

  2. Abhijit Nadgouda @ iface » Blog Archive » Wordpress Global Variables said:

    [...] pages [...]

  3. Abhijit Nadgouda @ iface » Blog Archive » numpages said:

    [...] 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. [...]

  4. Abhijit Nadgouda @ iface » more said:

    [...] 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. [...]

  5. Wordpress Global Variables | iface thoughts said:

    [...] $pages [...]

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.

freshthoughts

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
My bookmarks

badgesand...

This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.