Skip to content

Instantly share code, notes, and snippets.

View kevinwhoffman's full-sized avatar

Kevin W. Hoffman kevinwhoffman

View GitHub Profile
@kevinwhoffman
kevinwhoffman / dequeue-styles.php
Last active October 6, 2015 18:17
Dequeue Styles
<?php
// Code used by plugin to enqueue styles
wp_enqueue_style('wpProQuiz_front_style', plugins_url('css/wpProQuiz_front'.(WPPROQUIZ_DEV ? '' : '.min').'.css', WPPROQUIZ_FILE), array(), WPPROQUIZ_VERSION );
wp_enqueue_style( 'sfwd_front_css', plugins_url( 'assets/css/front.css', dirname( __FILE__ ) ) );
wp_enqueue_style( 'sfwd_template_css', get_stylesheet_directory_uri().'/learndash/learndash_template_style.css' );
// My attempt at dequeuing styles
add_action( 'wp_print_styles', 'vms_dequeue_styles', 100 );
@kevinwhoffman
kevinwhoffman / zip-pricing.php
Last active August 29, 2015 14:25
Checking price based on zip code
$zip = '00001'; // $zip can be populated by form submission
$pricing = $array(
// zip => price associated with that zip
'00001' => 10,
'00002' => 15,
'00003' => 20
);
// check if zip exists within array, and return the matching price
@kevinwhoffman
kevinwhoffman / functions.php
Last active August 29, 2015 14:10
WordPress - functions.php Boilerplate
<?php
// Remove unnecessary menu items from admin menu
function remove_menus () {
if( is_admin() ) {
global $menu;
$restricted = array(
// __('Posts'),
// __('Comments')
);
@kevinwhoffman
kevinwhoffman / template.php
Created November 11, 2014 03:56
WordPress - Page Template Header
<?php
/* Template Name: Template Name */
?>
@kevinwhoffman
kevinwhoffman / loop-custom.php
Last active July 17, 2024 14:47
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@kevinwhoffman
kevinwhoffman / loop-csswizardry-grids.php
Last active August 29, 2015 14:07
WordPress - Loop within csswizardry-grids
<div class="grid">
<!--
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
--><div class="grid__item">
<!-- do stuff -->