Skip to content

Instantly share code, notes, and snippets.

Avatar

Haris Zulfiqar mharis

View GitHub Profile
View gulpfile.js
// Require our dependencies
const autoprefixer = require( 'autoprefixer' );
const babel = require( 'gulp-babel' );
const bourbon = require( 'bourbon' ).includePaths;
const browserSync = require( 'browser-sync' );
const cheerio = require( 'gulp-cheerio' );
const concat = require( 'gulp-concat' );
const cssnano = require( 'gulp-cssnano' );
const del = require( 'del' );
const eslint = require( 'gulp-eslint' );
View package.json
{
"name": "wd_s",
"version": "1.0.0",
"description": "A theme boilerplate for WebDevStudios.",
"main": "Gulpfile.js",
"dependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"bourbon": "^4.3.4",
"bourbon-neat": "^1.9.0",
View style.css
/*
Theme Name: Storefront Child Theme
Theme URI:
Template: storefront
Author: WebDevStudios
Author URI: https://webdevstudios.com
Description: A storefront child theme.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@mharis
mharis / submenu.js
Created Oct 19, 2018
Accessible submenus
View submenu.js
/**
* File submenu-toggle.js
*
* Allow submenus to be toggled by keyboard.
*/
window.subMenuToggler = {};
( function( window, $, app ) {
// Constructor.
app.init = function() {
View gist:9f09941b2e09d0843418d8dfb9d94069
<label class="toggle-button">
<span class="screen-reader-text"><?php esc_html_e( 'Toggle between Yearly and Monthly Pricing.', 'maintainn' ); ?></span>
<input id="monthly-yearly-toggle" type="checkbox" checked />
<label>
<div class="toggle-button-switch"></div>
</label>
</label> <!-- .toggle-button -->
View gist:a8a017161dcb5425451ed2b32df7e4a1
git diff --name-status --color prod HEAD > changelog.txt
View ts-make-pot.php
<?php
require_once dirname( __FILE__ ) . '/makepot.php';
if ( !defined( 'STDERR' ) ) {
define( 'STDERR', fopen( 'php://stderr', 'w' ) );
}
/**
* Extend to add text domain check
View cart-cache-breaker.php
/** Break html5 cart caching */
add_action('wp_enqueue_scripts', 'cartcache_enqueue_scripts', 100);
function cartcache_enqueue_scripts()
{
wp_deregister_script('wc-cart-fragments');
wp_enqueue_script( 'wc-cart-fragments', get_template_directory_uri() . '/cart-fragments.js', array( 'jquery', 'jquery-cookie' ), '1.0', true );
}
View colors.scss
// Common social media colors
// More at http://brandcolors.net/
$dribbble-color:#ea4c89;
$facebook-color:#3b5998;
$github-color:#007bb6;
$google-color:#dd4b39;
$linkedin-color:#171515;
$rss-color:#ee802f;
$twitter-color:#00aced;
View wp.php
<?php
if( is_page( 'Home' ) ) {
echo 'This is a homepage';
} else if( is_page( 'About' ) ) {
echo 'About Me';
}