- XAMPP for Windows: https://www.apachefriends.org/de/download.html
- Download Xdebug for:
<?php | |
// Enter MailChimp API key and List Id. | |
$api_key = 'YOUR API KEY'; | |
$list_id = 'YOUR LIST ID'; | |
$dc = substr($api_key,strpos($api_key,'-')+1); // datacenter, it is the part of your api key - us5, us8 etc | |
$args = array( | |
'headers' => array( | |
'Authorization' => 'Basic ' . base64_encode( 'user:'. $api_key ) |
<?php | |
$api_key = 'YOUR API KEY'; | |
$list_id = 'YOUR LIST ID'; | |
$dc = substr($api_key,strpos($api_key,'-')+1); // us5, us8 etc | |
$args = array( | |
'headers' => array( | |
'Authorization' => 'Basic ' . base64_encode( 'user:'. $api_key ) | |
) | |
); |
<?php | |
function custom_loginlogo() { | |
echo '<style type="text/css">h1 a {background-image: url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } | |
</style>'; | |
} | |
add_action('login_head', 'custom_loginlogo'); |
<?php | |
add_filter( 'login_headerurl', 'custom_loginlogo_url' ); | |
function custom_loginlogo_url($url) { | |
return 'http://www.wordpress.com'; | |
} |
<?php | |
function set_featured_image($url,$post_id) { | |
$attachment_id = media_sideload_image( $url, $post_id, '', 'id' ); | |
if ( ! is_wp_error( $attachment_id ) ) { | |
set_post_thumbnail( $post_id, $attachment_id ); | |
} | |
} |
<?php | |
add_filter('woocommerce_get_order_item_totals','cs_add_discount',10,3); | |
function cs_add_discount($total_rows, $order, $tax_display) { | |
if ( $order->get_total_discount() > 0 ) { | |
$coupons = $order->get_used_coupons(); | |
$total_rows['couponused'] = array( | |
'label' => __( 'Coupon code:', 'woocommerce' ), | |
'value' => '' . implode(",",$coupons), ); | |
} |
<?php | |
add_action( 'after_setup_theme', 'cs_remove_woo_gallery_lightbox', 100 ); | |
function cs_remove_woo_gallery_lightbox() { | |
remove_theme_support( 'wc-product-gallery-lightbox' ); | |
} |
<?php | |
function cs_wcmenucart($menu, $args) { | |
global $woocommerce; | |
$viewing_cart = __('View your shopping cart', 'your-theme-slug'); | |
$start_shopping = __('Start shopping', 'your-theme-slug'); | |
$cart_url = $woocommerce->cart->get_cart_url(); | |
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); | |
$cart_contents_count = $woocommerce->cart->cart_contents_count; |
<?php | |
function convert_time_one_timezone_to_other_timezone( $current_timezone = '', $time = '', $convert_to_timezone = 'EST' ) { | |
$utc_date = DateTime::createFromFormat( | |
'G:i', | |
"$time", | |
new DateTimeZone("$current_timezone") | |
); |