<?php if( get_field('featured') ) { // if TRUE ?> <?php $cat = get_field('category'); $cat_name = $cat->name; $cat_slug = $cat->slug; ?> <section> <h2><a href="<?php echo $cat_slug; ?>"><?php echo $cat_name; ?></a></h2> <a href="<?php the_permalink(); ?>"> <?php if(get_the_post_thumbnail()) : echo clean_wp_width_height(get_the_post_thumbnail(get_the_ID(),'thumbnail', array('class' => 'alignleft thumb-link'))); else : ?> <img src="<?php bloginfo('stylesheet_directory'); ?>/img/ball.png" class="alignleft" width=" 100px" /> <?php endif; ?> </a> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_excerpt(); ?> </section> <?php } } } /* Restore original Post Data */ wp_reset_postdata(); ?>
$the_query = new WP_Query('posts_per_page=-1'); // The Loop if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); ?> <section class="blogroll"> <?php if (get_the_post_thumbnail()) { ?> <a class="thumb-link alignleft" href="<?php the_permalink(); ?> "><?php echo clean_wp_width_height(get_the_post_thumbnail(get_the_ID(), 'medium')); ?> </a> <?php } ?> <h2 class="h3"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <p class="date"><?php the_date(); ?>