Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Remove Social Share from main page

Started by Tanzir Rahman 9 years ago · 8 replies · 974 views
9 years ago

I added the social share plugin to my blog_item page. Why is it showing on the main blog page, i.e. the list of blog entries? How do I get rid of it?

thirdhandbd.com/blog

Capture|690x136

Thanks.

9 years ago

Where did you add it? In the Twig file?

9 years ago

Yup, added it to the Twig file. I thought that's how it works?

9 years ago

Well, apparently your list template includes it with the rest of single post code. Is it Antimatter theme? Where exactly did you paste the buttons code?

9 years ago

Yup, it's the antimatter theme. And, no, I only pasted in blog_item. It goes away completely when I remove from blog_item.

9 years ago

Yeah, but where in the blog_item?

TWIG
        <div class="content-wrapper blog-content-list grid pure-g">
            <div id="listing" class="block pure-u-2-3 h-feed">
                {% for child in collection %}
                    {% include 'partials/blog_item.html.twig' with {'blog':page, 'page':child, 'truncate':true} %}
                {% endfor %}

Yup, blog.html.twig includes the blog_item.html.twig

9 years ago

If you wrap the buttons in condition like this it should help:

TWIG
{% if page.active %} 
# Buttons go here
{% endif %}
👍 1
9 years ago

Always happy to help.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Sebadamus, 7 days ago
5 148 16 hours ago
Themes & Styling · by martynfoster735, 1 week ago
1 193 1 week ago
Themes & Styling · by Justin Young, 3 weeks ago
1 241 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 376 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 745 3 months ago