• 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

Share Buttons for Categories

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 › General Discussion › Share Buttons for Categories

This topic is: not resolved

Tagged: Share Buttons for Categories

  • This topic has 19 replies, 3 voices, and was last updated 10 years, 6 months ago by jeffreyd00.
Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • October 29, 2014 at 2:49 am #129676
    jeetututeja
    Member

    Simple share working on individual post pages, but I'd also like to add to my category pages as well.

    When I put the code { (genesis_share_icon_output( 'shareachive', array( 'googlePlus','facebook', 'twitter' ) ) } on Category pages they point to the url of whatever post is at the top of the list. If I try to place the Share buttons at the bottom, they pick up the url of the last post listed.

    But actually it should share the Home Page or Category page link .

    I tried with following hooks, but still showing the same issue
    genesis_before_content_sidebar_wrap
    genesis_before_content
    genesis_before_loop

    I tried few other plugins also tried on manual coding but it did work except Crafty-Social-Plugin which I don't want to use

    Could you help me ?

    The issue is similar to the following URL. but they solved it for Crafty-Social-Plugin (do_action('crafty-social-share-page-buttons'); })
    https://wordpress.org/support/topic/share-buttons-for-categories

    http://www.smarttutors.com/
    October 29, 2014 at 3:03 am #129678
    Sridhar Katakam
    Participant

    Pasting from my tutorial, http://www.sridharkatakam.com/beautiful-social-sharing-icons-using-genesis-simple-share/:

    The plugin is meant to give you a way to add social sharing icons in the scope of Page or individual Post. It does not work (as you would expect) if you are trying to share an entire listings page like the Posts page or category archives. ‘Show on Archive Pages’ is intended for displaying the social buttons for EACH post on the archive page, not the full page itself.


    Genesis Tutorials | Follow me on Twitter

    October 29, 2014 at 3:13 am #129682
    jeetututeja
    Member

    Dear Shridhar,

    Please read carefully I said I tried other plugins also tried manual coding but its showing the same results.

    Please help.

    October 29, 2014 at 3:14 am #129683
    Sridhar Katakam
    Participant

    Do you mind telling the name of any plugin that you like which does what you want when a non-Genesis theme is active?


    Genesis Tutorials | Follow me on Twitter

    October 29, 2014 at 3:25 am #129686
    jeetututeja
    Member

    Dear Shridhar,

    Crafty-Social-Plugin work fine if use this code : (do_action(‘crafty-social-share-page-buttons’);

    Crafty Social Buttons

    I already wrote this in my post 🙂

    The issue is similar to the following URL. but they solved it for Crafty-Social-Plugin (do_action(‘crafty-social-share-page-buttons’); })

    https://wordpress.org/support/topic/share-buttons-for-categories

    October 29, 2014 at 3:40 am #129687
    Sridhar Katakam
    Participant

    You wrote that you got Crafty Social Buttons to work in Genesis but you do not want to use it.

    Is there a plugin that you want to use having your desired feature (of sharing buttons for the entire archive page) which works in a non Genesis theme but not in Genesis?


    Genesis Tutorials | Follow me on Twitter

    October 29, 2014 at 4:31 am #129692
    jeetututeja
    Member

    It will be great if I use manual code from facebook & Google+ . I don't want to use any plugin.

    October 29, 2014 at 5:06 am #129695
    jeetututeja
    Member

    Dear Shridhar,

    is there any solution??

    October 29, 2014 at 5:56 am #129702
    jeetututeja
    Member

    Is there anyone in support team who can help me out.

    I don't know why its fetching the post in loop from following hooks for category page. I was using hooks (OpenHook) in thesis and it was working fine .. its happening only in Genesis.

    genesis_before_content_sidebar_wrap
    genesis_before_content
    genesis_before_loop

    Please help

    October 29, 2014 at 6:27 am #129708
    Sridhar Katakam
    Participant

    We are again at square one.

    What exactly is not working in Genesis, that is working in Thesis?

    manual code from facebook & Google+

    ^^ that?

    As both of us concur, Genesis Simple Share is not designed (at this time) to share archive pages URLs but only for each individual posts.


    Genesis Tutorials | Follow me on Twitter

    October 29, 2014 at 6:38 am #129711
    jeetututeja
    Member

    Dear Shridhar,

    Its almost done, You can check the website ..

    Manual Code mean which I just copy paste to website from GOOGLE+ & Facebook.

    October 29, 2014 at 6:58 am #129714
    jeetututeja
    Member

    Shridhar,

    I am not talking about specifically for Genesis Simple Share or any other plugin.

    I am saying that I am not using any plugin and using facebook, Google, twitter share button on category pages they point to the url of whatever post is at the top of the list. If I try to place the Share buttons at the bottom, they pick up the url of the last post listed.

    Hope you understand this time

    October 29, 2014 at 7:00 am #129715
    Sridhar Katakam
    Participant

    Got it.

    I will test this tomorrow and post an update.


    Genesis Tutorials | Follow me on Twitter

    October 29, 2014 at 11:33 pm #129841
    jeetututeja
    Member

    Any Update ?

    October 30, 2014 at 12:16 am #129842
    Sridhar Katakam
    Participant

    Tested and working fine.

    functions.php:

    add_action( 'get_header', 'facebook_share_btn_sdk' );
    function facebook_share_btn_sdk() {
    	echo '<div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=357648750922513&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, \'script\', \'facebook-jssdk\'));</script>';
    }
    
    add_action( 'genesis_after_header', 'facebook_share_btn' );
    function facebook_share_btn() {
    	echo '<div class="social-media-sharing"><div class="wrap">
    	<div class="fb-share-button social-share-btn" data-layout="button_count"></div>
    	<div class="social-share-btn"><div class="g-plus" data-action="share" data-annotation="bubble"></div></div>
    	<div class="social-share-btn"><a href="https://twitter.com/share" class="twitter-share-button" data-via="srikat">Tweet</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\'://platform.twitter.com/widgets.js\';fjs.parentNode.insertBefore(js,fjs);}}(document, \'script\', \'twitter-wjs\');</script></div>
    	</div></div>';
    }
    
    add_action( 'wp_footer', 'google_share_init' );
    function google_share_init() {
    	echo '<script src="https://apis.google.com/js/platform.js" async defer></script>';
    }

    style.css:

    .social-media-sharing {
    	margin-top: 40px;
    }
    
    .social-share-btn {
    	margin-right: 20px;
    	display: inline-block;
    	float: left;
    }
    
    .social-share-btn:last-child {
    	margin-right: 0;
    }

    Screenshot:

    http://cl.ly/image/3M3J2W0v1N3l

    Let me know if you want to see a live demo.


    Genesis Tutorials | Follow me on Twitter

    October 30, 2014 at 12:28 am #129843
    jeetututeja
    Member

    Yes please share the URL

    October 30, 2014 at 12:34 am #129844
    Sridhar Katakam
    Participant

    http://websitesetuppro.com/demos/devsite/category/featured/


    Genesis Tutorials | Follow me on Twitter

    November 2, 2014 at 6:25 pm #130226
    jeffreyd00
    Member

    What if I only wanted it to show on is_single and is_home ?

    November 2, 2014 at 6:33 pm #130227
    Sridhar Katakam
    Participant

    Inside each function at the beginning you could write the conditional to return if the current page is not where you want.

    Ex.: http://pastebin.com/raw.php?i=ybJiwujp


    Genesis Tutorials | Follow me on Twitter

    November 4, 2014 at 9:47 am #130421
    jeffreyd00
    Member

    Thank you!

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 20 total)
  • The forum ‘General Discussion’ 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

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