Skip to content

Instantly share code, notes, and snippets.

View NateJLewis's full-sized avatar
🎯
Focusing

Nate Lewis NateJLewis

🎯
Focusing
View GitHub Profile
<section id="home-sub-hero" class="container-fluid">
<article class="row center-xs around-xs">
<div class="col-xs-12 col-md-8"><?php
if( get_field( 'subhero_heading', $post_id ) ) :
?><h3 class="subhero_heading"><?php
_e( the_field( 'subhero_heading', $post_id ), '_tvk' );
?></h3><?php
endif;
if( get_field( 'subhero_content', $post_id ) ) :
?><div class="subhero_content"><?php
@NateJLewis
NateJLewis / extras.php
Created July 14, 2016 22:46
Months of the year, Next year, Countries, US States functions for WordPress includes
<?php
function _pit_month_names() {
for ( $m=1; $m<=12; $m++ ) {
$months[] = array(
'month_display_name' => date( 'F', mktime( 0,0,0, $m, 1, date('Y') ) ),
'month_attr_name' => date( 'M', mktime( 0,0,0, $m, 1, date('Y') ) ),
);
}
return $months;
/*
Welcome to Custom CSS!
CSS (Cascading Style Sheets) is a kind of code that tells the browser how
to render a web page. You may delete these comments and get started with
your customizations.
By default, your stylesheet will be loaded after the theme stylesheets,
which means that your rules can take precedence and override the theme CSS
rules. Just write here what you want to change, you don't need to copy all
@NateJLewis
NateJLewis / material-design.php
Last active June 29, 2016 01:22
WordPress theme file to include social media, Google Material, and other svg icons.
<?php
// Include in your theme functions.php:
// require get_template_directory() . '/includes/svg/social-media-icons.php';
// require get_template_directory() . '/includes/svg/material-design.php';
//
// Add the desired function in the appropriate theme file
// _themename_md_expand_more()
//
// If a class or id is needed include them as param1, param 2
// _themename_md_expand_more( 'class1 class2', 'id' )
<section id="author-box" class="col-xs-12 col-md-6">
<?php
$site_url = site_url();
$img_icon_dir = get_template_directory_uri() . '/assets/images/icons/';
$facebook_icon = $img_icon_dir . 'facebook_white_bg.png';
$twitter_icon = $img_icon_dir . 'twitter_white_bg.png';
$youtube_icon = $img_icon_dir . 'youtube_white_bg.png';
$instagram_icon = $img_icon_dir . 'instagram_white_bg.png';
$googleplus_icon = $img_icon_dir . 'google_plus_white_bg.png';
$pinterest_icon = $img_icon_dir . 'pinterest_white_bg.png';
function shareFbUi(data) {
FB.ui({
href: data.href,
hashtag: data.hashtag,
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:url': data.href,
'og:title': data.title,
<?php
/*
*
*
* Add acf repeater fields that have different classes to style them depending on how many.
*
*
*/
add_action( 'genesis_entry_content', 'contact_page_boxes_row_1', 1 );
function contact_page_boxes_row_1() {
<?php
/**
* Template part for the home page.
*
* @package _njl
*/
// check if the flexible content field has rows of data
if( have_rows('content') ):
// loop through the rows of data
while ( have_rows('content') ) : the_row();
(function ($) {
var siteUrl = '<?php echo site_url()?>';
$('#wp_contact_us_modal')
.on('show.bs.modal', function (event) {
var formBtn = $(event.relatedTarget);
var form = $('form.wp_contact_us_form');
form.on('submit', function (event) {
event.preventDefault();
form.validate();
if (form.valid()) {
function validateForm() {
// set variable isItValid so its available outside the .each() function
var isItValid;
// check each size hidden input for a value
$('.product_choices .row .size.required').each(function() {
// if the value is empty show the alert
// set isItValid variable to false
if ($(this).val() == "") {
$('.modal-title').addClass('hidden');
$('#choose_size').removeClass('hidden');