errors in WordPress php

0 replies
I am trying to display the headlines from each post in a category with the post thumbnails underneath each title. What I am getting right now is the title of the current page repeating where the post titles from the category should be, and no thumbnails.

Code:
<?php
     = array( 'category' => 18, 'post_type' =>  'post' ); 
     = get_posts(  );    
    foreach ( as ) :  setup_postdata(); 
    ?>  
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> 
    <?php get_the_post_thumbnail(); ?>
<?php echo((); ?> 


    <?php endforeach; ?>
#errors #php #wordpress

Trending Topics