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 | |
$args = array( | |
'post_type' => 'cptui_post_slug', | |
'posts_per_page' => 10, | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC', | |
'paged' => $paged, | |
); | |
$post_name = new WP_Query( $args ); |
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
// Get featured image | |
<?php get_the_post_thumbnail_url(); ?> | |
// Content loop | |
<?php while (have_posts()) : the_post(); ?> | |
<?php the_content(); ?> | |
<?php endwhile; ?> |
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
var accordion_items = document.querySelectorAll('.accordion-item'); | |
if (accordion_items != null) { | |
var i = 0; | |
accordion_items.forEach(function (e) { | |
i++; | |
e.addEventListener('click', function () { | |
e.querySelector('.accordion-content').classList.toggle('active'); | |
}); | |
}) | |
} |
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_action( 'woocommerce_before_checkout_form', 'custom_apply_matched_coupons' ); | |
add_action( 'woocommerce_before_cart', 'custom_apply_matched_coupons' ); | |
function custom_apply_matched_coupons() { | |
$coupon_code = 'coupon_code_here'; | |
$cat_in_cart = false; | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
if ( has_term( 'product-category-slug', 'product_cat', $cart_item['product_id'] ) ) { |
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 getVisIpAddr() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
return $_SERVER['HTTP_CLIENT_IP']; | |
} | |
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
else { |
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
location ~* \.(eot|ttf|woff|woff2)$ { | |
add_header Access-Control-Allow-Origin *; | |
} |
NewerOlder