WordPress.org

Ready to get started?Download WordPress

Forums

Parse error: syntax error, unexpected $end in index.php (11 posts)

  1. MortimerOnline
    Member
    Posted 1 year ago #

    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!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    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

  3. MortimerOnline
    Member
    Posted 1 year ago #

    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.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  5. MortimerOnline
    Member
    Posted 1 year ago #

    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.

  6. esmi
    Forum Moderator
    Posted 1 year ago #

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

  7. MortimerOnline
    Member
    Posted 1 year ago #

    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.

  8. MortimerOnline
    Member
    Posted 1 year ago #

    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>
  9. esmi
    Forum Moderator
    Posted 1 year ago #

    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); ?>
  10. preyas
    Member
    Posted 1 year ago #

    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]

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    @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.

Topic Closed

This topic has been closed to new replies.

About this Topic