XF 2.1 How to remove globally "Share this post" ?

fionix

Well-known member
Hello,

I want to remove "globally" the Share this post bottom which appear on each post.

I put a circle on the attached image so you may better understand what it is I want to remove if possible.screenshot.webp
 
Hello, in post_macros template you can remove this part of code around line 31

HTML:
<li>
    <a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}"
        data-xf-init="share-tooltip" data-href="{{ link('posts/share', $post) }}"
        rel="nofollow">
        <xf:fa icon="fa-share-alt"/>
    </a>
</li>
 
Or maybe add this to extra.less
Code:
.message-attribution-opposite .fa-share-alt {
display: none !important;
}

With this, you will still be able to click on the a-tag, because you're only hiding the FontAwesome Icon:
D5L53.png


I think the best way is to add a class to the li-Tag in post_macros and then display:none with CSS in your extra.less:
j3a75.png
 
Last edited:
Top Bottom