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_filter('the_content', 'set_first_word_color', 10); | |
| function set_first_word_color( $content ) | |
| { | |
| $color = '#FF0000'; | |
| $pos = strpos(ltrim($content), ' '); | |
| $new_content = '<span style="color: '.$color.'"'.substr($content, 0, $pos).'</span>'.substr($content, $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
| add_filter('woocommerce_get_sale_price', 'my_custom_price', 99, 2); | |
| add_filter('woocommerce_get_price', 'my_custom_price', 99, 2); | |
| function my_custom_price( $price, $product ) | |
| { | |
| //your logic for calculating the new price here | |
| //Half price for VIP-customers | |
| if( in_array('vip', get_userdata(get_current_user_id())->roles ) |
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
| #!/bin/bash | |
| while : | |
| do | |
| eject | |
| eject -t | |
| done |
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
| $product_ids_raw = $wpdb->get_results( | |
| "SELECT wp_posts.ID, wp_posts.post_parent | |
| FROM wp_posts | |
| INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) | |
| INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) | |
| WHERE | |
| wp_posts.post_status = 'publish' | |
| AND (mt1.meta_key = '_sale_price_dates_to' AND mt1.meta_value >= ".time().") | |
| GROUP BY wp_posts.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
| //Set products per row | |
| add_filter( 'loop_shop_columns', create_function( '$cols', 'return 3;' ), 20 ); | |
| //Set products per page | |
| add_filter( 'loop_shop_per_page', create_function( '$num', 'return 12;' ), 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
| jQuery(function($){ | |
| $('.thumbnails>a>img').click(function(e){ | |
| e.stopPropagation(); | |
| $('.woocommerce-main-image img').attr('src', $(this).attr('src').replace('-87x87','-564x564')); | |
| return false; | |
| }); | |
| }); |
NewerOlder