Skip to content

Instantly share code, notes, and snippets.

Brad Williams braginteractive

View GitHub Profile
@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 / 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 / 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>
@braginteractive
braginteractive / hero-contact7.html
Created Feb 20, 2018
LeadGenWP - Hero Contact Form Markup
View hero-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="form-group col-md-6">
<label for="firstname">First name</label>[text* first-name id:firstname class:form-control]
</div>
<div class="form-group col-md-6">
View button-with-icon.html
<i class="fas fa-comments"></i> Free Estimate
@braginteractive
braginteractive / logo-size.css
Created Jan 22, 2018
Additional CSS Logo Customization
View logo-size.css
.logo a img {
max-width: 250px;
}
@braginteractive
braginteractive / posts-pagination.php
Created Dec 22, 2017
Font Awesome Posts Pagination for WordPress
View posts-pagination.php
the_posts_pagination (
array(
'prev_text' => '<i class="fa fa-arrow-left" aria-hidden="true"></i><span class="screen-reader-text">' . __( 'Previous Page', 'textdomain' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next Page', 'textdomain' ) . '</span><i class="fa fa-arrow-right" aria-hidden="true"></i>',
)
);
@braginteractive
braginteractive / wordpress-excerpt-function.php
Created Dec 22, 2017
Edit the WordPress excerpt to remove everything after the first sentence.
View wordpress-excerpt-function.php
/**
* Find the first period in the excerpt and remove everything after it.
*
*
* @param string $excerpt The post excerpt.
*/
function end_with_sentence($excerpt) {
return substr($excerpt,0,strpos($excerpt,'.')+1);
}
add_filter( 'the_excerpt', 'end_with_sentence');
@braginteractive
braginteractive / customizer.php
Created Dec 13, 2017
Add Bootswatch to StrapPress
View customizer.php
if ( class_exists('Kirki') ) {
Kirki::add_config( 'strappress_theme', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
/* Add Bootswatch to Colors Section */
Kirki::add_field( 'strappress_theme', array(
'type' => 'radio-image',
'settings' => 'bootswatch_css',
@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";
}
You can’t perform that action at this time.