I've run into this error today and I can't find anyway to get past it.

Fatal error: Call to undefined function get_header() in /members/index.php on line 1

The site is running WP 3.2.1 and BuddyPress 1.2.9 and uses the Arras theme. The error only appears on the BuddyPress index page (http://towermix.com/home/members), but the rest of the site and the other parts of BuddyPress work as advertised. I've looked at that index.php file, which is came from the BuddyPress Template Pack plugin (and makes any theme BuddyPress compatible) and it's nothing unusual for a theme header call. Here's the file:

<?php get_header() ?>

    <div id="content">
        <div class="padder">

        <form action="" method="post" id="members-directory-form" class="dir-form">

            <h3><?php _e( 'Members Directory', 'buddypress' ) ?></h3>

            <?php do_action( 'bp_before_directory_members_content' ) ?>

            <div id="members-dir-search" class="dir-search">
                <?php bp_directory_members_search_form() ?>
            </div><!-- #members-dir-search -->

            <div class="item-list-tabs">
                    <li class="selected" id="members-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_member_count() ) ?></a></li>

                    <?php if ( is_user_logged_in() && function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
                        <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_FRIENDS_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
                    <?php endif; ?>

                    <?php do_action( 'bp_members_directory_member_types' ) ?>

                    <li id="members-order-select" class="last filter">

                        <?php _e( 'Order By:', 'buddypress' ) ?>
                            <option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
                            <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ) ?></option>

                            <?php if ( bp_is_active( 'xprofile' ) ) : ?>
                                <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
                            <?php endif; ?>

                            <?php do_action( 'bp_members_directory_order_options' ) ?>
            </div><!-- .item-list-tabs -->

            <div id="members-dir-list" class="members dir-list">
                <?php locate_template( array( 'members/members-loop.php' ), true ) ?>
            </div><!-- #members-dir-list -->

            <?php do_action( 'bp_directory_members_content' ) ?>

            <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ) ?>

            <?php do_action( 'bp_after_directory_members_content' ) ?>

        </form><!-- #members-directory-form -->

        </div><!-- .padder -->
    </div><!-- #content -->

    <?php locate_template( array( 'sidebar.php' ), true ) ?>

<?php get_footer(); ?>
  • So far, I've reinstalled the 3.2.1 update from Dashboard - no change.
  • I copied the /members/index.php from another site (that's working fine) - no change
  • I deactivated, then reactivated BuddyPress - no change
  • I added the semi-colon after the () - no change
  • I uploaded and overwrote the wp-admin and wp-includes folder - no change.

What's truly bizarre - I even commented that line out and I still get the same error. There are no caching plugins installed. I flushed my browser cache, so that's not it.

Any ideas?

  • You're missing the trailing ; on get_header() ... Also: If you're providing ressources like themes: Link them. And: Please care about formatting. The "nochange: etc." is hard to read. How about a list? – kaiser Sep 27 '11 at 16:58
  • Thanks kaiser. Sorry about the non-list bit there. I typed it as a list and it didn't publish that way. Here's the theme: arrastheme.com/forums/post30693.html#p30693. I also formatted the list. Adding the ; after the get_header call makes no difference. What's odd is that same code (without the semi-colon) works on every page on the site except this one. – Slushman Sep 27 '11 at 20:06
  • As usual: Try deactivating all plugins, then use the theme without modifications. After that, activate one plugin, reload, activate another one, etc. until you know what's causing the error. When nothing is causing it, move your changes bit by bit into your modified theme. Btw: The Link to the theme should be moved to the Q. – kaiser Sep 28 '11 at 0:28

Not sure what the problem, but I moved the site to a new web host and all is well. It's resolved, but I really wish I knew what caused the weirdness to begin with, in case I run into it again. Thanks for your help, kaiser.

Not the answer you're looking for? Browse other questions tagged or ask your own question.