• 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

Add Social Sharing Buttons

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 › Add Social Sharing Buttons

This topic is: not resolved

Tagged: social share

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 10 months ago by cdils.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 15, 2014 at 1:30 am #100361
    rysrivarshan
    Member

    Hi,

    I am using Streamline Pro Theme and trying to get around Genesis on a XAMPP installation locally. Though i am new to PHP i am willing to learn and apply things.

    I want to add my own social sharing buttons and hence I have the used the below code in my functions.php,

    add_filter( 'genesis_post_info', 'post_info_filter' );
    
    function post_info_filter( $post_info ) {
    
    	if ( !is_page() ) {
    			$postURL=get_permalink($post->ID);
    			$post_content=the_excerpt(); 
    			$post_info="<a href='https://twitter.com/intent/tweet?=$postURL&text=$post_content' target='_blank'>Link</a>";
        	return $post_info;
    	}	
    }

    I have few issues and would be really glad if someone could help me,

    1) $post_content=the_excerpt(); - This line automatically outputs the excerpt in a <p> tag outside the entry-meta class, but i haven't printed it out, what am i missing here?

    2) The output URL is as below:

    Link

    I am able to get the URL but not the excerpt in the above URL, what am i doing wrong here?

    http://localhost
    April 20, 2014 at 12:00 pm #101485
    cdils
    Participant

    the_excerpt() automatically prints the value to the page. If you want to store the value in a variable and print when you're ready, try get_the_excerpt() instead.


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂

    I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 2026 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