Hi Everyone,
I have edited a sidebar widget plugin to suite my requirements. I need to set variables on category page and fetch them on single post page. I tried cookies but its not working for me or I m doing it wrong. Following is the code please check it out:
if(is_single()) {
$this_category = get_category( $_COOKIE["cat_id_for_submenu"], false );
}
if(is_category()) {
setcookie("cat_id_for_submenu", $CAT_ID, time()+3600, "/", str_replace('http://www','',get_bloginfo('url')));
}
Please tell where i m wrong and also if there is any alternate way of doing this. If you need more info, let me know.
Thanks in Advance,
Nabeel