Load More Button

Highlighted
New Contributor

Hi,

 

I create custom module of Case-Study.

Currently load more button is loading if there is not post. 

 

I need Load More button when there are more than 3 post. Basically I need count of listing items.

Below is the code.

Thanks in advace!

==============================================

{% set topic_posts = blog_recent_topic_posts('default', 'information', 1000000000) %}

{% for topic_post in topic_posts %}
{# <div class="post-title">{{ topic_post.name }}</div> #}

<div class="post-item">
<div class="blog-article-content">

<div class="blog_image_left">
{% if topic_post.featured_image %}
<div class="hs-featured-image-wrapper">
<a href="{{topic_post.absolute_url}}" title="" class="hs-featured-image-link">
<img src="{{ topic_post.featured_image }}" class="hs-featured-image">
</a>
</div>
{% endif %}

</div>

<div class="blog_content_right">



<div class="post-header">
{% if topic_post.topic_list %}
<div class="topic_box">
{% for topic in topic_post.topic_list %}
<a class="topic-link" href="{{ topic_post.parent_blog.absolute_url }}/topic/{{ topic.slug }}">{{topic}}</a>{% if not loop.last %}<span class="topic-link">,</span>{% endif %}
{% endfor %}
</div>
{% endif %}
<h2 class="title_blog">{{ topic_post.name }}</h2>
</div>
<div class="post-body clearfix">
<!--post summary-->
{% if topic_post.post_list_summary_featured_image %}
<div class="hs-featured-image-wrapper">
<a href="{{topic_post.absolute_url}}" title="" class="hs-featured-image-link">
<img src="{{ topic_post.post_list_summary_featured_image }}" class="hs-featured-image">
</a>
</div>
{% endif %}
{{ topic_post.post_list_content|safe|truncatehtml(100) }}
</div>
{% if content_group.show_summary_in_listing %}
<a class="more-link btn-primary-stag" href="{{ topic_post.absolute_url }}">READ ARTICLE</a>
{% else %}
<a class="more-link btn-primary-stag" href="{{ topic_post.absolute_url }}">READ ARTICLE</a>
{% endif %}

</div>
</div>
</div>
{% endfor %}


<!-- Load More -->
<div style="text-align:center;clear: both;margin-top: 5em;">
<a href="#" id="loady" class="load_more">LOAD MORE</a>
</div>
<p class="totop">
<a href="#top" id="back2Top" style="font-size:18px;">Back to top <span style="font-size:30px;">&#x21e7;</span></a>
</p>
<!-- Load More -->

 

Reply
0 Upvotes
1 Reply 1
Advisor

Hey @ketan 

 

This conversation might get you moving in the right direction.