Php query issues in wordpress homepage

on this page if you look in the very upper left corner you’ll see " /> " />. that is because there’s a problem somewhere in the php code that’s in my homepage which is below. but i cannot figure out what i need to do to the code to fix it. please advise. thanks in advance!


<?php 
  $loop = new WP_Query( array( 
    'cat' => 3,
    'orderby' => 'meta_value',
    'meta_key' => 'eventdate',
    'order' => ASC) 
  ); 
  while ( $loop->have_posts() ) : $loop->the_post(); ?> 
  <div class="sing-event"> 
    <p class="up-events"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
  </div>
<?php
$thumb = get_post_custom_values('promo');
?>
<?php if(isset($thumb) && isset($thumb[0])): ?>
<div id="promo"><a href="<?php the_permalink() ?>"><img src="<?php echo $thumb[0]; ?>" /></a></div>
<?php endif; ?>

<?php endwhile; ?>

<hr />

<h2 style="font-size:1.3em; display:none;">Non-Affiliated Local Events of Interest</h2>
<?php 
  $loop = new WP_Query( array( 
    'category_name' => 'Non-Affiliated Events',
    'orderby' => 'meta_value',
    'meta_key' => 'eventdate',
    'order' => ASC) 
  ); 
  while ( $loop->have_posts() ) : $loop->the_post(); ?> 
  <div> 
    <p><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
$thumb = get_post_custom_values('promo');
?>
<?php if(isset($thumb) && isset($thumb[0])): ?>
<div id="promo"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo $thumb[0]; ?>" /></a></div>
<?php endif; ?>
  </div> 
<?php endwhile; ?>

actually i think its somewhere in this section but i dont know whats wrong with it. obviously php is not my strong suit.


<img src="<?php echo $thumb[0]; ?>" />

Using Firefox’s html tidy you have: 37 errors / 2 warnings and I suppose it could be any of those.

Result: 37 errors / 2 warnings

line 35 column 17 - Error: there is no attribute “property”
line 37 column 166 - Warning: cannot generate system identifier for general entity “helip”
line 37 column 166 - Error: general entity “helip” not defined and no default entity
line 37 column 171 - Error: reference to entity “helip” for which no system identifier could be generated
line 37 column 165 - Info: entity was defined here
line 40 column 46 - Error: unclosed start-tag requires SHORTTAG YES
line 40 column 46 - Error: end tag for “meta” omitted, but OMITTAG NO was specified
line 40 column 1 - Info: start tag was here
line 40 column 70 - Error: character data is not allowed here
line 41 column 46 - Error: unclosed start-tag requires SHORTTAG YES
line 41 column 46 - Error: end tag for “meta” omitted, but OMITTAG NO was specified
line 41 column 1 - Info: start tag was here
line 49 column 172 - Error: reference to entity “helip” for which no system identifier could be generated
line 37 column 165 - Info: entity was defined here
line 55 column 47 - Error: document type does not allow element “a” here
line 158 column 20 - Error: document type does not allow element “h2” here; assuming missing “li” start-tag
line 172 column 42 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 174 column 56 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 175 column 64 - Error: there is no attribute “data-options”
line 179 column 75 - Error: there is no attribute “target”
line 210 column 49 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 212 column 55 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 238 column 55 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 252 column 55 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 264 column 55 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 269 column 45 - Warning: cannot generate system identifier for general entity “tax.asp”
line 269 column 45 - Error: general entity “tax.asp” not defined and no default entity
line 269 column 52 - Error: reference to entity “tax.asp” for which no system identifier could be generated
line 269 column 44 - Info: entity was defined here
line 270 column 49 - Error: document type does not allow element “li” here; missing one of “ul”, “ol” start-tag
line 271 column 13 - Error: end tag for “li” omitted, but OMITTAG NO was specified
line 158 column 4 - Info: start tag was here
line 287 column 3 - Error: end tag for element “p” which is not open
line 290 column 3 - Error: end tag for element “p” which is not open
line 296 column 33 - Error: there is no attribute “width”
line 296 column 46 - Error: there is no attribute “height”
line 296 column 56 - Error: there is no attribute “src”
line 296 column 106 - Error: there is no attribute “frameborder”
line 296 column 125 - Error: “allowfullscreen” is not a member of a group specified for any attribute
line 296 column 125 - Error: element “iframe” undefined
line 296 column 247 - Error: “allowfullscreen” is not a member of a group specified for any attribute
line 296 column 247 - Error: element “iframe” undefined
line 297 column 46 - Error: document type does not allow element “param” here; assuming missing “object” start-tag
line 297 column 60 - Error: end tag for “object” omitted, but OMITTAG NO was specified
line 297 - Info: start tag was here
line 361 column 6 - Error: end tag for “div” omitted, but OMITTAG NO was specified
line 147 - Info: start tag was here

Out of interest your page is slow to load and I would think getting rid of most of these errors would help that as well.

Anyway you are in the right area with the problem; it is on these two lines.
<meta property=“og:image” content=“<img src=”<?php echo $thumb[0]; ?>" />
<meta property=“og:image” content=“<img src=”<?php echo $thumb[0]; ?>" />

This is telling you what the problem is:
line 40 column 46 - Error: unclosed start-tag requires SHORTTAG YES
line 40 column 46 - Error: end tag for “meta” omitted, but OMITTAG NO was specified
line 40 column 1 - Info: start tag was here
line 40 column 70 - Error: character data is not allowed here
line 41 column 46 - Error: unclosed start-tag requires SHORTTAG YES
line 41 column 46 - Error: end tag for “meta” omitted, but OMITTAG NO was specified
line 41 column 1 - Info: start tag was here

thanks. will do.