php plugin help – 03 social follow

Community Forums Forums Design Tips and Tricks php plugin help – 03 social follow

This topic is: not resolved

Tagged: ,

This topic contains 6 replies, has 2 voices, and was last updated by  Elaine Griffin 1 year, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #44333

    Elaine Griffin
    Participant
    Post count: 86

    Hello!

    I’m using 03 social follow, and unfortunately, the buttons don’t show up on the featured post on the home page. The plugin people tell me this:

    You’ll want to use this piece of code conditionally set for the homepage:

    <?php echo o3_output_social_plugins(); ?>

    So on your index.php file, you’ll want to find the piece of code that produces the featured post. After the the_content() declaration, you’ll use this:

    if(is_home()) { //conditional for the home page
        echo o3_output_social_plugins(); //output the social plugins
    }

    But I’m not sure exactly where to put it, because I don’t see the_content declaration in any of the php files.
    Any help would be greatly appreciated!
    Elaine

    http://www.elainegriffindesigns.com/blog/
    #44388

    rfmeier
    Participant
    Post count: 597

    Hello,

    If you want the social share buttons after your content you could hook a filter in your functions.php file;

    [php]
    /* functions.php */
    add_filter( ‘the_content’, ‘custom_add_share_buttons’ );
    /**
    * Callback for WordPress ‘the_content’ filter.
    *
    * Append social share buttons to the end of the post’s content.
    *
    * @package WordPress
    * @category Post Content
    * @author Ryan Meier http://www.rfmeier.net
    *
    * @param string $the_content
    * @return string $the_content
    */
    function custom_add_share_buttons( $the_content ){

    // if we are not on the home page, return default content
    if( ! is_home() )
    return $the_content;

    // return the content with the social share buttons appened to the end
    return $the_content . o3_output_social_plugins();

    }[/php]

    I hope this helps. There are other places the code could be places too.


    #44411

    Elaine Griffin
    Participant
    Post count: 86

    Thank you Ryan. Is there anything else I need to do? I put the code in the functions file, but I’m not seeing the buttons.

    #44412

    rfmeier
    Participant
    Post count: 597

    Elaine,

    I went and installed the plugin on my development environment. I immediately received a ton of errors. I cannot get this to work because their code is throwing a lot of errors. I went to the source code… it is very messy and I already see a some bad coding practices.

    Unfortunately, I don’t have the time to go through and fix their issues to get this to work.

    Was this working at all for you?


    #44414

    Elaine Griffin
    Participant
    Post count: 86

    Whoa, really?! It’s been working great for me! I guess I’ll go back to ShareThis, which I think did have the sharing buttons on the featured post.

    Thanks for taking the time to look into it.

    I appreciate the help!

    #44415

    rfmeier
    Participant
    Post count: 597

    Elaine,

    It is up to you. If you have been using it on your hosting site, then you probably won’t see the errors because they are most likely being suppressed/hidden for security.


    #44438

    Elaine Griffin
    Participant
    Post count: 86

    Yeah.

    I just remembered Jetpack has sharing buttons, and they show up on features, so there we go.

    Thanks again!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.