I need to apply a bit of existing functions.php code to another page in a Thematic child theme on WordPress. With my level of understanding, I don't see how this code targets a the current page, so I'm having trouble targeting the new page. Here's what I have.
function show_popup($content) {
global $post;
$location = get_post_meta($post->ID, 'location', TRUE);
if (strtolower($l) == strtolower($location) || strlen($location) == 0 || (isset($_COOKIE["Location"]) && strtolower($_COOKIE["Location"]) == strtolower($location))) {
return $content;
} else {
?>
<div id="popup">
<p>foo</p>
<p>Continue?</p>
<form action="<?php echo $PHP_SELF ?>" method="post">
<input type="hidden" name="location" value="<?php echo $location; ?>" />
<input type="submit" name="confirm" value="Yes" />
<input type="submit" name="deny" value="No" />
</form>
</div>
<?php
}
}
add_filter('the_content', 'show_popup');
Do I need to dig into the SQL or is there something I'm overlooking in the PHP? Any guidance on the subject would be greatly appreciated.