<?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: Targeting a new page with functions.php location cookie</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sun, 19 May 2013 14:20:37 +0000</pubDate>

<item>
<title>diana on "Targeting a new page with functions.php location cookie"</title>
<link>http://themeshaper.com/forums/topic/targeting-a-new-page-with-functionsphp-location-cookie#post-19296</link>
<pubDate>Sun, 20 Feb 2011 20:49:27 +0000</pubDate>
<dc:creator>diana</dc:creator>
<guid isPermaLink="false">19296@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;BTW, functions.php also contains: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if (isset($_POST[&#38;#39;confirm&#38;#39;]) &#38;#38;&#38;#38; isset($_POST[&#38;#39;location&#38;#39;])) {
	setcookie(&#38;quot;Location&#38;quot;, $_POST[&#38;#39;location&#38;#39;], time()+3600);  /* expire in 1 hour */
}
elseif (!isset($_COOKIE[&#38;quot;Location&#38;quot;])) {
	setcookie(&#38;quot;Location&#38;quot;, &#38;quot;&#38;quot;, 1);
}
elseif (isset($_POST[&#38;#39;deny&#38;#39;])) {
	setcookie(&#38;quot;Location&#38;quot;, &#38;quot;&#38;quot;, 1);
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>diana on "Targeting a new page with functions.php location cookie"</title>
<link>http://themeshaper.com/forums/topic/targeting-a-new-page-with-functionsphp-location-cookie#post-19290</link>
<pubDate>Sat, 19 Feb 2011 23:08:56 +0000</pubDate>
<dc:creator>diana</dc:creator>
<guid isPermaLink="false">19290@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I need to apply a bit of existing functions.php code to another page. With my level of understanding, I don't see how this code targets a particular page, so I'm having trouble targeting the new page. Here's what I have.  &#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
function show_popup($content) {&#60;br /&#62;
	global $post;&#60;br /&#62;
	$location = get_post_meta($post-&#38;gt;ID, 'location', TRUE);&#60;br /&#62;
	if (strtolower($l) == strtolower($location) &#124;&#124; strlen($location) == 0 &#124;&#124; (isset($_COOKIE[&#34;Location&#34;]) &#38;#38;&#38;#38; strtolower($_COOKIE[&#34;Location&#34;]) == strtolower($location))) {&#60;br /&#62;
		return $content;&#60;br /&#62;
	} else {&#60;br /&#62;
		?&#38;gt;&#60;br /&#62;
		&#38;lt;div id=&#34;popup&#34;&#38;gt;&#60;br /&#62;
	&#38;lt;p&#38;gt;foo.&#38;lt;/p&#38;gt;&#60;/p&#62;
&#60;p&#62;	&#38;lt;p&#38;gt;Continue?&#38;lt;/p&#38;gt;&#60;br /&#62;
	&#38;lt;form action=&#34;&#38;lt;?php echo $PHP_SELF ?&#38;gt;&#34; method=&#34;post&#34;&#38;gt;&#60;br /&#62;
	&#38;lt;input type=&#34;hidden&#34; name=&#34;location&#34; value=&#34;&#38;lt;?php echo $location; ?&#38;gt;&#34; /&#38;gt;&#60;br /&#62;
	&#38;lt;input type=&#34;submit&#34; name=&#34;confirm&#34; value=&#34;Yes&#34; /&#38;gt;&#60;br /&#62;
	&#38;lt;input type=&#34;submit&#34; name=&#34;deny&#34; value=&#34;No&#34; /&#38;gt;&#60;br /&#62;
	&#38;lt;/form&#38;gt;&#60;br /&#62;
	&#38;lt;/div&#38;gt;&#60;br /&#62;
		&#38;lt;?php&#60;br /&#62;
	}&#60;br /&#62;
}&#60;br /&#62;
add_filter('the_content', 'show_popup');&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Do I need to dig into the SQL or is there something I'm overlooking?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
