Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
Working actively on @designblocks

Haris Zulfiqar mharis

😇
Working actively on @designblocks
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 wp.php
<?php
if( is_page( 'Home' ) ) {
echo 'This is a homepage';
} else if( is_page( 'About' ) ) {
echo 'About Me';
}
View SMOF2Redux.php
function SMOFtoRedux() {
global $of_options;
$options = $of_options;
$sections = array();
$section = array();
$fields = array();
foreach($options as $key=>$value) {
foreach ($value as $k=>$v) {
if (empty($v)) {
unset($value[$k]);
View generate_options_css.php
function generate_options_css($newdata) {
/** Define some vars **/
$data = $newdata;
$uploads = wp_upload_dir();
$css_dir = get_template_directory() . '/css/'; // Shorten code, save 1 call
/** Save on different directory if on multisite **/
if(is_multisite()) {
$aq_uploads_dir = trailingslashit($uploads['basedir']);
} else {
View TGM config modified for Kallyas
<?php
define( 'THEMENAME', 'Kallyas' );
require_once dirname( __FILE__ ) . '/framework/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'kallyas_register_required_plugins' );
function kallyas_register_required_plugins() {
/**