• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

php plugin help – 03 social follow

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: php, plugins

  • This topic has 6 replies, 2 voices, and was last updated 9 years, 9 months ago by Elaine Griffin.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • June 6, 2013 at 9:44 am #44333
    Elaine Griffin
    Member

    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/
    June 6, 2013 at 12:33 pm #44388
    rfmeier
    Member

    Hello,

    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.


    Ryan Meier – Twitter

    June 6, 2013 at 1:55 pm #44411
    Elaine Griffin
    Member

    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.

    June 6, 2013 at 2:08 pm #44412
    rfmeier
    Member

    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?


    Ryan Meier – Twitter

    June 6, 2013 at 2:17 pm #44414
    Elaine Griffin
    Member

    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!

    June 6, 2013 at 2:20 pm #44415
    rfmeier
    Member

    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.


    Ryan Meier – Twitter

    June 6, 2013 at 3:20 pm #44438
    Elaine Griffin
    Member

    Yeah.

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

    Thanks again!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble