how to get title of viewed page
-
I want check with each page request if the page has changed.
I am using wp_title for it. I am saving the title in a session variable $_SESSION:
$biq_title = wp_title('',false); if ( $biq_title == '' ) $biq_title = 'Home'; if ( $_SESSION['biq_last_title'] ) { // check if page has changed $biq_last_title = $biq_title; if ( $_SESSION['biq_last_title'] == $biq_last_title ) return false; else { $_SESSION['biq_last_title'] = $biq_title; return true; } } else $_SESSION['biq_last_title'] = $biq_title; return true;
the session variable looses its value and contains a ‘page not found’.
If the session variable looses its value I would expect a NULL value, but how it gets the ‘page not found’????
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘how to get title of viewed page’ is closed to new replies.