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 $custom_terms = get_terms('mytaxonomyname'); | |
foreach($custom_terms as $custom_term) { | |
wp_reset_query(); | |
$args = array('post_type' => 'myposttypename', | |
'mytaxonomyname' => 'taxonomyitem', // might be unneccessary - test this | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'mytaxonomyname', | |
'field' => 'slug', |
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
// Utilities | |
//--------------------------- | |
// check if a function already exists | |
function function_exists (func_name) { | |
if (typeof func_name === 'string') { | |
func_name = this.window[func_name]; | |
} | |
return typeof func_name === 'function'; | |
} |
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( 'contextual_help', 'wptuts_screen_help', 10, 3 ); | |
function wptuts_screen_help( $contextual_help, $screen_id, $screen ) { | |
// The add_help_tab function for screen was introduced in WordPress 3.3. | |
if ( ! method_exists( $screen, 'add_help_tab' ) ) | |
return $contextual_help; | |
global $hook_suffix; | |
// List screen properties |
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 | |
// Utility function - allow us to strpos an array | |
if ( !function_exists( 'audio_strpos_arr' ) ) { | |
function audio_strpos_arr($haystack, $needle) { | |
if( !is_array($needle) ) $needle = array($needle); | |
foreach( $needle as $what ) { | |
if( ($pos = strpos($haystack, $what) ) !==false ) return $pos; | |
} |
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
curl -sS getcomposer.org/installer | php -d detect_unicode=Off | |
composer create-project laravel/laravel THE_PROJ_DIRECOTRY_NAME_YOU_WANT --prefer-dist | |
or using the new phar, copy it into usr/local/bin | |
run : | |
$ chmod +x /usr/local/bin/laravel |
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
//Remove prettyPhoto lightbox | |
add_action( 'wp_enqueue_scripts', 'fc_remove_woo_lightbox', 99 ); | |
function fc_remove_woo_lightbox() { | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); | |
wp_dequeue_script( 'prettyPhoto' ); | |
wp_dequeue_script( 'prettyPhoto-init' ); | |
} | |
//Add fancyBox lightbox - if thats what you want. |
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
global $woocommerce; ?> | |
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a> |
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 | |
/* Register custom post types on the 'init' hook. */ | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 0.1.0 | |
* @access public |
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
// Go to menue: | |
// find->find in files | |
// Switch on reg_ex button | |
// Find: | |
^(.*)$ | |
// alt | |
^.*\S+.*$ | |
// Where: | |
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/* |
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
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |