This file contains hidden or 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
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
This file contains hidden or 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 | |
/** | |
* Setup wp_query arguments for the loop. Cache the results for 4 hours. | |
* | |
* @link http://codex.wordpress.org/Transients_API | |
*/ | |
// Check for transient | |
if ( false === ( $my_query = get_transient( 'foo_featured_posts' ) ) ) { | |
This file contains hidden or 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 get_post_taxonomies($post) { | |
// Passing an object | |
// Why another var?? $output = 'objects'; // name / objects | |
$taxonomies = get_object_taxonomies($post, 'objects'); | |
/*// Passing a string using get_post_type: return (string) post, page, custom... | |
$post_type = get_post_type($post); | |
$taxonomies = get_object_taxonomies($post_type, 'objects');*/ |
This file contains hidden or 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
/* normal flexbox */ | |
.flexbox .flex-container { | |
display: -webkit-flex; | |
display: -moz-flex; | |
display: -ms-flex; | |
display: flex; | |
} | |
.flexbox .flex-container.vertical { | |
display: -webkit-flex; | |
display: -moz-flex; |
This file contains hidden or 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 | |
/** | |
* Plugin Name: T5 Strip double spaces in posts | |
* Description: Replaces [space + no-break-space] with a regular space. | |
* Plugin URI: http://wordpress.stackexchange.com/questions/75197/remove-double-space-after-a-period | |
* Version: 2012.12.06 | |
* Author: Thomas Scholz | |
* Author URI: http://toscho.de | |
* Licence: MIT | |
* License URI: http://opensource.org/licenses/MIT |
This file contains hidden or 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
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); | |
function custom_pre_get_posts_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$q->set( 'tax_query', array(array( |
This file contains hidden or 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 | |
/** | |
* Hide editor on specific pages. | |
* | |
*/ | |
add_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
// Get the Post ID. |
This file contains hidden or 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 | |
/** | |
* Fix compatibility issues with The Event Calendar and Posts 2 Posts WordPress Plugins | |
* Issue arrises with how nested select queries function when P2P expects a single column. | |
*/ | |
function tribe_to_p2p_pre_get_posts_20121001( $query ){ | |
if(isset($query->_p2p_capture) && $query->_p2p_capture) { | |
add_filter( 'posts_fields', 'tribe_to_p2p_setupFields_20121001', 20); |
This file contains hidden or 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
/** | |
* Extend Recent Posts Widget | |
* | |
* Adds different formatting to the default WordPress Recent Posts Widget | |
*/ | |
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { | |
function widget($args, $instance) { | |