bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Cannot call WP functions inside BB, followed docs instructions...

(6 posts)
  • Started 1 year ago by csl749
  • Latest reply from csl749
  • This topic is resolved
  1. Hi folks,

    I have WP and BB running off the same DB, integrating users etc as far as I can tell, and each working perfectly. But, following the instructions on the docs page on how to integrate WP functions so they can be called in BB, I get errors.

    I put the require_once('www.mywebsite.com/wp-blog-header.php'); at the top of the BB config.php, in the hope that the WP functions would be discovered, but each time I try to add, say, a line to front-page.php like get_header or get_footer, to visually sandwich BB inside my WP header/footer, I get an error:

    Fatal error: Call to undefined function: get_header() in /home/csleary/public_html/forum/my-templates/lemodie/front-page.php on line 1

    I'm very much a novice with all this, so I'm just following instructions at the moment hoping things will work. But as far as I can tell I've done everything correctly - please may someone offer some ideas as to what's going wrong? While searching other integration threads, I came across one that said to make sure WP was loaded first, so BB could then load the functions, but I don't know how to ensure this. BB is currently in siteroot/forum, and wordpress is in the root dir itself.

    Any help would be fantastic, thanks.

    Posted 1 year ago #
  2. Perhaps it'll be less trouble if i just recreate the style of my WP site separately.

    Posted 1 year ago #
  3. I think require_once (or require, include or include_once for that matter) need a path to the file rather than a URL. A path would be like the addresses you get when you're browsing folders on your computer. I can't say what your path would be, but mine is /home/username/public_html/wordpress/wp-config.php. Ask your hosting provider if you don't know what to use. :)

    It might be easier to recreate the theme anyway, if I remember rightly a fair few folks come here with problems when trying to stick bb into the WP theme like that.

    Posted 1 year ago #
  4. Ah - thank you for the hint, that makes sense. I've been tinkering with the theme to try and get it to look like the original site, but I'll try this too, adding a path rather than URL. Thanks!

    Posted 1 year ago #
  5. Hmm. I tried the path (it's thrown up in the error anyway so I assume it's the correct path!) but it's still not working, providing me with an error.

    Everything works anyway, as I built the forum theme up around the main site, but it'd be nice to know that I could call BB and WP functions if I wanted, without worrying. Oh well...

    Thanks very much for the kind help though Fel64! :)

    Posted 1 year ago #
  6. Found the problem - I had to chmod wp-blog-header so it could be executed. Oops!

    So I can now call wp functions from bb. If I want bb functions in wp, do I just do a similar thing in wordpress?

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.