Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active August 17, 2017 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/d8d68c9368e44223a2fe96da5ac369ed to your computer and use it in GitHub Desktop.
Save billerickson/d8d68c9368e44223a2fe96da5ac369ed to your computer and use it in GitHub Desktop.
/* EA Share Count
--------------------------------------------- */
.ea-share-count-wrap {
@include clearfix;
.ea-share-count-button.style-box {
background: $grey_4;
box-shadow: 0 2px 4px 0 rgba( $black, .5 );
color: $white;
display: block;
float: left;
line-height: 1;
height: 44px;
overflow: hidden;
padding: 12px 0 0;
margin: 0;
text-align: center;
width: 100px / 6px * 1%; // 6 = number of services
@include media(">=tablet") {
width: 44px;
}
&:hover {
background: darken( $grey_4, 10% );
text-decoration: none;
}
&:first-child {
border-radius: 6px 0 0 6px;
}
&:last-child {
border-radius: 0 6px 6px 0;
}
&.facebook {
background: $bc_facebook;
&:hover {
background: darken( $bc_facebook, 10% );
}
@include media(">=tablet"){
width: calc( 100% - 220px ); // 220 = 44px * 5 (share services - 1)
.ea-share-count-label {
display: inline;
margin-left: 16px;
font-weight: 400;
}
}
}
&.twitter {
background: $bc_twitter;
&:hover {
background: darken( $bc_twitter, 10% );
}
}
&.google {
background: $bc_googleplus;
&:hover {
background: darken( $bc_googleplus, 10% );
}
}
&.pinterest {
background: $bc_pinterest;
&:hover {
background: darken( $bc_pinterest, 10% );
}
}
&.print {
background: $bc_print;
&:hover {
background: darken( $bc_print, 10% );
}
}
&.email {
background: $bc_email;
&:hover {
background: darken( $bc_email, 10% );
}
}
.ea-share-count-label {
display: none;
font-size: 16px;
font-weight: 600;
letter-spacing: 0;
}
}
}
<?php
/**
* EA Starter
*
* @package EAStarter
* @since 1.0.0
* @copyright Copyright (c) 2014, Contributors to EA Genesis Child project
* @license GPL-2.0+
*/
/**
* Share Link
*
*/
function ea_social_sharing_link( $link ) {
if( 'facebook' == $link['type'] && 'style-box' == $link['class'] ) {
$link['label'] = 'Like this? Share it on Facebook';
}
return $link;
}
add_filter( 'ea_share_count_link', 'ea_social_sharing_link' );
/**
* Share Styles
*
*/
function ea_social_sharing_styles( $styles ) {
$styles['box'] = 'Box';
return $styles;
}
add_filter( 'ea_share_count_styles', 'ea_social_sharing_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment