Forums

New theme equals fatal error- Please help (8 posts)

  1. meridebikes
    Member
    Posted 2 years ago #

    I recently installed a new theme to my blog and when I try to activate it I get a blank white screen with the following error message:

    Fatal error: Call to undefined function: body_class() in /nfs/c02/h05/mnt/15577/domains/ridegiantbmx.com/html/blog/wp-content/themes/vigilance/header.php on line 38

    I can go back to my old theme, and the classic wordpress themes that are already loaded in my directories work fine, but this new one won't load.

    How can i determine what the error is, or what "line 38" is?

    I've researched other posts, and tried reloading the theme manually, deactivating any plugins, but now I'm stumped.

    If someone can please help me out and explain as SIMPLY and STEP BY STEP as possible I would really appreciate it as I am no computer wiz and have been teaching myself as I go.

    Thank you!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    it's telling you exactly where to look

    line 38 of header.php in vigilance theme

    You can peep that line for errors, post the code up here, or just try another theme

  3. meridebikes
    Member
    Posted 2 years ago #

    Update-
    I believe I found line 38 in my directories, just not sure how to proceed:
    <body <?php body_class(); ?>>

  4. meridebikes
    Member
    Posted 2 years ago #

    Complete code if this helps at all..

    <?php global $vigilance; ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <?php if( is_front_page() ) : ?>
    <title><?php bloginfo('name'); ?></title>
    <?php elseif( is_404() ) : ?>
    <title><?php _e('Page Not Found |', 'vigilance') ?> <?php bloginfo('name'); ?></title>
    <?php elseif( is_search() ) : ?>
    <title><?php printf(__ ("Search results for '%s'", "vigilance"), attribute_escape(get_search_query())); ?> | <?php bloginfo('name'); ?></title>
    <?php else : ?>
    <title><?php wp_title($sep = ''); ?> | <?php bloginfo('name');?></title>
    <?php endif; ?>

    <!-- Basic Meta Data -->
    <meta name="copyright" content="Vigilance Theme Design: Copyright 2008 - 2009 Jestro LLC" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <?php if((is_single() || is_category() || is_page() || is_home()) && (!is_paged())){} else {?>
    <meta name="robots" content="noindex,follow" /><?php } ?>

    <!-- Favicon -->
    <link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/images/favicon.ico" />

    <!--Stylesheets-->
    <link href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" rel="stylesheet" />
    <!--[if lt IE 8]><link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_url'); ?>/stylesheets/ie.css" /><![endif]-->
    <!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_url'); ?>/stylesheets/ie6.css" /><![endif]-->

    <!--Wordpress-->
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <!--WP Hook-->
    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    <div id="wrapper">
    <div id="header" class="clear">
    <?php if (is_home()) echo('<h1 id="title">'); else echo('<div id="title">');?>"><?php bloginfo('name'); ?><?php if (is_home()) echo('</h1>'); else echo('</div>');?>
    <div id="description">
    <h2><?php bloginfo('description'); ?></h2>
    </div><!--end description-->
    <div id="nav">

      <?php if ($vigilance->hideHome() !== 'true') : ?>
      <li class="page_item <?php if (is_front_page()) echo('current_page_item');?>">"><?php _e('Home', 'vigilance') ?>
      <?php endif; ?>
      <?php if ($vigilance->hidePages() !== 'true') : ?>
      <?php wp_list_pages('title_li=&depth=1&exclude='. $vigilance->excludedPages()); ?>
      <?php endif; ?>
      <?php if ($vigilance->hideCategories() != 'true') : ?>
      <?php wp_list_categories('title_li=&depth=1&exclude=' . $vigilance->excludedCategories()); ?>
      <?php endif; ?>

    </div><!--end nav-->
    </div><!--end header-->
    <div id="content" class="pad">
    <?php if (is_file(STYLESHEETPATH . '/header-banner.php')) include(STYLESHEETPATH . '/header-banner.php'); else include(TEMPLATEPATH . '/header-banner.php'); ?>
    <?php if (is_front_page()) : ?>
    <?php if (is_file(STYLESHEETPATH . '/header-alertbox.php')) include(STYLESHEETPATH . '/header-alertbox.php'); else include(TEMPLATEPATH . '/header-alertbox.php'); ?>
    <?php endif?>

  5. meridebikes
    Member
    Posted 2 years ago #

    If anyone can point me in the right direction I'd appreciate it!

  6. wpthemess
    Member
    Posted 2 years ago #

    Hi the error line 38 is here <body <?php body_class(); ?>> body_class funtion not found your theme and than theme getting error. you can comment this line <body <?php //body_class(); ?>> and than can try to work that theme. your theme will be probably work but where you must find this class.

  7. meridebikes
    Member
    Posted 2 years ago #

    I'm sorry but I'm having a hard time understanding your post.

  8. wpthemess
    Member
    Posted 2 years ago #

    Hi please delete <?php //body_class(); ?>> after the
    </head>

    <body <?php body_class(); ?>> remove <?php body_class(); ?> in the body

    you can try this
    <body>

    and let me know..

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.