<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: Get all pages in theme's function.php file - only getting first page</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: Get all pages in theme's function.php file - only getting first page</description>
<language>en</language>
<pubDate>Thu, 26 Nov 2009 15:37:54 +0000</pubDate>

<item>
<title>pavy on "Get all pages in theme's function.php file - only getting first page"</title>
<link>http://wordpress.org/support/topic/286213#post-1125000</link>
<pubDate>Fri, 03 Jul 2009 17:25:01 +0000</pubDate>
<dc:creator>pavy</dc:creator>
<guid isPermaLink="false">1125000@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Thanks. I ended up with this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function sitenav() {
	$pages = get_pages();
	$optionstring = &#38;#39;&#38;#39;;
	foreach ($pages as $pagg) {
		$option = &#38;#39;&#38;lt;li&#38;gt;&#38;#39;;
		$option .= &#38;#39;&#38;lt;a href=&#38;quot;&#38;#39; . get_page_link($pagg-&#38;gt;ID) . &#38;#39;&#38;quot;&#38;gt;&#38;#39;;
		$option .= $pagg -&#38;gt; post_title;
		$option .= &#38;#39;&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;&#38;lt;li&#38;gt;:&#38;lt;/li&#38;gt;&#38;#39;;
		$optionstring = $optionstring . $option;
	}
	return $optionstring;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>MichaelH on "Get all pages in theme's function.php file - only getting first page"</title>
<link>http://wordpress.org/support/topic/286213#post-1124875</link>
<pubDate>Fri, 03 Jul 2009 14:59:22 +0000</pubDate>
<dc:creator>MichaelH</dc:creator>
<guid isPermaLink="false">1124875@http://wordpress.org/support/</guid>
<description>&#60;p&#62;This:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function sitenav() {
	$pages = get_pages();
	foreach ($pages as $pagg) {
	$option = &#38;#39;&#38;lt;li&#38;gt;&#38;#39;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;should be:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function sitenav() {
        $option = &#38;#39;&#38;#39;;
	$pages = get_pages();
	foreach ($pages as $pagg) {
	$option .= &#38;#39;&#38;lt;li&#38;gt;&#38;#39;;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>pavy on "Get all pages in theme's function.php file - only getting first page"</title>
<link>http://wordpress.org/support/topic/286213#post-1124617</link>
<pubDate>Fri, 03 Jul 2009 07:46:01 +0000</pubDate>
<dc:creator>pavy</dc:creator>
<guid isPermaLink="false">1124617@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I'm trying generate all my page links from my theme's function.php file. Right now what I have works, but it only gets the first page. I think this may be due to the fact it's not in a loop, but I'm not that familiar with doing this in the functions file as I normally generate my page links using &#60;code&#62;wp_list_pages()&#60;/code&#62; in my theme file.&#60;/p&#62;
&#60;p&#62;Here is the block of code I'm currently using:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function sitenav() {
	$pages = get_pages();
	foreach ($pages as $pagg) {
	$option = &#38;#39;&#38;lt;li&#38;gt;&#38;#39;;
	$option .= &#38;#39;&#38;lt;a href=&#38;quot;&#38;#39; . get_page_link($pagg-&#38;gt;ID) . &#38;#39;&#38;quot;&#38;gt;&#38;#39;;
	$option .= $pagg -&#38;gt; post_title;
	$option .= &#38;#39;&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;&#38;lt;li&#38;gt;:&#38;lt;/li&#38;gt;&#38;#39;;
	return $option;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And then, I'm putting this function in a variable string, along with other HTML I need in the header area of my theme. And finally, I'm adding the action into a hook and echoing the full output.&#60;/p&#62;
&#60;p&#62;Any suggestions on what I need to change/fix/add? Thanks!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
