Support » Fixing WordPress » Incorporating WordPress and Gallery

  • I converted from MT to WordPress. Back when I set up MT, Gallery was skinned to use the same look and feel. I’m trying to get WordPress/Gallery integrated in the same way. You can see my wordpress site at The Gallery is running at At first glance it might seem that Gallery and WP are running together, but in reality it’s still embedded with Movable Type.
    The question is this: when I change my gallery/html_wrap/gallery.header and footer files to use the WordPress headers, suddenly Gallery no longer functions. I get this error message:
    “Fatal error: Call to a member function on a non-object in /home/ronrapp/public_html/wp-includes/wp-l10n.php on line 37”
    Can anyone help?

Viewing 12 replies - 1 through 12 (of 12 total)
  • It’s because it’s looking for a file that’s at but because you included it in gallery, it’s looking for it at Which begs the question: if you just want them to look alike, why are you including the wp header file? If you want them to look alike, just change the stylesheet. The WP header does nothing to affect the look of a site.
    WP is NOT MT. Don’t assume that headers from MT are the same as headers from WP.

    Ron – did you ever find a solution? I have the EXACT same problem integrating Gallery and WordPress 1.2.
    Stumped in Memphis

    As long as your include wp-config.php you can use any WordPress function.

    No, I still have not found an answer to this issue. I’ve searched high and low for an answer, queried PHP experts, WordPress folks, searched Google, and so on.
    All the suggestions I’ve received have been WAY off the mark (like ‘just include the wp-blog-header.php file, it’s easy’). This leads me to believe I’m not explaining the issue properly.
    I’m sure the issue has something to do with calling the wp-blog-header.php file from a directory several levels below where it normally gets called from. The obvious answer is to just use an absolute path for the include, and that’s the very first thing I tried.
    Anyway, I believe this to be the issue because wp-l10n.php gets used in every other WordPress dynamically generated page (it’s included in the wp-blog-header.php file) and it works fine.
    We can’t be the only ones trying to make Gallery and WordPress play together. Heck, Matt (of photomatt fame) uses Gallery himself. But if you look closely, you’ll see he does not display any wordpress data (comments, entry titles, etc) on the Gallery-powered pages. All Matt did was make the Gallery pages use the same stylesheet as the WordPress pages. Out of desperation, I emailed Matt to ask if he could assist but got no reply. I’m sure he’s probably too busy with serious coding to worry about this, but it’s a frustrating problem isn’t it? Gallery integrated with Movable Type with no problems.
    This has an answer. I just find it strange that no one has come up with it yet.
    Do we need to change the includes called from wp-blog-header.php so they are absolute? Should we have another version of the wp-blog-header.php file running from within the Gallery htmlwrap directory? I have no idea.

    The wp-config.php file only contains the code for accessing the database. The file doesn’t contain any of the actual WordPress code.
    What I want to do is have a list of recent comments and recent entries from my blog appear on my Gallery pages. This means having WordPress code running on the Gallery pages. How do I do that?

    Were you referring to having an alternate wp-blog-header.php version that excludes the wpl10n.php include but leaves the rest?
    I don’t think brian or i have made any changes to the blog header file.

    Ron – Allusion is the Matt 🙂
    Matt – thanks for a ubercool product.
    What is strange about this is that I can call the wordpress functions from other custom pages at least one level below root. See for an example. I am pulling the links menu on the left from WordPress.
    I have not tried this from two or more levels other than from Gallery. I will do a test tomorrow and see what happens.

    Ah, so he did answer. 🙂 My bad, Matt!!
    Ditto on the kudos from Brian for a fine product!
    Re: calling WordPress functions from a single level down, I’ve done that, too. I have some static pages that use the WordPress functions, like
    I just thought of another possibility. Gallery uses PHP. Any chance both packages are calling subroutines of the same name or something like that?

    I found a solution trying to solve this myself. If you do a :
    at the beginning of gallery’s init.php, your gallery can call any WP functions.
    Hope this helps,

    This one still doesn’t work for me. After including Hisham’s example in init.php, I get a simialr error:
    Fatal error: Call to a member function on a non-object in /home/www/wp-blog-header.php on line 234
    Any thoughts? I noticed Ron seems to have found a solution for his site…

    This is all because you try to include WP from a function’s scope !!

    Thanks to the anonymous person that pointed out it was due to including WP from a function’s scope. I’ve been hacking spgm to sit nicely inside WP, and this problem was driving me up the wall. Moving the require_once(‘./wp-blog-header.php’); line to the main part of my spgm.php file instead of inside the gallery showing function made my WP header appear correctly.

    Who is that masked man/woman? Thanks, anyway 🙂

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Incorporating WordPress and Gallery’ is closed to new replies.