I hope I have the right forum here... but anyway, I am working on a wordpress theme and it uses some conditionals for header images based on whether a person is on a front page, page, post, or category so I came across separate snippets of php that do the above and when I put them together it works fine in my demo site but wordpress.org said they got an error:
PHP Parse error: syntax error, unexpected $end in /usr/home/web/theme-test/public_html/wp-content/themes/evening-shade/advertise.php on line 40
The file in question is brought into the page with a typical includes:
<?php include (TEMPLATEPATH . '/advertise.php'); ?>
but the file itself is made up of the following code:
<?php if (is_front_page()) { ?>
<div id="advert1"></div>
<?php } else { ?>
<?php
// Custom Headers for pages and posts with custom fields
if (get_post_meta($post->ID, 'header', true)) { ?>
<div id="advert1"><img src="<? bloginfo('url'); ?>/wp-content/uploads/<? echo get_post_meta($post->ID, 'header', true) ?>" alt="<?php the_title(); ?>" /></div>
<? } else { ?>
<?php
/**** Conditional Header for Per Category Example Wordpress ****/
// make sure we are in category listing
if (is_category()){
if (is_category('3')){
include(TEMPLATEPATH.'/headers/vineyardnews.php');
}
elseif (is_category('5')){
include(TEMPLATEPATH.'/headers/experiences.php');
}
else {
// this is the deafult header
include(TEMPLATEPATH.'/headers/default.php');
}
}
?>
<? } ?>
<?php } ?>
Even though this works live in a site, I am trying to figure out what is not correct. Does anyone have an idea of what is creating the error the guy got?
Thanks in Advance.