|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by gagnonconsulting in WordPress, Blogs, Web Development
I have added the following code to the beginning of my header.php file so I can redirect the page if the 'direct_jump' metapost data value is set. That part works (with the print and header statements commented appropriatly), but I have found that often the $post->ID value is incorrect, and it will jump to the redirect page when it is not supposed to. It looks like the $post array is not getting cleared or set correctly when I go to some pages, including the home page and the main category page of the posts. Any ideas on how to proceed?
1:
2:
3:
4:
5:
6:
7:
8:
|
$thisPost = $post -> ID;
$gotoURL = '';
$gotoURL = get_post_meta($thisPost, 'direct_jump', true);
if ($gotoURL != '') {
print ("thisPost = $thisPost, ");
print ("header('Location: $gotoURL');");
//header('Location: '.$gotoURL);
}
|
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625