Skip to content

Instantly share code, notes, and snippets.

Avatar

Brad Williams braginteractive

View GitHub Profile
@braginteractive
braginteractive / color-picker.js
Created Jun 30, 2015
Sample Meta Box for WordPress
View color-picker.js
jQuery(document).ready(function($){
$('.meta-color').wpColorPicker();
});
@braginteractive
braginteractive / gulpfile.js
Created Aug 13, 2018
Gulp 4 and WordPress Development
View gulpfile.js
// Load all the modules from package.json
var gulp = require( 'gulp' ),
plumber = require( 'gulp-plumber' ),
autoprefixer = require('gulp-autoprefixer'),
watch = require( 'gulp-watch' ),
jshint = require( 'gulp-jshint' ),
stylish = require( 'jshint-stylish' ),
uglify = require( 'gulp-uglify' ),
rename = require( 'gulp-rename' ),
notify = require( 'gulp-notify' ),
@braginteractive
braginteractive / post.js
Created Jul 22, 2015
Console log POST data in PHP
View post.js
<script>
console.log(<?php echo json_encode($_POST); ?>);
</script>
@braginteractive
braginteractive / gulpfile.js
Created Apr 18, 2017
Gulp file for WordPress Theme
View gulpfile.js
// Load all the modules from package.json
var gulp = require( 'gulp' ),
plumber = require( 'gulp-plumber' ),
autoprefixer = require('gulp-autoprefixer'),
watch = require( 'gulp-watch' ),
jshint = require( 'gulp-jshint' ),
stylish = require( 'jshint-stylish' ),
uglify = require( 'gulp-uglify' ),
rename = require( 'gulp-rename' ),
notify = require( 'gulp-notify' ),
@braginteractive
braginteractive / bootstrap-walker-menu.php
Last active Feb 14, 2020
WordPress Walker Menu for Bootstrap
View bootstrap-walker-menu.php
<?php
// Custom Walker Class for Bootstrap Menu
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"dropdown-menu\">\n";
}
@braginteractive
braginteractive / business-archive.php
Created Jun 17, 2019
WordPress archive page for custom post type with filter
View business-archive.php
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WP Theme
*/
get_header(); ?>
@braginteractive
braginteractive / extras.php
Created Apr 7, 2017
WordPress Filter to change the Custom Logo class
View extras.php
/**
* Changes the class on the custom logo in the header.php
*/
function helpwp_custom_logo_output( $html ) {
$html = str_replace('custom-logo-link', 'navbar-brand', $html );
return $html;
}
add_filter('get_custom_logo', 'helpwp_custom_logo_output', 10);
@braginteractive
braginteractive / functions.php
Created Apr 14, 2017
Twenty Seventeen Child WordPress Theme
View functions.php
<?php
function my_theme_enqueue_styles() {
$parent_style = 'twentyseventeen-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
@braginteractive
braginteractive / tgm-plugin-activation.php
Created May 1, 2017
TGM Plugin Activation file for Kirki
View tgm-plugin-activation.php
<?php
/**
* This file represents an example of the code that themes would use to register
* the required plugins.
*
* It is expected that theme authors would copy and paste this code into their
* functions.php file, and amend to suit.
*
* @see http://tgmpluginactivation.com/configuration/ for detailed documentation.
*
@braginteractive
braginteractive / materialleades-contact7.html
Created Feb 20, 2018
MaterialLead - Hero Contact Form Markup
View materialleades-contact7.html
<div class="card">
<div class="card-header">
Request a free quote for your project
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="firstname" class="bmd-label-floating">First name</label>[text* first-name id:firstname class:form-control]
</div>