• OK, can someone answer me this: to integrate external pages into your existing WP theme—add < ? php require(‘./wp-blog-header.php’); ? > to the external php file and of course make a call to the WP sidebar, header and footer? Does this not integrate a php file with your WP theme?

Viewing 15 replies - 16 through 30 (of 40 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Okay then, your bp_get_header() call must come after the bit where you include the wp-blog-header.php file. That’s really the most important thing here, the wp-blog-header must happen first. I’d just put that at the top of every file you need it in with a require_once() call.

    Thread Starter carnold

    (@carnold)

    Yep, that is the way i have it (so you can see it is not me making this harder than it seems). At the top of head.php i have:
    < ? php require_once(‘http://addy.com/wp-blog-header.php&#8217;); ? >
    then
    < ? php bp_get_header(); ? > and here is the error:
    Fatal error: Call to undefined function: bp_get_header() in /srv/www/htdocs/forum/themes/head.php on line 3
    You can see for yourself here http://www.mytimewithgod.net/forum

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Whoa, you can’t put in the full URL for a require like that. That very likely will not work at all.

    You either need to use a relative location, like “../wp-blog-header.php” or the full path, like “/home/users/you/whatever/wp-blog-header.php”. Using the http stuff definitely will not work.

    If you get other errors from doing that, then we need to solve those errors. You can’t work around them that way. All that does is not actually include the blog at all, which is why it appeared to solve your earlier problems.

    You probably need to use the server path, not the web path in your require call. I.e not

    require_once('http://addy.com/wp-blog-header.php');

    but rather something like

    require_once('/srv/www/htdocs/wp-blog-header.php');

    [EDIT: Otto42 beat me to the draw]

    Also, this post makes me think you might have another problem, because you seem to be including the functions.php file in the themname theme, but your active theme seems to be bloxpress2, judging from the error message.

    Thread Starter carnold

    (@carnold)

    The functions.php file is no longer included in the themname theme,

    Thread Starter carnold

    (@carnold)

    Alright, this is getting funny, lol. Here is the reason i did the full url:
    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206
    when i have /srv/www/htdocs/wp-blog-header.php
    When it is hard coded with the full url, i do not get any errors. Of course, none of the sidebar, header or footer load either.

    It might be possible that your forum software has a variable named $wpdb, which is messing up the WordPress object $wpdb. Or have you changed the wp-includes/wp-db.php file at all?

    Thread Starter carnold

    (@carnold)

    I have not changed that file at all, as far as i can remember.
    I also grep’ed thorugh the folders and files in /forum and $wpdb was not found in the forum software

    What version of WordPress are you using? And what’s on line 206 of /srv/www/htdocs/wp-includes/cache.php ?

    Thread Starter carnold

    (@carnold)

    Using 2.0.4 of WP. Line 206 of /srv/www/htdocs/wp-includes/cache.php:
    if (‘options’ == $group) {
    Line 205 else
    Line 207 $wpdb->hide_errors()

    You’re sure that within the forum directory you’re not requiring anywhere else any other WordPress file than “wp-blog-header.php”?

    That just doesn’t make any sense: before WP calls the functions in cache.php, it’s already used the $wpdb object multiple times, so I don’t understand why it suddenly becomes a “non-object.”

    Thread Starter carnold

    (@carnold)

    The only other file i have modified was people.php, and this error was happening before i even found that file. I modd’ed that one to see if i was doing it right http://www.mytimewithgod.net/forum/people.php
    The head.php is the only other file that has been modified. And in that file i only have wp-blog-header.php, no functions.php nothing else (besides < ? php bp_get_header(); ? >). I can “undo” the people.php file, if you like but i assure you, this error was happening way before i modd’ed the people.php file. I can also send you the 2 files in question or grant direct access to the files.
    */Edit*
    Hmmmm, at the bottom of the people.php page, i see this:
    Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /srv/www/htdocs/wp-includes/wp-db.php on line 161
    But i can logon and navigate around without any problems. Weird

    I’ll look at anything you want to send me at if.website at gmail dot com.

    [EDIT: well, that might be your problem: connecting to the db server. If wp-db.php fails instantiate wpdb, then you’ll get the other error.]

    Thread Starter carnold

    (@carnold)

    OK, i extracted the forum software into a new forum folder. Now, no errors occur. Same error occurs from a fresh extract
    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206
    And no other files have been modd’ed

Viewing 15 replies - 16 through 30 (of 40 total)
  • The topic ‘wp-blog-header.php’ is closed to new replies.