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.

Suddenly I got the message:

Parse error: syntax error, unexpected T_CLASS in /home/spandabe/public_html/wp-content/themes/modularity-lite/functions.php on line 72

when opening my site www.spandabel.dk

I only changed things in header.php, not in functions.php! And now I cannot do anything before I get this right!

This is how my functions-php looks like:

    <?php
/**
 * @package WordPress
 * @subpackage Modularity
 */

$themecolors = array(
    'bg' => 'eeeeee',
    'border' => 'eeeeee',
    'text' => '111111',
    'link' => '000000',
    'url' => '000000'
);
$content_width = 950; // pixels

// Grab the theme options page
require_once ( get_template_directory() . '/theme-options.php' );

// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );

// Add post thumbnail theme support
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150, true );

// Add a new image size
add_image_size( 'modularity-slideshow', 950, 425, true );

// Register nav menu locations
register_nav_menus( array(
    'primary' => __( 'Primary Navigation', 'text_domain' ),
) );

// Get wp_page_menu() lookin' more like wp_nav_menu()
function modularity_page_menu_args( $args ) {
    $args['show_home'] = true;
    $args['menu_class'] = 'main-nav';
    return $args;
}
add_filter( 'wp_page_menu_args', 'modularity_page_menu_args' );

// Give Modularity a custom background
add_custom_background();

// Allow custom colors to clear the background image
function modularity_custom_background_color() {
    if ( get_background_image() == '' && get_background_color() != '' ) { ?>
        <style type="text/css">
        body {
            background-image: none;
        }
        </style>            
    <?php }
}
add_action( 'wp_head', 'modularity_custom_background_color' );

// To use a sidebar, or not to use a sidebar, that is the question. This generates the appropriate class
function modularity_sidebar_class() {
    $options = get_option( 'modularity_theme_options' );

    if ( $options['sidebar'] == 1 ) {
        echo "15 colborder home";
    }
    else {
        echo "24 last";
    }   
}

// The header business begins here:

// No CSS, just IMG call
define('HEADER_TEXTCOLOR', '');
define('HEADER_IMAGE', '');
define('HEADER_IMAGE_WIDTH', 950);
define('HEADER_IMAGE_HEIGHT', 250);
define( 'NO_HEADER_TEXT', true );

function modularity_admin_header_style() {
?>
<style type="text/css">
#headimg {
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
}

#headimg h1, #headimg #desc {
    display: none;
}

</style>
<?php
}

add_custom_image_header( '', 'modularity_admin_header_style' );
// and thus ends the header business

// Comments in the Modularity style
function modularity_comment( $comment, $args, $depth ) {
    $GLOBALS['comment'] = $comment;
    switch ( $comment->comment_type ) :
        case '' :
    ?>
    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
        <div id="comment-<?php comment_ID(); ?>" class="comment-wrapper">
            <div class="comment-meta">
                <?php echo get_avatar( $comment, 75 ); ?>
                <div class="comment-author vcard">
                    <strong class="fn"><?php comment_author_link(); ?></strong>
                </div><!-- .comment-author .vcard -->
            </div>
            <div class="comment-entry">
                <?php if ( $comment->comment_approved == '0' ) : ?>
                    <em><?php _e( 'Your comment is awaiting moderation.', 'modularity' ); ?></em>
                    <br />
                <?php endif; ?>
                <?php comment_text(); ?>
                <p class="post-time">
                    <?php
                        /* translators: 1: date, 2: time */
                        printf( __( '%1$s at %2$s', 'modularity' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'modularity' ), ' ' );
                    ?>
                    <br />
                </p>
                <div class="reply">
                    <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
                </div><!-- .reply -->               
            </div>
    </div><!-- #comment-##  -->

    <?php
            break;
        case 'pingback'  :
        case 'trackback' :
    ?>
    <li class="pingback">
        <p><?php _e( 'Pingback:', 'modularity' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'modularity'), ' ' ); ?></p>
    <?php
            break;
    endswitch;
}

// The Sidebar business
$options = get_option( 'modularity_theme_options' );
if ( $options['sidebar'] == 0 ) {
    $optional_description = __( 'The optional Modularity Lite sidebar is currently deactivated but can be activated from Appearance > Theme Options', 'modularity' );   
} else {
    $optional_description = ''; 
}

if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'name' => 'Sidebar',
        'id' => 'sidebar',
        'description' => $optional_description,
        'before_widget' => '<div id="%1$s" class="item %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="sub">',
        'after_title' => '</h3>',
    ));

    register_sidebar(array(
        'name' => 'Footer 1',
        'id' => 'footer-1',
        'before_widget' => '<div id="%1$s" class="item %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="sub">',
        'after_title' => '</h3>',
    ));

    register_sidebar(array(
        'name' => 'Footer 2',
        'id' => 'footer-2',
        'before_widget' => '<div id="%1$s" class="item %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="sub">',
        'after_title' => '</h3>',
    ));

    register_sidebar(array(
        'name' => 'Footer 3',
        'id' => 'footer-3',
        'before_widget' => '<div id="%1$s" class="item %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="sub">',
        'after_title' => '</h3>'
    ));

    register_sidebar(array(
        'name' => 'Footer 4',
        'id' => 'footer-4',
        'before_widget' => '<div id="%1$s" class="item %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="sub">',
        'after_title' => '</h3>'
    )); 
}



// Load Base Javascripts
if (!is_admin()) add_action( 'init', 'load_base_js' );
function load_base_js( ) {

    wp_enqueue_script('jquery');
    //wp_enqueue_script('jquerynav', get_bloginfo('template_directory').'/js/nav.js', array('jquery'));
    wp_enqueue_script('cycle', get_bloginfo('template_directory').'/js/jquery.cycle.js', array('jquery'));
    //wp_enqueue_script('search', get_bloginfo('template_directory').'/js/search.js', array( 'jquery' ) );

}

// Load Dom Ready Javascripts
function load_dom_ready_js() { ?>

    <script type="text/javascript">
    /* <![CDATA[ */
        jQuery(document).ready(function(){
            jQuery(function() {
                jQuery("#slideshow").cycle({
                    speed: '2500',
                    timeout: '500',
                    pause: 1
                });
            });
        });
    /* ]]> */
    </script>

<?php }
add_action('wp_head', 'load_dom_ready_js');

Does anybody have an idea what has happened??

Thanks in advance!

/ Anne

btw - the theme I'm using is Modularity Lite

share|improve this question

closed as too localized by toscho May 6 '12 at 14:19

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

There is a missing </style> tag, and a <?php } for the function

function modularity_admin_header_style() { ?>
<style type="text/css">
#headimg {
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
}
</style>
<?php }
share|improve this answer
    
Thank you for answering! I tried with the </style> and <?php }, but it didn't make any difference. I guess the line 72 is: define('HEADER_TEXTCOLOR', ''); –  Anne May 6 '12 at 15:32
1  
Edit your question and post all your functions.php code, otherwise is hard to know. What error message are you getting now ? –  user983248 May 6 '12 at 16:44
    
Okay, thanks for responding! this is really getting on my nerves now... I'm still getting the error as above, no matter what I try. I now edited my question, adding the full functions.php –  Anne May 6 '12 at 17:39
    
I got help via wordpress. The functions-php file postet here was incorrect, I found the current one using FileZilla, and found the error. But thanks anyway for your help, time and effort!! –  Anne May 6 '12 at 20:39

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