Skip to content

Instantly share code, notes, and snippets.

View braginteractive's full-sized avatar

Brad Williams braginteractive

View GitHub Profile
@braginteractive
braginteractive / tgm-plugin-activation.php
Created May 1, 2017 21:08
TGM Plugin Activation file for Kirki
<?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 / post.js
Created July 22, 2015 19:20
Console log POST data in PHP
<script>
console.log(<?php echo json_encode($_POST); ?>);
</script>
@braginteractive
braginteractive / color-picker.js
Created June 30, 2015 18:04
Sample Meta Box for WordPress
jQuery(document).ready(function($){
$('.meta-color').wpColorPicker();
});
@braginteractive
braginteractive / gulpfile.js
Created August 13, 2018 19:41
Gulp 4 and WordPress Development
// 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 / gulpfile.js
Created April 18, 2017 18:40
Gulp file for WordPress Theme
// 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 February 14, 2020 16:57
WordPress Walker Menu for Bootstrap
<?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 June 17, 2019 14:18
WordPress archive page for custom post type with filter
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WP Theme
*/
get_header(); ?>
@braginteractive
braginteractive / extras.php
Created April 7, 2017 05:24
WordPress Filter to change the Custom Logo class
/**
* 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 April 14, 2017 15:40
Twenty Seventeen Child WordPress Theme
<?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 / materialleades-contact7.html
Created February 20, 2018 18:22
MaterialLead - Hero Contact Form Markup
<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>