Skip to content

Instantly share code, notes, and snippets.

View vermasachin's full-sized avatar
🏠
Working from home

Sachin Verma vermasachin

🏠
Working from home
View GitHub Profile
@vermasachin
vermasachin / 301Redirect
Created November 19, 2013 16:00
301 Redirect
# Using permanent redirect
Redirect 301 / http://www.newdomain.com/
# redirect ends
@vermasachin
vermasachin / RegisterWidgetArea
Created November 19, 2013 16:27
How to Register Widget Area
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'below-post',
'name' => __( 'Below Post', 'genesis' ),
'description' => __( 'This is the below post widget.', 'themename' ),
) );
@vermasachin
vermasachin / Opt-inAfterSinglePost
Last active December 28, 2015 19:09
Opt-in After Single Post
/** Add the below post section */
add_action( 'genesis_entry_footer', 'below_post_text' );
function below_post_text() {
if ( is_single() )
{
genesis_widget_area( 'below-post', array(
'before' => '<div class="below-post widget-area">',
) );
}}
@vermasachin
vermasachin / Opt-inCode
Last active December 28, 2015 19:09
Opt-in Code
<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">Do you get my Freebies?</div></center>
<div class="mc-field-group"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<div class="optinbutton"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
<div class="mc-field-text" >Subscribe now to receive discounts, special offers and freebies direct to your inbox.</div></div></form>
</div>
@vermasachin
vermasachin / HorizontalOpt-inCSS
Last active December 28, 2015 19:29
Horizontal Opt-in CSS
/** MailChimp Custom Style for Horizontal Bar form **/
.mc-embed-signup {
float: left;
padding: 20px;
padding: 2rem;
border: 15px solid #e3e3e3;
background: #f9f9f9;
width: 100%;
@vermasachin
vermasachin / Opt-inAfterSinglePostsAndPages
Created December 21, 2013 14:08
Opt-in After Single Posts and Pages
/** Add the below post section */
add_action( 'genesis_entry_footer', 'below_post_text' );
function below_post_text() {
if ( is_page() || is_single() )
{
genesis_widget_area( 'below-post', array(
'before' => '<div class="below-post widget-area">',
) );
}}
@vermasachin
vermasachin / SocialShareURLs
Last active January 1, 2016 01:48
Social Share URLs
Twitter
http://twitter.com/home?status=[TITLE]+[URL]
Digg
http://www.digg.com/submit?phase=2&url=[URL]&title=[TITLE]
Facebook
http://www.facebook.com/share.php?u=[URL]&title=[TITLE]
StumbleUpon
@vermasachin
vermasachin / WordPressFunctionsTitle
Created December 22, 2013 13:06
WordPress Functions Title
<?php print(urlencode(the_title())); ?>
@vermasachin
vermasachin / WordPressFunctionsURL
Created December 22, 2013 13:07
WordPress Functions URL
<?php print(urlencode(get_permalink())); ?>
@vermasachin
vermasachin / SocialShareFacebook
Created December 22, 2013 13:14
Social Share Facebook
http://www.facebook.com/share.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>