Fatal error: Call to a member function display() on a non-object in theme_config.php

I have this website that was working perfectly, but today all of the sudden I open it and nothing shows up. So I went and enabled WP_DEBUG and I got this fatal error.

“Fatal error: Call to a member function display() on a non-object in /home/Mywebsite/public_html/wp-content/themes/medica-parent/theme_config/config/theme_config.php on line 12”

Read More

I have no Idea what it means. I can’t even access the Website.com/wp-login.php. I even disabled every plugin from the database but that didn’t help.

Can you guys please help me out here. I’m sorry I’m new to WordPress.

Here is the code from that file.

<?php
/**
* Generate theme details
*/
global $wp_version;
if(version_compare('3.3.2',$wp_version,'>=')) {
    $theme_info = get_theme_data(TEMPLATEPATH . '/style.css');
    $cfg['theme_version'] = $theme_info['Version'];
} else {
    $theme_info = wp_get_theme(null, WP_CONTENT_DIR . '/themes/');
    if ( is_child_theme() )
        $cfg['theme_version'] = $theme_info->parent()->display('Version');
    else
        $cfg['theme_version'] = $theme_info->display('Version');
}
$template_info = @get_theme_data(TEMPLATEPATH . '/style.css');

$cfg['theme_version'] = $template_info['Version'];
$cfg['mods_version'] = '2.0.8';
$cfg['theme_name'] = 'Medica';
$cfg['prefix'] = sanitize_title($cfg['theme_name']);
$cfg['author_name'] = 'ThemeFuse';
$cfg['theme_author'] = '<a target="_blank" href="http://themefuse.com">ThemeFuse</a> - ';
$cfg['forum_url'] = 'http://themefuse.com/forum/medica-wp/';
$cfg['manual_url'] = 'http://themefuse.com/wp-docs/medica/';

//$cfg['disabled_extensions'] = array('SLIDER');

$cfg['disabled_extensions'] = array();

$cfg['screen_options']['nav-menus'] = array('add-post','add-post_tag');

$cfg['install_options']['tax'] = array($cfg['prefix'] . '_homepage_category', 'categories_select');
$cfg['install_options']['pos'] = array('posts_select');

Related posts

Leave a Reply

1 comment

  1. I just had this problem and it bugged the hell out of me that I couldn’t find an answer!

    For me, it was caused by my style.css missing from my child theme directory. I had to change my stylesheet back to the parent version via phpMyAdmin in cPanel and that fixed it. Then I just had to create a new version of the child theme style.css in the child theme directory.