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
||region-test.komiflo.com/region-test.gif$image,redirect=1x1-transparent.gif,domain=komiflo.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
function assets() { | |
// enqueue your script | |
wp_enqueue_script('handle', get_template_directory_uri() . '/path/to/main.js', ['jquery'], '$ver', true); | |
// localize script | |
wp_localize_script('handle', 'custom_ajaxify', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); | |
} | |
add_action('wp_enqueue_scripts', 'assets', 100); | |
/** | |
* AJAX load template part |
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 ( $wp_query->max_num_pages > 1 ) : ?> | |
<script> | |
var ajaxurl = '<?php echo site_url() ?>/wp-admin/admin-ajax.php'; | |
var true_posts = '<?php echo serialize($wp_query->query_vars); ?>'; | |
var current_page = <?php echo (get_query_var('paged')) ? get_query_var('paged') : 1; ?>; | |
var max_pages = '<?php echo $wp_query->max_num_pages; ?>'; | |
</script> | |
<div id="true_loadmore" class="btn">Load more</div> | |
<?php endif; ?> |
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 | |
/** | |
* Change text strings | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function my_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Sale!' : | |
$translated_text = __( 'Clearance!', 'woocommerce' ); |
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 | |
/** | |
* Plugin Name: WooCommerce - List Products by Tags | |
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-tags/ | |
* Description: List WooCommerce products by tags using a shortcode, ex: [woo_products_by_tags tags="shoes,socks"] | |
* Version: 1.0 | |
* Author: Remi Corson | |
* Author URI: http://remicorson.com | |
* Requires at least: 3.5 | |
* Tested up to: 3.5 |
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
/** | |
* | |
* Filter gateways on specific category ID | |
* | |
**/ | |
function filter_gateways($gateways){ |
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
// Add Cart to Checkout // | |
add_action( 'woocommerce_before_checkout_form', 'lk_show_cart', 5 ); | |
function lk_show_cart() | |
{ | |
global $woocommerce; | |
?> | |
<form action="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" method="post"> |
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
function lk_aussie_gateways( $available_gateways ) { | |
global $woocommerce; | |
if ($woocommerce->customer->get_country() == 'AU') { | |
unset( $available_gateways['cod'] ); | |
} | |
return $available_gateways; |
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
add_filter( 'comments_template', 'USEGENERIC_woocommerce_comments', 100); | |
function USEGENERIC_woocommerce_comments( $template ) { | |
$template = STYLESHEETPATH . '/comments.php'; | |
return $template; | |
} |
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
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields'); | |
function custom_woocommerce_billing_fields( $fields ) { | |
$fields['billing_address_1']['class'] = array( 'form-group' ); | |
$fields['billing_address_1']['input_class'] = array( 'form-control' ); | |
return $fields; | |
} |
NewerOlder