View Full Version : Resolved Help: "Parse error: syntax error, unexpected '}' on line 32"

06-01-2011, 01:33 PM
I'm using wordpress to build my website, and I began editing the functions.php file. I apparently deleted something because I received this error:

Parse error: syntax error, unexpected '}' ' in /home/.../functions.php on line 32.

I went back to the original file and copied and pasted the original file back into the wordpress editor, hoping that it would resolve any syntax errors but I am still receiving the error.

I think that I am missing a bracket to be honest, but I don't know enough about php to figure out which one and where it would go to fix the problem.

Any and all help is greatly appreciated. Heres my code:

<?php get_header(); ?>

<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h1 class="pagetitle">Archive for the <?php single_cat_title(); ?> Category</h1>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h1 class="pagetitle">Posts Tagged <?php single_tag_title(); ?></h1>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h1 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h1>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h1 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h1>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h1 class="pagetitle">Archive for <?php the_time('Y'); ?></h1>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h1 class="pagetitle">Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h1 class="pagetitle">Blog Archives</h1>
<?php } ?>

<div class="content">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>

<?php if (get_post_meta($post->ID, 'img', true) ) { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo('siteurl'); ?>/images/<?php get_custom_field('img', TRUE); ?>.jpg" alt="<?php the_title(); ?>" class="portfolioimg" /></a>
<?php } ?>

<div class="entry">
<?php the_content('Continue Reading &rarr;'); ?>

<p class="meta">Written on <?php the_time('F jS, Y') ?>. <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></p>


<?php endwhile; ?>

<div class="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>

<div class="alignleft"><?php next_posts_link('&larr; Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries &rarr;') ?></div>
<?php } ?>

<?php else : ?>

<div class="post">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>

<?php endif; ?>


<?php get_sidebar(); ?>

<?php get_footer(); ?>

Thanks :)

06-01-2011, 03:10 PM
Hi and welcome,

I think in your case both links in my signature might make a good read for you. Not just the [php] tag link but also the $end and styling link too.