Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: global $variables in header not passed to body

After much hacking about I figured out the problem.

This post offered a clue:

https://bbpress.org/forums/topic/getting-bbpress-and-wordpress-to-talk-to-each-other?replies=6#post-6068

It turns out that any global variables declared or set in header.php must also be set in the calling page. I added the following to the top of front_page.php and now the variables are properly set after calling bb_head().

<?php global $research_subscriber; // ‘1’ if user is research subscriber

global $forums_subscriber; // ‘1’ if user is forums subscriber

?>

The global variables don’t need to be set in the calling page in wordpress (single.php, search.php). I have no idea why bbpress handles this differently – must be in the way the header is called.

Much frustration. I hope someone finds this post useful.

Skip to toolbar