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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Remove Social Share from main page

Started by Tanzir Rahman 9 years ago · 8 replies · 856 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 Pedro M, 2 months ago
4 195 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago