Community Forums › Forums › Archived Forums › Design Tips and Tricks › php plugin help – 03 social follow
- This topic has 6 replies, 2 voices, and was last updated 11 years, 10 months ago by
Elaine Griffin.
-
AuthorPosts
-
June 6, 2013 at 9:44 am #44333
Elaine Griffin
MemberHello!
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.
http://www.elainegriffindesigns.com/blog/
Any help would be greatly appreciated!
ElaineJune 6, 2013 at 12:33 pm #44388rfmeier
MemberHello,
If you want the social share buttons after your content you could hook a filter in your functions.php file;
/* 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(); }
I hope this helps. There are other places the code could be places too.
June 6, 2013 at 1:55 pm #44411Elaine Griffin
MemberThank 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.
June 6, 2013 at 2:08 pm #44412rfmeier
MemberElaine,
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?
June 6, 2013 at 2:17 pm #44414Elaine Griffin
MemberWhoa, 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!
June 6, 2013 at 2:20 pm #44415rfmeier
MemberElaine,
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.
June 6, 2013 at 3:20 pm #44438Elaine Griffin
MemberYeah.
I just remembered Jetpack has sharing buttons, and they show up on features, so there we go.
Thanks again!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.