This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( !is_admin() ) { | |
$theme = get_theme( get_current_theme() ); | |
wp_register_style( 'your-style', get_bloginfo( 'stylesheet_directory' ) . '/css/ie.css', false, $theme['Version'] ); | |
$GLOBALS['wp_styles']->add_data( 'your-style', 'conditional', 'lte IE 8' ); | |
wp_enqueue_style( 'your-style' ); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'get_field_ext' ) && ( function_exists( 'get_field' ) ) ) { | |
/** | |
* Extends the default ACF get_field function to allow options for a default value and fallback to global option | |
* | |
* @author Gabe Shackle <gabe@hereswhatidid.com> | |
* @param string $name Field name | |
* @param mixed $default Default value if none found | |
* @param integer $id Post ID to check the field value of | |
* @return mixed Value after running checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here is what I have in the LESS | |
.furniture-details { | |
text-align: justify; | |
*, *:before, *:after { | |
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; | |
} | |
.detail-column { | |
display: inline-block; | |
vertical-align: top; | |
text-align: left; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function override_video_dimensions( $out, $pairs, $atts ) { | |
$out['width'] = '768'; | |
$out['height'] = '583'; | |
return $out; | |
} | |
add_filter( 'shortcode_atts_video', 'override_video_dimensions', 10, 3 ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode('sample', 'sample_shortcode'); | |
function sample_shortcode($attr, $content = null) { | |
extract(shortcode_atts(array( | |
'title' => 'Hello, World!', | |
'testatt' => 'itworks' | |
), $attr, 'sample')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Register Custom Post Type | |
function custom_post_type() { | |
$labels = array( | |
'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( 'Product', 'text_domain' ), | |
'parent_item_colon' => __( 'Parent Product:', 'text_domain' ), | |
'all_items' => __( 'All Products', 'text_domain' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add custom attribute to the 'caption' shortcode | |
* | |
* ex: | |
* [caption id="attachment_883" align="alignnone" width="259" use_figure="yes"]<a href="image.jpg"><img class="size-full wp-image-883" alt="This is a caption." src="image.jpg" width="259" height="195" /></a> This is a caption.[/caption] | |
* | |
* @param array $out The output array of shortcode attributes | |
* @param array $pairs The array of accepted parameters and their defaults | |
* @param array $atts The input array of shortcode attributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'registered_post_type', 'display_registered_post_types', 99999, 2 ); | |
global $tempPostTypes; | |
$tempPostTypes = array(); | |
function display_registered_post_types( $post_type, $args ) { | |
global $tempPostTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "hereswhatidid/install-wordpress-test", | |
"description" : "Test project for WordPress stack via Composer", | |
"authors" : [ | |
{ | |
"name" : "Gabe Shackle", | |
"email" : "gabe@hereswhatidid.com", | |
"homepage": "http://www.hereswhatidid.com/" | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', 'header_scripts' ); | |
function header_scripts() { | |
echo '<!--Start of Zopim Live Chat Script-->'."\n"; | |
echo '<script type="text/javascript">'."\n"; | |
echo 'window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s='."\n"; | |
echo 'd.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.'."\n"; | |
echo '_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute(\'charset\',\'utf-8\');'."\n"; | |
echo '$.src=\'//v2.zopim.com/?1JmbWASHEGvl7oxKGkdaQzNfQYWLE7El\';z.t=+new Date;$.'."\n"; |