Skip to content

Instantly share code, notes, and snippets.

View chodhary's full-sized avatar

Rajat Chodhary chodhary

View GitHub Profile
@chodhary
chodhary / functions.php
Created May 20, 2017 20:14
Using Genesis and Bootstrap
<?php
//* Add Bootstrap container class to header
function my_site_bootstrap_header( $attributes ) {
$attributes['class'] = $attributes['class']. ' container-fluid';
return $attributes;
}
add_filter( 'genesis_attr_site-header', 'my_site_bootstrap_header' );
//* Add Bootstrap container wrap around page content
function my_site_start_page_container(){ echo '<div id="page-container" class="container-fluid"><div class="row">'; };
@chodhary
chodhary / function.php
Created July 28, 2016 18:30 — forked from mkdizajn/function.php
Wordpress Bootstrap 3 responsive images
<?php
//----------------------------------------------------------/
// responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
function bootstrap_responsive_images( $html ){
$classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
// check if there are already classes assigned to the anchor
if ( preg_match('/<img.*? class="/', $html) ) {
@chodhary
chodhary / Sublime Text 3 Build 3103 License Key - CRACK
Created July 24, 2016 19:17
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@chodhary
chodhary / custom-woocommerce-loop.php
Last active October 21, 2019 11:58 — forked from UltimateWoo/custom-woocommerce-loop.php
Custom query and loop for WooCommerce
<?php
if ( is_shop() || is_product_category() || is_product_tag() ) { // Only run on shop archive pages, not single products or other pages
// Products per page
$per_page = 24;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(
@chodhary
chodhary / maintenance
Created July 9, 2015 10:53
Maintenance Mode
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable',true,503);
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 172800');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
@chodhary
chodhary / gistIntro
Created July 7, 2015 12:19
Uncharted
<?php
/**
* Never leave anything uncharted. It is our responsibility to surprise our generation to come
*/
function love( $trust = '100', $patience = '0' ) {
// Let's make it amazing
}