-1

I am facing this problem in my header.php file.

Parse error: syntax error, unexpected end of file in header.php on line 187

Here is code can anyone please tell me where is syntax missing.

<?php 
if ( has_post_thumbnail() ) { 
    // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail("featured", array("class" => "alignleft"));                        
?>
Narendrasingh Sisodia
  • 21,247
  • 6
  • 47
  • 54
johnsmith
  • 43
  • 1
  • 2
  • 8

3 Answers3

0

You forgot the closing }.

<?php
if (has_post_thumbnail()) {
    the_post_thumbnail("featured", array(
        "class" => "alignleft"
    ));
}
?>
Joseph
  • 1,003
  • 3
  • 11
  • 25
0

missing }

<?php 
                        if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                           the_post_thumbnail("featured", array("class" => "alignleft"));
                       }

                       endwhile;  
                       endif;
                   }
                       ?>
Qaisar Satti
  • 2,742
  • 2
  • 18
  • 36
0

In your file there are two braces missing.

<?php if(is_front_page()){  ?>  // one closing brace `}` missing for this if condition. **give spaces here**...

 if ( has_post_thumbnail() ) {  // one closing brace `}` for this if condition 

So at end of your page you have to add two closing braces. update your code like this:

 <?php 
     if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
       the_post_thumbnail("featured", array("class" => "alignleft")); 
     }
 }
?>     

query_posts(array("category_name" => "Home Slider" , "post_per_page" => -1, "showposts" => -1 , "post_type" => "post"));
if(have_posts()):  endif;  /// add here endif;

while(have_posts()): the_post(); endwhile;  /// add here endwhile;
Shailesh Katarmal
  • 2,757
  • 1
  • 12
  • 15