Community Forums › Forums › Archived Forums › General Discussion › Share Buttons for Categories
Tagged: Share Buttons for Categories
- This topic has 19 replies, 3 voices, and was last updated 9 years, 5 months ago by jeffreyd00.
-
AuthorPosts
-
October 29, 2014 at 2:49 am #129676jeetututejaMember
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_loopI 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'); })
http://www.smarttutors.com/
https://wordpress.org/support/topic/share-buttons-for-categoriesOctober 29, 2014 at 3:03 am #129678Sridhar KatakamParticipantPasting 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.
October 29, 2014 at 3:13 am #129682jeetututejaMemberDear 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 #129683Sridhar KatakamParticipantDo you mind telling the name of any plugin that you like which does what you want when a non-Genesis theme is active?
October 29, 2014 at 3:25 am #129686jeetututejaMemberDear Shridhar,
Crafty-Social-Plugin work fine if use this code : (do_action(‘crafty-social-share-page-buttons’);
https://wordpress.org/plugins/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 #129687Sridhar KatakamParticipantYou 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?
October 29, 2014 at 4:31 am #129692jeetututejaMemberIt 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 #129695jeetututejaMemberDear Shridhar,
is there any solution??
October 29, 2014 at 5:56 am #129702jeetututejaMemberIs 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_loopPlease help
October 29, 2014 at 6:27 am #129708Sridhar KatakamParticipantWe 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.
October 29, 2014 at 6:38 am #129711jeetututejaMemberDear 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 #129714jeetututejaMemberShridhar,
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 #129715Sridhar KatakamParticipantOctober 29, 2014 at 11:33 pm #129841jeetututejaMemberAny Update ?
October 30, 2014 at 12:16 am #129842Sridhar KatakamParticipantTested 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.
October 30, 2014 at 12:28 am #129843jeetututejaMemberYes please share the URL
October 30, 2014 at 12:34 am #129844Sridhar KatakamParticipantNovember 2, 2014 at 6:25 pm #130226jeffreyd00MemberWhat if I only wanted it to show on is_single and is_home ?
November 2, 2014 at 6:33 pm #130227Sridhar KatakamParticipantInside 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
November 4, 2014 at 9:47 am #130421jeffreyd00MemberThank you!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.