<?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: Filtering something - but only on specific pages.</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Thu, 09 Feb 2012 04:06:20 +0000</pubDate>

<item>
<title>djm on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4946</link>
<pubDate>Sun, 05 Jul 2009 20:11:13 +0000</pubDate>
<dc:creator>djm</dc:creator>
<guid isPermaLink="false">4946@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Cheers for the help anyway Chris :)
&#60;/p&#62;</description>
</item>
<item>
<title>Chris on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4943</link>
<pubDate>Sun, 05 Jul 2009 19:47:55 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid isPermaLink="false">4943@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;OK .. wasn't fast enough with my first post .. and can quit the second one :-)
&#60;/p&#62;</description>
</item>
<item>
<title>Chris on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4942</link>
<pubDate>Sun, 05 Jul 2009 19:45:24 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid isPermaLink="false">4942@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;works here ..&#60;/p&#62;
&#60;p&#62;home   - is_single: bool(false) is_home: bool(true) is_front_page: bool(true)&#60;br /&#62;
single - is_single: bool(true) is_home: bool(false) is_front_page: bool(false) &#60;/p&#62;
&#60;p&#62;.. code used:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function test_code() {
echo &#38;quot;is_single: &#38;quot;; var_dump( is_single() );
echo &#38;quot;is_home: &#38;quot;; var_dump( is_home() );
echo &#38;quot;is_front_page: &#38;quot;; var_dump( is_front_page() );}
add_action(&#38;#39;thematic_belowheader&#38;#39;, &#38;#39;test_code&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Chris
&#60;/p&#62;</description>
</item>
<item>
<title>djm on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4940</link>
<pubDate>Sun, 05 Jul 2009 19:34:00 +0000</pubDate>
<dc:creator>djm</dc:creator>
<guid isPermaLink="false">4940@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Aha, fixed this. Basically, Wordpress hasn't run query processing on the URL until after your theme has loaded - so if you run conditionals in functions.php: they will always return false.&#60;/p&#62;
&#60;p&#62;What you need to do is wrap your conditionals in a function and add that function to the 'wp' loader which runs after the URL query processing (and therefore will receive the correct returns on running the conditionals).&#60;/p&#62;
&#60;p&#62;So the above code would be:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function test_conditionals() {
    if( is_front_page() &#124;&#124; is_single() ) {
        add_filter();
    }
}
add_action(&#38;#39;wp&#38;#39;, &#38;#39;test_conditionals&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;More here under heading 'The Tricky Part': &#60;a href=&#34;http://w-shadow.com/blog/2009/02/22/make-your-plugin-faster-with-conditional-tags/&#34; rel=&#34;nofollow&#34;&#62;http://w-shadow.com/blog/2009/02/22/make-your-plugin-faster-with-conditional-tags/&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>djm on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4939</link>
<pubDate>Sun, 05 Jul 2009 19:33:01 +0000</pubDate>
<dc:creator>djm</dc:creator>
<guid isPermaLink="false">4939@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Dupe post, see below.
&#60;/p&#62;</description>
</item>
<item>
<title>djm on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4936</link>
<pubDate>Sun, 05 Jul 2009 19:15:12 +0000</pubDate>
<dc:creator>djm</dc:creator>
<guid isPermaLink="false">4936@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Yeh, they're all returning false which is what I don't get.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;echo &#38;quot;is_single: &#38;quot;; var_dump( is_single() );
echo &#38;quot;is_home: &#38;quot;; var_dump( is_home() );
echo &#38;quot;is_front_page: &#38;quot;; var_dump( is_front_page() );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;in the child themes functions.php returns false for all no matter what page of the site I am on; yet function_exists on all the method names returns true..&#60;/p&#62;
&#60;p&#62;Any ideas what could be going on?&#60;/p&#62;
&#60;p&#62;Cheers
&#60;/p&#62;</description>
</item>
<item>
<title>kari.patila on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4900</link>
<pubDate>Fri, 03 Jul 2009 11:25:39 +0000</pubDate>
<dc:creator>kari.patila</dc:creator>
<guid isPermaLink="false">4900@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I think I've used something like this before:&#60;/p&#62;
&#60;p&#62;if( is_front_page() &#124;&#124; is_single() ) {&#60;br /&#62;
add_filter();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Most likely one of those conditionals (is_home or is_single) is returning false for you. What do you get if you do either var_dump( is_single() );, var_dump( is_home() ); or var_dump( is_front_page() );
&#60;/p&#62;</description>
</item>
<item>
<title>djm on "Filtering something - but only on specific pages."</title>
<link>http://themeshaper.com/forums/topic/filtering-something-but-only-on-specific-pages#post-4898</link>
<pubDate>Fri, 03 Jul 2009 10:57:12 +0000</pubDate>
<dc:creator>djm</dc:creator>
<guid isPermaLink="false">4898@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;First off, thanks to Ian and Chris for their hard work on this framework, having a lot of fun making a theme for a new project of mine - which is nearly finished except for a few lil bits:&#60;/p&#62;
&#60;p&#62;I would like to filter a function but &#60;em&#62;only&#60;/em&#62; on the home indexing page and paginations of such and also on the single page.&#60;/p&#62;
&#60;p&#62;I have tried the following using Wordpresses' conditionals in functions.php with little effect (the filter function does work if I remove the if statements around it however).&#60;/p&#62;
&#60;p&#62;if is_home() or is_single() {&#60;br /&#62;
    add_filter('etc', 'etc');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Any pointers? Cheers.
&#60;/p&#62;</description>
</item>

</channel>
</rss>

