Remove Social Share from main page

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?


Where did you add it? In the Twig file?

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

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?

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

Yeah, but where in the blog_item?

		<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

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

{% if %} 
# Buttons go here
{% endif %}
1 Like

That worked, perfection. Thanks a lot! :smiley:

Always happy to help.