Last active
December 16, 2015 12:19
-
-
Save anandkumar/5433719 to your computer and use it in GitHub Desktop.
Add Sticky Sharebar to Genesis Framework (Tutorial link: http://www.blogsynthesis.com/?p=1090)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add Sharebar Box on Single Posts - Genesis | |
* Tutorial link: http://www.blogsynthesis.com/?p=1090 | |
* @author Anand Kumar | |
*/ | |
// Enqueue sticky sharebar script | |
add_action( 'wp_enqueue_scripts', 'blogsynthesis_sb_enqueue_script' ); | |
function blogsynthesis_sb_enqueue_script() { | |
wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-sharebar.js', array( 'jquery' ), '', true ); | |
} | |
add_action('genesis_post_content', 'include_share_bar', 3 ); | |
function include_share_bar() { | |
if ( is_single() ) | |
require(CHILD_DIR.'/sharebar.php'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place these tags at the end of html. --> | |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> | |
<script type="text/javascript"> | |
(function() { | |
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; | |
po.src = 'http://apis.google.com/js/plusone.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); | |
})(); | |
</script> | |
<script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script> | |
<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/all.js#xfbml=1"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Floating Sharebar CSS (Tutorial link: http://www.blogsynthesis.com/?p=1090) | |
------------------------------------------------------------ */ | |
.social-widget { | |
float: left; | |
margin-right: 10px; | |
padding: 2px; | |
min-width: 92px; | |
} | |
.social-widgets { | |
border-bottom: 1px solid #d2d2d2; | |
height: 28px; | |
bottom-top: 4px; | |
padding: 10px; | |
} | |
.social-widgets.comm { | |
float: left; | |
padding: 0 20px; | |
} | |
.social-widgets.fixed { | |
position: fixed; | |
background: #fff; | |
top: 0; | |
z-index: 5000; | |
box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15); | |
-moz-box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15); | |
-webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15); | |
width: 600px; // must be matched with your entry-content width | |
} | |
.social-share-txt { | |
font-size: 14px; | |
font-weight: bold; | |
float: left; | |
margin-right: 12px; | |
line-height: 23px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment