Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Remove Social Share from main page

Started by Tanzir Rahman 9 years ago · 8 replies · 1177 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 MarkP, 7 days ago
3 121 3 days ago
Themes & Styling · by TomW, 6 days ago
0 64 6 days ago
Themes & Styling · by themetman, 2 weeks ago
1 159 1 week ago
Themes & Styling · by AH, 4 weeks ago
1 274 2 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1459 2 weeks ago