What if you captured the post ID in your single-footer.php, like this:
[php]
global $post;
$thisid = $post->ID;
Then, in the shortcode or function (your launch code) where you include the form, pre-populate the page ID in a hidden field. Would that work for you?
I just tried it here:
http://gravity.chrishajer.com/2012/08/22/map-to-fun/
I added this code to my footer.php:
[php]
<?php
global $post;
$thisid = $post->ID;
echo "<!-- You are on page " . site_url() . "/?p=" . $thisid . " -->";
?>
If you look in the source of that page, you will see the HTML comment:
[html]
<!-- You are on page http:// gravity. chrishajer. com/?p=870 -->
This code will work fine on a single page (like where your single-footer.php is likely in use.) It would not return the correct value when used on an index page or archive page, due to the loop.
Posted 12 years ago on Monday October 15, 2012 |
Permalink