Skip to content

Instantly share code, notes, and snippets.

View vermasachin's full-sized avatar

Sachin Verma vermasachin

View GitHub Profile
@vermasachin
vermasachin / style.css
Last active August 29, 2015 13:56
Responsive Social Share Genesis CSS
/**************
Custom Social Share Buttons
Author: Sachin Verma
Author URL: www.bitdoz.com
***************/
.dashicons {
line-height: inherit !important;
@vermasachin
vermasachin / functions.php
Last active August 29, 2015 13:56
Responsive Social Share Buttons Genesis
/** Add custom social share icons **/
add_action( 'genesis_entry_header', 'single_post_social_share' );
function single_post_social_share() {
if ( is_single() ) { ?>
<div class="social-sharer">
<div class="share-love">
<div class="share-text"><div class="dashicons dashicons-share"></div> Share it!</div>
</div>
<!-- Facebook Share -->
<a href="http://www.facebook.com/share.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>" target="_blank"><div class="share-facebook"><div class="share-text"><div class="dashicons dashicons-facebook-alt"></div> Share <div class="longtext">on Facebook</div></div></div></a>
@vermasachin
vermasachin / functions.php
Last active August 29, 2015 13:56
Enable Dashicons in WordPress
//* Add support for WordPress dashicons
add_action( 'wp_enqueue_scripts', 'themename_scripts' );
function themename_scripts() {
wp_enqueue_style( 'themename-style', get_stylesheet_uri(), array( 'dashicons' ), '1.0' );
}
@vermasachin
vermasachin / functions.php
Last active August 29, 2015 13:56
Custom Opt-in for WordPress
//Add opt-in after post
function custom_content_after_post($content){
if (is_single()) {
$content .= '<div class="mc-embed-signup" >
<form action="http://bitdoz.us7.list-manage.com/subscribe/post?u=46e6cfce0bf832f92f8cb6811&amp;id=72fccd0103" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<center><div class="mc-field-text-top" style="font-weight: bold;font-size:30px;">Do you get my Freebies?</div></center>
<div class="mc-field-group"><input type="email" style="max-width:380px; margin:3px; float:left; " value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<div class="optinbutton"><input type="submit" style="margin:4px; background-color: #f15123; float:left;" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
<div class="mc-field-text" style="float:left;">Subscribe now to receive discounts, special offers and freebies direct to your inbox.</div></div></form>
</d
@vermasachin
vermasachin / Custom Social Share for WordPress
Created February 27, 2014 18:39
Custom Social Share for WordPress
add_filter( 'the_content', 'bitdoz_add_single_social_share', 20 );
function bitdoz_add_single_social_share($content) {
if ( is_single() )
echo '
<div class="social-sharer">
<div class="share-love">
<center><div class="share-text"><i class="icon-share"></i> Share it!</div></center>
</div>
@vermasachin
vermasachin / Custom Widget for Ads Above Post Title
Created February 25, 2014 14:47
Custom Widget for Ads Above Post Title
/** Register above Post title widget for ads */
genesis_register_sidebar( array(
'id' => 'above-post-title',
'name' => __( 'Above Post Title', 'bitdoz' ),
'description' => __( 'This is the above post title widget.', 'bitdoz' ),
) );
/** Add the above post title widget for ads */
add_action( 'genesis_before_entry', 'above_post_title' );
function above_post_title() {
@vermasachin
vermasachin / Custom Widget for Ads Below Post Title
Created February 25, 2014 14:43
Custom Widget for Ads Below Post Title
/** Register below Post title widget for ads */
genesis_register_sidebar( array(
'id' => 'below-post-title',
'name' => __( 'Below Post Title', 'bitdoz' ),
'description' => __( 'This is the below post title widget.', 'bitdoz' ),
) );
/** Add the below post title widget for ads */
add_action( 'genesis_entry_header', 'below_post_title' );
function below_post_title() {
@vermasachin
vermasachin / Custom Widget for Ads After Content
Created February 25, 2014 14:40
Custom Widget for Ads After Content
/** Register below content section for ads */
genesis_register_sidebar( array(
'id' => 'below-content',
'name' => __( 'Below Content', 'bitdoz' ),
'description' => __( 'This is the below content widget.', 'bitdoz' ),
) );
/** Add the below content section for ads */
add_action( 'genesis_entry_footer', 'below_content_widget' );
function below_content_widget() {
@vermasachin
vermasachin / Custom Widget for Ads After Comments
Last active August 29, 2015 13:56
Custom Widget for Ads After Comments
/** Register below comments section for ads */
genesis_register_sidebar( array(
'id' => 'below-comments',
'name' => __( 'Below Comments', 'bitdoz' ),
'description' => __( 'This is the below comments widget.', 'bitdoz' ),
) );
/** Add the below comments section for ads */
add_action( 'genesis_loop', 'below_comments_widget' );
function below_comments_widget() {
@vermasachin
vermasachin / Custom Social Share Front Page
Created February 21, 2014 15:27
Custom Social Share Front Page
add_action( 'YOUR_HOOK_HERE', 'single_post_social_share' );
function single_post_social_share() {
if ( is_front_page() ) { ?>
<div class="social-sharer">
<div class="share-love">
<center><div class="share-text"><i class="icon-share"></i> Share it!</div></center>
</div>
<div class="share-facebook">