Info
- 3 posts
- 2 voices
- Started 3 years ago by irr1449
- Latest reply from irr1449
- This topic is resolved
vars set in forum.php not holding value
-
- Posted 3 years ago #
I'm grafting a lot of existing functionality from my site onto bbPress.
In forum.php I load a bunch of data from my own database and sit it in variable. Lets call one of these variables $blah.
I'm trying to access $blah in the template file "post-form.php" so that I can include the value of $blah in a hidden field that gets posted.
My issue is that $blah is empty when I try and output its content in post-form.php. I'm positive this had nothing to do with naming of the variable. I don't see any reason why it should be empty. I've tried making it global but no luck. The post-form.php file is displayed on the same page as forum.php so I'm really lost.
Is there a better way to add persistent data that you can access across bbPress?
-
- Posted 3 years ago #
The first thought I had is to make a functions.php file, and put the variables in there. Or a plugin would probably do it, where the variables are defined and then can be called from.
-
- Posted 3 years ago #
Fixed by adding the variable I want the templates to use as global in bb_load_template of the template_functions file.
-
You must log in to post.