Difficulty placing share button in wordpress

58 views Asked by At

I am in a serious dilemma

Please, I am trying to add a custom Facebook share button below my posts in WordPress. I need a step by step approach on what to do and the correct code to use and where to insert them.

I am using the truepixel WordPress theme.

Thanks a lot.

1

There are 1 answers

1
sarath On

Check the below code .Use variable $append for adding share button code. Add the code in functions.php

add_filter( 'the_content', 'share_buttons' );

    function share_buttons($content){

        $append = '<p>Facebook share button place</p>';

        $new_content = $content.$append;
        return $new_content;

    }