KVSun / KV-Sun-WP

A custom WordPress theme for the Kern Valley Sun
0 stars 2 forks source link

Use first image in post before using DEFAULT_IMG #93

Open shgysk8zer0 opened 7 years ago

shgysk8zer0 commented 7 years ago

Seen in blog-loop.php as:

<?php if ( has_post_thumbnail() ) { ?>
  <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="post-thumbnail">
    <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'mag-image'); ?>
    <img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>"  />
  </a>
<?php } else { ?>
shgysk8zer0 commented 7 years ago

Where is $post set? Is it a global?