Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 1.5.1.2 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">
                <ul>
                    <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' ) ?>
                        <select>
                            <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' ) ?>
                        </select>
                    </li>
                </ul>
            </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?

share|improve this question
    
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
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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