WordPress.org

Support

Support » Themes and Templates » Parse error: syntax error, unexpected $end in index.php

Parse error: syntax error, unexpected $end in index.php

  • Hello everyone,

    I have a woking installation of WordPress 3.5.1. I hired a PSD 2 WP service to slice a theme. It works like a charm in their WordPress installation, but when I upload it to my instalation, I get the error “Parse error: syntax error, unexpected $end in index.php” in the last line of the file. I believe it’s not a code error in the theme itself, since as I say it works in their WordPress.

    To install this theme I’ve uploaded the theme into /themes directory, their plugins in /plugins directory and their XML database export was successfuly imported into my database.

    If I switch themes, it works fine.

    There is another error I get as well: Notice: add_custom_background está obsoleto desde la versión 3.4. Utiliza add_theme_support( ‘custom-background’, $args ) en su lugar. in ……\Blog\wp-includes\functions.php on line 2839

    Any suggestions on where to start debugging?

    Thanks a lot for your time!

Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    @esmi

    Forum Moderator

    If I switch themes, it works fine.

    Then the issue is in the theme. From the second error/warning, it also appears your theme creators are not developing themes suitable for WordPress 3.5

    Thanks for your reply, esmi.

    However, I’ve checked the headers on their site and it says
    <meta name=”generator” content=”WordPress 3.5.1″ />
    And again, the theme works fine in their server. So I assume there must be something in my instalation that is not compatible with their theme, and it’s causing a conflict (maybe an option in functions.php?)

    So any help on where to start checking out stuff would be much appreciated indeed.

    esmi

    @esmi

    Forum Moderator

    I’ve checked the headers on their site and it says
    <meta name=”generator” content=”WordPress 3.5.1″ />

    Nevertheless, the theme may not have been built in line with wordpress.org standards. And a parse error is a clear indication of a serious issue in a file – not any kind of conflict. It might help if you posted the full error message.

    Thanks again for your reply.

    This is the full message:

    Notice: add_custom_background está obsoleto desde la versión 3.4. Utiliza add_theme_support( ‘custom-background’, $args ) en su lugar. in C:\(…)\Blog\wp-includes\functions.php on line 2839 Notice: add_custom_image_header está obsoleto desde la versión 3.4. Utiliza add_theme_support( ‘custom-header’, $args ) en su lugar. in C:\(…)\Blog\wp-includes\functions.php on line 2839 Parse error: syntax error, unexpected $end in C:\(…)\Blog\wp-content\themes\sureserviceser\index.php on line 76

    Line 76 is the end of the index.php file.

    If I set functions.php to not display error messages, I get a 500 error.

    esmi

    @esmi

    Forum Moderator

    The problem is definitely in the theme. Specifically its index.php file. You need to go back to the suppliers with these issues.

    All right then… thanks a lot. Unfortunately I think they gave up. 🙁 They won’t answer back my messages. And they are in India, so I can’t go there and kill them.

    However, I must say I commented the whole index.php file just to see where the problem started, and it still showed the same problem. 😐

    Oh well, I’ll go on with the investigation and if I find the problem, I will let ya know all.

    Hello again!

    The problem seems to be here. Any suggestions? Tx! 🙂

    <?php query_posts('category_name=sure-service&showposts=2');
    							if ( have_posts() ) : while ( have_posts() ) : the_post();
    							?>
    								<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    								<div class="est_text">
    								<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    								<? if(has_post_thumbnail()) { ?>
    									<img src="<?php echo $image[0]; ?>" alt="" width="76" height="76"/>
    									<? } else { ?>
    										&nbsp;
    									<? } ?>
    								<? ob_start();
    								the_content();
    								$content = ob_get_clean();
    								echo substr($content,0,250); ?>
    								</div>
    								<?
    								endwhile; else:
    								endif;
    								wp_reset_query(); ?>
    							</div>
    						</div>
    esmi

    @esmi

    Forum Moderator

    Try changing every reference to <? to <?php. I’d also question this code:

    <? ob_start();
    the_content();
    $content = ob_get_clean();
    echo substr($content,0,250); ?>

    Parse error: syntax error, unexpected $end in /home/sbsson/public_html/preyas/wp-config.php on line 1.
    i face this error from last 2 weeks. if you have any solution about this error please send me on my email id [email address moderated – these forums do not provide support via email]

    esmi

    @esmi

    Forum Moderator

    @preyas: As per the Forum Welcome, please post your own topic – including a link to your site. As it stands, your site may have been hacked.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Parse error: syntax error, unexpected $end in index.php’ is closed to new replies.
Skip to toolbar