Support » Fixing WordPress » wp-blog-header.php

  • 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 - 1 through 15 (of 40 total)
  • Sometimes. Depends on what you’re trying to do, your host, and what other wp-specific stuff you put where.

    Just calling wp-blog-header.php should do it; of course if your external file is in another directory you’ll need to change the path to wp-blog-header.php to reflect that.

    And that won’t work at all if the file you want to call is on a different domain….

    As I said….

    That’s what i thought. I am trying to integrate a php page into my existing theme. I have no host, meaning i run the server and the WP install is at /doc_root and the php i am trying to integrate is at /doc_root/forum. I have made the path change in wp-blog-header.php to ../wp-blog-header.php. All are on the same domain. This is really strange why i can not get this php to integrate into my theme.
    When i include require(‘../wp-blog-header.php’); in between the opening < ? php and ending ? >, i get this error:
    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206
    Wehn i put < ? require(‘wp-blog-header.php’); ? > in between the < head > tags, i get this error:
    Parse error: parse error in /srv/www/htdocs/forum/themes/head.php on line 11
    but it does show some of the page. Check it here:
    http://www.mytimewithgod.net/forum

    Yah, that IS weird. Is something maybe screwy in your conf file?

    Maybe try hard-linking the wp-blog-header.php addy?

    OK, that took the error away but it has to be outside of the beginning < ? php otherwise, the // of ‘http:// comment out the rest of the hard-coded addy.
    Now when i add the call to get the header, i get this:
    Notice: Undefined variable: current_template_dir in /srv/www/htdocs/forum/themes/head.php on line 6

    Fatal error: Call to undefined function: get_bloginfo() in /srv/www/htdocs/wp-content/themes/bloxpress2/functions.php on line 20

    Hmmm. That still sounds like something wonky in httpd.conf. You shouldn’t be getting that as a comment. Are you using the right combo of single and double quotes?

    [Mind, I’m fishing here, because I haven’t done this in dogs’ years….]

    I think so, i am using ” and not ‘ (actually tried both and got that worked out). Now i get this error when < ? php include(‘http://dnsaddress.com/wp-content/themes/themname/functions.php’); ? >
    Fatal error: Call to undefined function: get_bloginfo() in /srv/www/htdocs/wp-content/themes/bloxpress2/functions.php on line 20
    I have made it further than before so i thank you for that 🙂
    I can post my httpd if needed.

    Okay…. um. Are you USING functions.php for something? And what’s your line 20 in that file?

    [If you post it tonight, hopefully someone else will have some ideas after looking it over – I’m about ready to be gone (had roofers here all day yesterday and today, as well as nasty t’storms – the noise has done me in!) I’ll check tomorrow, maybe someone brighter than me will be along beforehand – LOTS of those around!]

    Yes, using a functions.php file in the theme folder. Here is line 20 of said file:
    define( ‘BP_BASEURL’, get_bloginfo( ‘template_directory’ ) );
    Thanks for the help.

    Just checking if anyone can help me?

    Why are you directly including the functions.php file, and where are you doing it? Your theme’s functions.php file will be automatically included.

    Not sure why and where? What i do know is when i put in the call to get header (< ? php bp_get_header(); ? >) or anyother call to get sidebar, header or footer and the call is outside the opening < ? php, then it returns this error:
    Fatal error: Call to undefined function: bp_get_header() in /srv/www/htdocs/forum/themes/head.php on line 3
    So, i thought i would try to hardcode the functions.php into the file being integrated (which is head.php). Not sure if this answered your question?

    You don’t need to include *anything* but the wp-blog-header file. Really. That loads everything you need, including the WordPress theme’s functions.php file.

    The real question here is what in the heck is “bp_get_header()”? That is not a WordPress function. If it’s something in the WordPress theme’s functions.php, then it will get loaded as well, as long as you have WordPress setup to actually use that theme.

    It sounds like you’re making this a lot more complicated than it really is. Does the blog itself actually work? If not, solve those problems first before trying to integrate it into something else.

    That is what i thought. I use a theme called bloxpress 2 and bp_get_header()is that themes call to get the header and sidebar and footer. It is in the WordPress theme’s functions.php; hnce the reason i was including it in the head.php file but even when i dont include it, i get the above error. The theme is active and it is a WP theme.
    Of course the blog works. I will be happy to send you the file i am trying to integrate so you could look at it, since i am making things harder than they are it might be easier if you look at it.

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