Skip to content

Instantly share code, notes, and snippets.

@anant1811
anant1811 / 0_reuse_code.js
Created January 16, 2016 19:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@anant1811
anant1811 / functions.php
Created July 23, 2016 10:06
Customise WordPress "Leave a Reply" title
//Change comment section title
function comment_reform ($arg) {
$arg['title_reply'] = __('Leave a comment:');
return $arg;
}
add_filter('comment_form_defaults','comment_reform');
@anant1811
anant1811 / style.css
Last active July 23, 2016 14:51
Remove link outline
/*Remove dotted outline from links/link elements*/
a, a:hover, a:active, a:focus {
outline: 0;
}
@anant1811
anant1811 / acf-genesis-template.php
Last active December 4, 2019 06:54
ACF with Genesis Page templates
<?php
/**
* ACF compatible genesis page template
*
* @author StudioPress
* @package Altitude
* @subpackage Customizations
*/
/*
@anant1811
anant1811 / transfer.php
Created July 25, 2016 15:43
Transfer php script
<?php
set_time_limit(0); //Unlimited max execution time
$path = 'wp-content.zip';
$url = 'http://mysite.com/wp-content.zip';
$newfname = $path;
echo 'Starting Download!<br>';
$file = fopen ($url, "rb");
if($file) {
$newf = fopen ($newfname, "wb");
@anant1811
anant1811 / genesis-hooks-html
Last active August 1, 2016 14:11
Genesis Hooks - HTML Code
<div class="my-genesis-html"><p>Hello there!</p></div>
@anant1811
anant1811 / genesis-conditional-example.php
Created August 1, 2016 14:39
Genesis hook with conditional for front page
<?php
if ( ( is_front_page() ) )
{ ?>
<h2 class="seo-description">Hi there! I'm Ashish Anant - a WordPress and Genesis developer, web designer and consultant from India. Know <a href="/about/">more about me</a>, see <a href="/work">my work</a> and <a href="/project-planner/">contact me here</a>.</h2>
<?php }
?>
@anant1811
anant1811 / woo-custom-redirect
Last active September 28, 2016 07:11
Woocommerce - custom redirection on checkout
//*Add custom redirection
add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' );
function wc_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'http://mysite.com/thank-you-for-your-order/' );
exit;
}
}
<div class="wpps-fullwidth">
<div>
[YOUR CONTENT HERE....]
</div>
</div>