Skip to content

Instantly share code, notes, and snippets.

View curtismchale's full-sized avatar

Curtis McHale curtismchale

View GitHub Profile
<?php
/**
* Registers and enqueues scripts and styles
*
* @uses wp_enqueue_style
* @uses wp_enqueue_script
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*/
config/app_config.yml
config/database.yml
config/*.sphinx.conf
config/s3_credentials.yml
*~
*.cache
*.log
*.pid
tmp/**/*
.DS_Store
@curtismchale
curtismchale / comment_form.php
Last active June 20, 2016 22:19
Adds required inside labels
/**
* Changes the default WordPress comment form fields to match the way I like them, with the required * inside
* the label.
*
* @param array $fields req The default fields for WordPress comment forms
* @return array The fields the way we want them to look
*
* @uses wp_get_current_user
* @uses get_option
*
/**
* Builds out the custom post types for the site
*
* @uses register_post_type
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*/
function add_cpt(){
@curtismchale
curtismchale / only-top-term-filters.php
Created May 25, 2016 17:40
Only lets the top level term in the permalink structure
<?php
function wpse147453_remove_child_categories_from_permalinks( $permalink, $post, $leavename, $sample ) {
if ( in_array( $post->post_type, array( 'focus_courses' ) ) ) {
// Allow for slug to be editable
$slug = $leavename ? '%' . $post->post_type . '%' : $post->post_name;
// Generate premalink prefix based on post type
$prefix = 'courses';
// add parent term slug
$term_slug = focus_top_term( $post );
@curtismchale
curtismchale / mastermind-format
Created September 4, 2013 19:55
Basic format for mastermind notes
Billy Bob Thorton wasn't here because he was abducted by aliens again.
### $name
- point form covering what they talk about during the call
- include goals that are accomplished
**Goals from last week**
**Goals**
@curtismchale
curtismchale / remove-images.php
Created February 10, 2012 20:38
remove images from content
function sfn_remove_the_images( $content = null ){
global $post;
if( $post->post_type == 'post' && !empty( $post->post_content ) ){
$content = $post->post_content;
$content = preg_replace('/<img[^>]+./','', $content);
}
@curtismchale
curtismchale / remove-poll-daddy.php
Created February 10, 2012 20:37
remove polldaddy from content
/**
* Removing the poll from the main content since
* we push it in to the sidebar
*
* @since 1.0
*/
function sfn_remove_poll_daddy( $content = null ){
global $post;
$content = $post->post_content;
@curtismchale
curtismchale / comienzo-js.php
Created December 20, 2011 05:16
Current JS file for my WordPress Development Theme
<?php
/**
* Adds scripts to the front end of the site
*
* Most scripts are only needed on the front end of the site
* and the function below makes sure jQuery is ready then adds
* the scripts we need for the site
*
* @uses wp_enqueue_script
@curtismchale
curtismchale / tinymce-custom-classes.php
Created November 30, 2011 03:23
Adds buttons/wrappers to tinymce for WordPress
<?php
// adds our custom style buttons
/**
* Filter TinyMCE Buttons
*
* Here we are filtering the TinyMCE buttons and adding a button
* to it. In this case, we are looking to add a style select
* box (button) which is referenced as "styleselect". In this