• Resolved Cinnamon

    (@cinnamonb)


    Ok, please bear with me. This is the first time ever reaching out for WP forum support. I am usually able to discover an error via researching advice and tips from others. But unfortunately, I’ve come across a major error, and I would greatly appreciate any/everyone’s help. I am new at theme development. It is possible that, as simple as the coding may be, I’m getting this syntax error for line 40.

    <?php get_footer(); ?> This is in line 40

    I’ve been staring through the code for hours, and yes, it is possible I maybe overlooking something, but I can’t seem to find it anywhere. I’ve refreshed all the folders in the updated 3.5 version of WP except the wp-contents. I have no plugins registered, this is a clean Multi-Site Install. I’ve cleared my browser’s cache. I’ve double checked for any white spaces in my wp-config file.

    I’ve tried nearly all solutions that seemed to work for everyone else who had this issue, and I really need to know what is going wrong with the code.

    My Theme is custom where the sidebar is needed at the top beneath the header call

    See my index.php code below:

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <!--Start of Content -->
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    
    	<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    		<?php the_title('<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
    
    		<p class="byline">
    			<span class="author vcard"><?php the_author_posts_link(); ?></span> <span class="sep">|</span>
    			<abbr class="published" title="<?php the_time(__('l, F jS, Y, g:i a')); ?>"><?php the_time(__('F j, Y')); ?></abbr>
    			<?php edit_post_link(__('Edit'), ' <span class="sep">|</span> <span class="edit">', '</span> '); ?>
    		</p>
    
    		<div class="entry-content">
    			<?php the_content(__('Continue reading')); ?>
    			<?php wp_link_pages('before=<p class="pages">' . __('Pages:') . '&after=</p>'); ?>
    		</div>
    
    		<p class="entry-meta">
    			<span class="categories"><?php _e('Posted in'); ?> <?php the_category(', '); ?></span>
    			<?php the_tags('<span class="tags"> <span class="sep">|</span> ' . __('Tagged') . ' ', ', ', '</span>'); ?>
    			<span class="sep">|</span> <?php comments_popup_link(__('Leave a response'), __('1 Response'), __('% Responses'), 'comments-link', __('Comments closed')); ?>
    		</p>
    
    	</div>
    
    	<?php endwhile; ?>
    
    <?php else : ?>
    
    	<p class="no-posts"><?php _e('Sorry, no posts matched your criteria'); ?></p>
    
    <?php endif; ?>
    <!--End of Content-->
    
    <?php get_footer(); ?>

    Thank you in advance to all those who would be able to assist me.

    The site currently is showing the error message and providing the link wouldn’t be necessary, but if still want it: Freestyle Theme

Viewing 3 replies - 1 through 3 (of 3 total)
  • Vikram S.

    (@jodhavishalsingh)

    don’t have error in this code, may be in footer.php

    Thread Starter Cinnamon

    (@cinnamonb)

    Thank you Jodhavishalsingh for your response.
    Here’s the footer.php:

    <!-- Start of Footer -->
    	<div class="sixteen columns row" id="footer">
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Widget1') ) : ?>
    	<?php endif; ?>
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Widget2') ) : ?>
    	<?php endif; ?>
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Widget3') ) : ?>
    	<?php endif; ?>
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Widget4') ) : ?>
    	<?php endif; ?>
    	</div><!--end of sixteen columns-->
    <!-- End of Footer -->
    
    </div><!--end of container-->
    <?php wp_footer(); ?>
    </body>
    </html>

    Also this is all I currently have in my functions.php

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Main Sidebar',
    'before_widget' => '<div id="sidebar" class="five columns">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="med-title">',
    'after_title' => '</h3>',
    ));
    register_sidebar(array('name'=>'Footer Widget1',
    'before_widget' => '<div class="four columns alpha footer-widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="sm-title">',
    'after_title' => '</h3>',
    ));
    register_sidebar(array('name'=>'Footer Widget2',
    'before_widget' => '<div class="four columns alpha footer-widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="sm-title">',
    'after_title' => '</h3>',
    ));
    register_sidebar(array('name'=>'Footer Widget3',
    'before_widget' => '<div class="four columns alpha footer-widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="sm-title">',
    'after_title' => '</h3>',
    ));
    register_sidebar(array('name'=>'Footer Widget4',
    'before_widget' => '<div class="four columns alpha footer-widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="sm-title">',
    'after_title' => '</h3>',
    ));
    ?>
    <?php
    //add dynamic menu
    add_action( 'init', 'register_my_menus' );
    function register_my_menus() {
    	register_nav_menus(
    		array(
    			'primary-menu' => __( 'Top Menu' ),
    		)
    	);
    }
    ?>
    Thread Starter Cinnamon

    (@cinnamonb)

    Ok, all I did was remove/comment all code from index, footer, and sidebar php files, then add a few lines of code at a time to see what would happen, and if I can find the culprit.

    Turns out, I couldn’t find anything wrong. Everything is working fine now. I’m glad.

    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Needing help for syntax error, unexpected $end in /home/…/index.php line 40’ is closed to new replies.