Social Sharing plugin on every page
<p>I have recently been developing a social sharing plugin which sticks to the right side of the page (fixed CSS).</p>

<p>I have been using the hook 'the_content' to display the sidebar, but I'm sure as everyone knows, this shows the sidebar on post, but not category pages/blog feeds.</p>

<p>I have tried using 'the_excerpt' to show the sidebar on the blog feed/category pages, however I feel like there is a much simpler way to reach the same outcome.</p>

<p>This is a great example of what I am aiming for with the plugin: <a href="https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar/" rel="nofollow">https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar/</a></p>

<p>Here is the front end display section of the plugin (which I imagine is where the problem is):</p>

<pre><code>function add_social_share_icons($content) {

    $html = "&lt;ul id='social-sidebar'&gt;";

    global $post;

    $url = get_permalink($post-&gt;ID);
    $url = esc_url($url);

    if(get_option("social-share-facebook") == 1)
    {
        $html = $html . "&lt;li&gt;&lt;a class='fa fa-facebook' target='_blank' href='http://www.facebook.com/sharer.php?u=" . $url . "'&gt;&lt;span&gt;Facebook&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
    }

    if(get_option("social-share-twitter") == 1)
    {
        $html = $html . "&lt;li&gt;&lt;a class='fa fa-twitter' target='_blank' href='https://twitter.com/share?url=" . $url . "'&gt;&lt;span&gt;Twitter&lt;/a&gt;&lt;/li&gt;";
    }

    if(get_option("social-share-linkedin") == 1)
    {
        $html = $html . "&lt;li&gt;&lt;a class='fa fa-linkedin linkedin' target='_blank' href='http://www.linkedin.com/shareArticle?url=" . $url . "'&gt;&lt;span&gt;LinkedIn&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
    }

    if(get_option("social-share-google") == 1)
    {
        $html = $html . "&lt;li&gt;&lt;a class='fa fa-google gplus' target='_blank' href='https://plus.google.com/share?url=" . $url . "'&gt;&lt;span&gt;Google+&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
    }

    if(get_option("social-share-mail") == 1)
    {
        $html = $html . "&lt;li&gt;&lt;a class='fa fa-envelope github' href='mailto:?body=" . $url . "'&gt;&lt;span&gt;Email&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
    }

    $html = $html . "&lt;/ul&gt;";

    return $content =  $html . $content;

}
add_filter("the_content", "add_social_share_icons");
</code></pre>

<p>Any help would be greatly appreciated.</p>

<p><strong>EDIT:</strong> I have tried: <code>add_action("wp_footer", "add_social_share_icons");</code> but no luck, I have also checked the footer file, thinking that <code>wp_footer()</code> might not be there, but it is definitely including in there.</p>