CMS Development

nicolelawrence
Member

Need to Exclude a Particular Topic In a Recent Post Module

I am trying to get it so when the topic is Weekly Feature does not show up in this latest stories HTML module. Here is the working code that I have right now. What can I add to exclude this topic?:

 

{% set recent_posts = blog_recent_posts('10780960485', 4 ) %}

<div style="padding:0 0 40px 0;" class="latest-news-section">
  <div class="page-center">
 
  
    <div class="latest-news-post">
      <div class="latest-news-post-items">
        {% for topic_posts in recent_posts %} 
        
        <div class="post-item">
          <div class="post-image">
            <div class="blog-post-image" style="background-image: url({{ topic_posts.post_list_summary_featured_image }});"></div>      
          </div> 
          <div class="blog-listing-content">
            {% if topic_posts.topic_list %}
            <p id="hubspot-topic_data">
              {% for topic in topic_posts.topic_list %}
              
              <a class="topic-link" href="{{ blog_tag_url(group.id, topic.slug) }}">{{ topic.name }}</a>{% if not loop.last %} &nbsp;&nbsp;{% endif %}
              
              {% endfor %}
            </p>
            {% endif %}
            <div class="post-header">
              <h2><a href="{{topic_posts.absolute_url}}">{{ topic_posts.name }}</a></h2>
            </div>
            <div class="post-body clearfix">
              <!--post summary-->
              {{ topic_posts.post_list_content|safe }}
            </div>
            <hr>
            <div class="date">
              <a class="author-link" href="/news/author/{{ topic_posts.blog_post_author.slug }}"><img src="https://cdn2.hubspot.net/hubfs/6063852/author-icon.png" alt="Author"> {{ topic_posts.blog_post_author.display_name }}</a> | <img src="https://cdn2.hubspot.net/hubfs/6063852/calendar-icon.png" alt="Publish Date">{{ topic_posts.publish_date_localized }}
            </div>
            <a class="more-link" href="{{topic_posts.absolute_url}}">Full Story</a>
          </div>
        </div>     
        {% endfor %}

      </div>
    </div>
    
    <div class="button-section">
      <a href="/news" class="banner-btn">Read More
      </a>
    </div>

  </div>
</div>
1 Reply 1
jennysowyrda
Community Manager
Community Manager

Need to Exclude a Particular Topic In a Recent Post Module

Hi @nicolelawrence

 

Are you still experiencing this issue? If so can you please share a link to the page you are working on, screenshots and any other information you have? 

 

Questions with links, screenshots and details are quicker to resolve on the Community.

 

Thank you,
Jenny

0 Upvotes