fixed excerpt not containing url on the front page feed
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 13:21:45 +0000 (09:21 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 13:21:45 +0000 (09:21 -0400)
had to add wp_reset_query to allow the ACF data to display and to fix the issues with
the excerpt not getting the url to the post

parts/blog-feed-front.php

index 1c527ae..b0ee767 100644 (file)
@@ -3,16 +3,16 @@
 <?php
 $lastposts = get_posts( $args );
     $count = 0;
-foreach($lastposts as $posts) : setup_postdata($posts); ?>
+foreach($lastposts as $post) : setup_postdata($post); ?>
     <div class="home-feed-post text-center small-12 medium-4 columns medium-text-left block" data-equalizer-watch>
         <div class="row">
-            <?php if (has_post_thumbnail( $posts->ID )) { ?>
-                <?php echo get_the_post_thumbnail($posts->ID, 'glm-block-image', array('class' => 'blog-excerpt-img-wrap')); ?>
+            <?php if (has_post_thumbnail( $post->ID )) { ?>
+                <?php echo get_the_post_thumbnail($post->ID, 'glm-block-image', array('class' => 'blog-excerpt-img-wrap')); ?>
                 <div class="small-12 medium-12 columns home-feed-post-content">
                 <?php } else { ?>
                 <div class="small-12 columns home-feed-post-content">
                 <?php } ?>
-                <h6 class="title-posts"><a href="<?php the_permalink($posts->ID); ?>"><?php the_title(); ?></a></h6>
+                <h6 class="title-posts"><a href="<?php the_permalink($post->ID); ?>"><?php the_title(); ?></a></h6>
                 
                 <div class="excerpt<?php echo $count ?>"><?php echo the_advanced_excerpt('length=265&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,strong,h1,h2,h3,hr,div'); ?></div>
             </div>
@@ -20,4 +20,5 @@ foreach($lastposts as $posts) : setup_postdata($posts); ?>
     </div>
         <?php $count++; ?>
 <?php endforeach; ?>
+<?php wp_reset_query(); ?>
 </div>