<?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>ThemeShaper Forums Topic: is_page() and custom template pages</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sun, 26 May 2013 06:49:10 +0000</pubDate>

<item>
<title>jonnycj on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21922</link>
<pubDate>Fri, 17 Jun 2011 18:17:05 +0000</pubDate>
<dc:creator>jonnycj</dc:creator>
<guid isPermaLink="false">21922@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Exactly that ! I had sort of realised this and tried adding the reset_postdata into the sidebar but it was not having it.&#60;br /&#62;
I have now added it directly after thematic_nav_below and voila. Thanks a lot for your input, you are a star !
&#60;/p&#62;</description>
</item>
<item>
<title>middlesister on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21893</link>
<pubDate>Thu, 16 Jun 2011 15:14:46 +0000</pubDate>
<dc:creator>middlesister</dc:creator>
<guid isPermaLink="false">21893@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I think this is because you are restoring the original query and using wp_reset_postdata straight after the loop, and the navigation for the pagination is usually included further down in the code. This means that the navigation would refer to the original query and not your custom loop. You do not specify how you are adding the loop or if you are making your own template. Make sure that there is a call for thematic_navigation_below() or the equivalent in the template, and add code for the resetting after the navigation. If you are using a thematic template, you could attach the resetting code to the thematic_belowcontent hook.
&#60;/p&#62;</description>
</item>
<item>
<title>jonnycj on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21891</link>
<pubDate>Thu, 16 Jun 2011 10:11:38 +0000</pubDate>
<dc:creator>jonnycj</dc:creator>
<guid isPermaLink="false">21891@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hello Middlesister,&#60;/p&#62;
&#60;p&#62;I am trying to get a similar idea running but also with pagination enabled so I can spread the posts across several pages. So far using a slight variation on your code (from here:http://codex.wordpress.org/Function_Reference/wp_reset_postdata) I get my sidebar menu working but pagination is still not active, so I wondered if you had any ideas.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
// adding in the query for posts
$original_query = $wp_query;
$wp_query = null; ?&#38;gt;
&#38;lt;?php $wp_query = new WP_Query(&#38;#39;category_name=survivorsnews&#38;#38;posts_per_page=5&#38;#38;paged=&#38;#39;.$paged ); ?&#38;gt;
&#38;lt;?php while ( $wp_query-&#38;gt;have_posts() ) : $wp_query-&#38;gt;the_post(); ?&#38;gt;
&#38;lt;div id=&#38;quot;post-&#38;lt;?php the_ID() ?&#38;gt;&#38;quot; class=&#38;quot;&#38;lt;?php thematic_post_class() ?&#38;gt;&#38;quot;&#38;gt;
&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;/a&#38;gt;
&#38;lt;h3 class=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/h3&#38;gt;
&#38;lt;?php the_excerpt(); ?&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink(); ?&#38;gt;&#38;quot; class=&#38;quot;more&#38;quot;&#38;gt;&#38;lt;?php echo more_text() ?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;?php thematic_postfooter(); ?&#38;gt;
&#38;lt;/div&#38;gt;&#38;lt;!-- .post --&#38;gt;
&#38;lt;?php endwhile; ?&#38;gt;
&#38;lt;?php
$wp_query = null;
$wp_query = $original_query;
wp_reset_postdata();
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Live page here:&#60;br /&#62;
&#60;a href=&#34;http://develop.survivorspoetry.org/?page_id=1347&#34; rel=&#34;nofollow&#34;&#62;http://develop.survivorspoetry.org/?page_id=1347&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Any thoughts greatly appreciated
&#60;/p&#62;</description>
</item>
<item>
<title>jjcorradi on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21027</link>
<pubDate>Wed, 04 May 2011 09:58:35 +0000</pubDate>
<dc:creator>jjcorradi</dc:creator>
<guid isPermaLink="false">21027@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Middlesister, I love you!&#60;br /&#62;
Now it works fine :)&#60;/p&#62;
&#60;p&#62;Both ways are working, the new WP_query and the original query restore.&#60;br /&#62;
Thanks a lot for your help!
&#60;/p&#62;</description>
</item>
<item>
<title>middlesister on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21023</link>
<pubDate>Wed, 04 May 2011 05:52:45 +0000</pubDate>
<dc:creator>middlesister</dc:creator>
<guid isPermaLink="false">21023@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Like you said, calling query_posts affects global values and the codex specifically states that it affects conditionals. Try the loop using a new WP_Query object instead.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php $my_query = new WP_Query(&#38;#39;category_name=profilo&#38;#38;posts_per_page=5&#38;#39;); ?&#38;gt;

&#38;lt;?php while ($my_query-&#38;gt;have_posts()) : $my_query-&#38;gt;the_post();?&#38;gt;

&#38;lt;div id=&#38;quot;post-&#38;lt;?php the_ID();?&#38;gt;&#38;quot; style=&#38;quot;visibility:hidden; position: absolute; &#38;quot;&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php the_title(); ?&#38;gt;
&#38;lt;/div&#38;gt;

&#38;lt;?php endwhile; ?&#38;gt;
&#38;lt;?php wp_reset_postdata(); ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I am just starting to get my head around the difference between query_posts and WP_Query myself. It is not always clear what is the best practice. With your first code, you are storing the original query in a temporary variable, but not restoring it at the end. Does it work when you restore the query?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php $temp_query = $wp_query; ?&#38;gt;
&#38;lt;?php query_posts(&#38;#39;category_name=profilo&#38;#38;posts_per_page=5&#38;#39;); ?&#38;gt;

&#38;lt;?php while (have_posts()) : the_post();?&#38;gt;

&#38;lt;div id=&#38;quot;post-&#38;lt;?php the_ID();?&#38;gt;&#38;quot; style=&#38;quot;visibility:hidden; position: absolute; &#38;quot;&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php the_title(); ?&#38;gt;
&#38;lt;/div&#38;gt;

&#38;lt;?php endwhile; ?&#38;gt;
&#38;lt;?php $wp_query = $temp_query; ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>joperron on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21021</link>
<pubDate>Wed, 04 May 2011 01:56:51 +0000</pubDate>
<dc:creator>joperron</dc:creator>
<guid isPermaLink="false">21021@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;maybe try just &#34;cat=profilo&#34;&#60;/p&#62;
&#60;p&#62;category_name seems to be for when you use an array
&#60;/p&#62;</description>
</item>
<item>
<title>jjcorradi on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21015</link>
<pubDate>Tue, 03 May 2011 21:42:12 +0000</pubDate>
<dc:creator>jjcorradi</dc:creator>
<guid isPermaLink="false">21015@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;The problem is the code I added in the custom template page:&#60;/p&#62;
&#60;p&#62;&#38;lt;?php $temp_query = $wp_query; ?&#38;gt;&#60;br /&#62;
&#38;lt;?php query_posts('category_name=profilo&#38;#38;showposts=5'); ?&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;?php while (have_posts()) : the_post();?&#38;gt;&#60;/p&#62;
&#60;p&#62;     &#38;lt;div id=&#34;post-&#38;lt;?php the_ID();?&#38;gt;&#34; style=&#34;visibility:hidden; position: absolute; &#34;&#38;gt;&#60;br /&#62;
	&#38;lt;?php the_content(); ?&#38;gt;&#60;br /&#62;
        &#38;lt;?php the_title(); ?&#38;gt;&#60;br /&#62;
     &#38;lt;/div&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;?php endwhile; ?&#38;gt;&#60;/p&#62;
&#60;p&#62;This is because calling the query_posts WordPress ignores the other parameters it receives via the URL (such as page number or category) [see &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/query_posts].&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/query_posts].&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If I try to do as they suggest in the page link I reported above:&#60;/p&#62;
&#60;p&#62;&#38;lt;?php global $query_string;&#60;br /&#62;
query_posts( $query_string . '&#38;#38;category_name=profilo&#38;#38;showposts=5' ); ?&#38;gt;&#60;/p&#62;
&#60;p&#62;I don't obtain the posts filtered as I wanted (category_name=profilo).&#60;/p&#62;
&#60;p&#62;Anyone can help?
&#60;/p&#62;</description>
</item>
<item>
<title>jjcorradi on "is_page() and custom template pages"</title>
<link>http://themeshaper.com/forums/topic/is_page-and-template-pages#post-21011</link>
<pubDate>Tue, 03 May 2011 20:22:05 +0000</pubDate>
<dc:creator>jjcorradi</dc:creator>
<guid isPermaLink="false">21011@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi everybody,&#60;br /&#62;
i'm developing a child theme and - in the functions.php of the child theme - i'm using an action hook to put a menu in the thematic sidebar; i want the menu to be displayed only in a certain page (page_id = 12).&#60;br /&#62;
Everything works good if the page uses a default template, but if I define a custom template and I assign it to this page I don't see the menu anymore. (The custom template is identical to the default one except for a few lines that don't affect the sidebar).&#60;/p&#62;
&#60;p&#62;Can you help me to figure out why does it happen and to solve the problem?&#60;br /&#62;
Thanks a lot&#60;br /&#62;
andrea&#60;/p&#62;
&#60;p&#62;This is the function:&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
function studioIQ_sidebar_profilo() { ?&#38;gt;&#60;/p&#62;
&#60;p&#62;	 &#38;lt;?php if (is_page(12)) { ?&#38;gt;&#60;/p&#62;
&#60;p&#62;     &#38;lt;div&#38;gt;&#60;/p&#62;
&#60;ul&#62;
&#60;li&#62;...&#60;/li&#62;
&#60;li&#62;...&#60;/li&#62;
&#60;/ul&#62;
&#60;p&#62;     &#38;lt;/div&#38;gt;&#60;/p&#62;
&#60;p&#62;	&#38;lt;?php }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;add_action('thematic_sidebar','studioIQ_sidebar_profilo');&#60;/p&#62;
&#60;p&#62;?&#38;gt;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
