so I am trying to show two blog posts of a certain category on one of my page templates. I have managed to write a function that pulls in all blog posts and makes them accessible via the page and then I have the below code on the template to render out just 2 posts with the correct category of "Business-Featured". which works, however, it seems to be running the loop twice as it is bringing in both posts twice. can anyone see where I have gone wrong?
<% if $RecentNews %> <% loop $RecentNews %> <% loop $Categories %> <% if $Title ="Business-Featured" %> <% loop blogPosts.Limit(2) %> <div class="col-md-6"> $FeaturedImage.CroppedImage(555, 144) <div class="post-preview"> <h3><a href="$Link">$Title</a></h3> <p>$Summary <a href="$Link" style="display: inline;">Read More...</a></p> </div> </div> <% end_loop %> <% end_if %> <% end_loop %> <% end_loop %> <% end_if %>