WordPress.org

Forums

Calling WordPress header file from another directo (7 posts)

  1. ronrapp
    Member
    Posted 11 years ago #

    Let me try this again. :)
    My WP root directory is /home/ronrapp/public_html/
    If I'm trying to call the WP header from a different location, say a file at /home/ronrapp/gallery/html_wrap/gallery.header
    why would I be receiving 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"
    I have made sure I'm calling the WP header file using an absolute path, so that's not the issue.
    Anyone?

  2. arghnoname
    Member
    Posted 11 years ago #

    I used a relative path with mine.
    I have an archive for my templates, so my main stuff is in the root, and I have old index.php's saved in a directory called /oldnews
    so now for the stuff in old news i just added a dot. My header-call says it's in ../wp-includes instead of ./wp-includes, and it seems to work. Maybe try hunting in that direction.

  3. OperaManiac
    Member
    Posted 11 years ago #

    relative path works on my homepage too. i am directly calling the database in place of rss syndication :)

  4. ronrapp
    Member
    Posted 11 years ago #

    Thanks for the suggestion. I tried using a relative path: require('../wp-blog-header.php');
    It came up with the same error:
    Fatal error: Call to a member function on a non-object in /home/.furcatheaterheater/ronrapp/public_html/wp-includes/wp-l10n.php on line 37

  5. ronrapp
    Member
    Posted 11 years ago #

    For what it's worth, it always refers to line 37 of wp-l10n.php, which is this section:
    // Return a translated string.
    function __($text) {
    global $l10n;
    return $l10n->translate($text);

  6. ronrapp
    Member
    Posted 11 years ago #

    Anyone have any ideas on this?? I've tried searching Google, the support forums here, mosquito, etc. I've tried changing the path from absolute to relative, it doesn't work. I've also checked to make sure there are no extra carriage returns in there, as I know that sometimes plays havoc.
    Perhaps one of the developers could chime in with an idea?

  7. ronrapp
    Member
    Posted 11 years ago #

    Here's some more info:
    I'm trying to call the wp-blog-header.php file from /WProot/gallery/
    That directory has it's own .htaccess file (used to make Gallery work properly). Any chance this could be causing the "Fatal error: Call to a member function on a non-object in /home/ronrapp/public_html/wp-includes/wp-l10n.php on line 37" error?
    # BEGIN Gallery section
    # (Automatically generated. Do not edit this section)
    # Note: still under development, so format may change.
    # If you edit this file, make a backup before runnng the Config. Wizard.

    Options -Indexes +FollowSymLinks
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /gallery/
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^\.\?/]+)/([0-9]+)$ /gallery/view_photo.php?set_albumName=$1&index=$2 [QSA]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$ /gallery/view_photo.php?set_albumName=$1&id=$2 [QSA]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^\.\?/]+)/$ /gallery/$1 [R]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^\.\?/]+)$ /gallery/view_album.php?set_albumName=$1 [QSA]
    </IfModule>
    # END Gallery section. Add User changes below this line

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.