Title: Getting Error
Last modified: August 22, 2016

---

# Getting Error

 *  Resolved [sasank](https://wordpress.org/support/users/sasank/)
 * (@sasank)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/getting-error-18/)
 * hi friends im executing this code getting error:
    Parse error: syntax error, 
   unexpected ‘wp_reset_postdata’ (T_STRING) in /home/content/p3pnexwpnas05_data01/
   74/2360274/html/wp-content/themes/hueman/functions.php on line 917
 *     ```
       function latestnews()
       	{
   
           $catid = 50;//$category->cat_ID; //Store the category ID as a variable to be used in WP_Query
   
           $args = array(
               'cat' => $catid,
               'posts_per_page' => 10,
           );
   
           $query = new WP_Query($args);   
   
           // Start the Loop. You can use your own loop here
               while ( $query->have_posts() ) : $query->the_post();
           ?>  
   
       <li>
                   <?php the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' ); //Display only the title of the posts in the category ?>
               </li>
           <?php
               endwhile;
       		?>
       		<a href="http://localhost/bahujana/category/%E0%B0%A4%E0%B0%BE%E0%B0%9C%E0%B0%BE%E0%B0%B5%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%A4%E0%B0%B2%E0%B1%81/">More News</a>
           <?php//endforeach;
       /* Restore original Post Data */
       wp_reset_postdata();
       ?>
   
       	<?php }
       add_shortcode('late', 'latestnews');
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [sasank](https://wordpress.org/support/users/sasank/)
 * (@sasank)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/getting-error-18/#post-5594550)
 * problem solved

Viewing 1 replies (of 1 total)

The topic ‘Getting Error’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hueman/3.7.27/screenshot.png)
 * Hueman
 * [Support Threads](https://wordpress.org/support/theme/hueman/)
 * [Active Topics](https://wordpress.org/support/theme/hueman/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hueman/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hueman/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [sasank](https://wordpress.org/support/users/sasank/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/getting-error-18/#post-5594550)
 * Status: resolved