Support » Fixing WordPress » Call to a member function main() on a non-object

  • I’m trying to use wordpress for my site, however I just want to use the back end for users to edit my content and completely customize the front end. Rather than editing templates, I want to include wordpress in one of my classes and basically remove the wordpress header/footer.

    I’m new to wordpress, so anyone else’s experience or feedback on how I’m doing this would be greatly appreciated.

    class GamerSourceApplicationSiteArticleView extends GamerSourceApplicationSitePage {
    	/* Public Functions
    	function authenticate () {
    		return true;
    	function show () {
    		 * Front to the WordPress application. This file doesn't do anything, but loads
    		 * wp-blog-header.php which does and tells WordPress to load the theme.
    		 * @package WordPress
    		 * Tells WordPress to load the WordPress theme and output it.
    		 * @var bool
    		define('WP_USE_THEMES', true);
    		/** Loads the WordPress Environment and Template */
    		// end word press
    //..... class continues, but this is the only function that "shows" content

    Through doing that, I originally had an error with set_prefix because $wpdb was not global. So I changed my wp-settings.php to global it and it works. However I”m now receiving the following error:

    Fatal error: Call to a member function main() on a non-object in C:\wamp\www\gamer-source\author\wp-includes\functions.php on line 1111

    Line 1111 is `function wp( $query_vars = ” ) {
    global $wp, $wp_query, $wp_the_query;
    $wp->main( $query_vars ); //line 1111

    if( !isset($wp_the_query) )
    $wp_the_query = $wp_query;

    Any thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call to a member function main() on a non-object’ is closed to new replies.