Skip to:
Content
Pages
Categories
Search
Top
Bottom

vars set in forum.php not holding value

  • @irr1449

    Member

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @ipstenu

    Moderator

    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.

    @irr1449

    Member

    Fixed by adding the variable I want the templates to use as global in bb_load_template of the template_functions file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar