Hey,
I'm having a real problem passing variables from page to page in wordpress. I have tried to enable sessions in wordpress by placing the following into functions.php of my theme:
function cp_admin_init() {
if (!session_id())
session_start();
}
I then add this in my header:
$_SESSION['mykeyword'] = $_GET['keyword'];
What I'm trying to do is save the keyword, which is appended to a url, to the session and pass it around the website.
So, I send users to a URL like this: domain.com/home?keyword=testing.
When they land on the page everything works. I echo the session variable to test and it appear on the screen.
However, as soon as I move to another page that variable is lost. I've printed the entire session (Print_r ($_SESSION);) and the "mykeyword" empties it self as soon as I change page.
Am I missing something obvious?
Many thanks inadvance!
Steven