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 additional button on single product page for woocommerce */ | |
add_action( 'woocommerce_single_product_summary', 'my_extra_button_on_product_page', 31 ); | |
function my_extra_button_on_product_page() { | |
global $product; | |
echo '<div class="social-order">'; | |
echo '<a href="https://m.me/FACEBOOK_PAGE_USER_NAME_HERE" target="_blank" class="button large facebook-btn"><span class="fa fa-facebook-square fa-2x" aria-hidden="true"></span> สั่งซื้อทาง Facebook</a>'; | |
echo '<a href="http://line.me/ti/p/~LINE_ID_HERE" target="_blank" class="button line-btn"><span class="icon icon-line fa-2x"></span> สั่งซื้อทาง Line</a>'; | |
echo '</div>'; | |
} |
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( 'body_class', 'custom_class' ); | |
function custom_class( $classes ) { | |
if (is_shop()) { | |
$classes[] = 'shop'; | |
} | |
return $classes; | |
} |
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
// Credit @rmulugeta https://wordpress.org/support/users/rmulugeta/ | |
// from https://wordpress.org/support/topic/child-theme-not-overriding-parent-stylecss/ | |
<?php | |
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles',999 ); | |
function theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', | |
get_stylesheet_directory_uri() . '/styles/child-style.css', | |
array('parent-style') | |
); |
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
/* WooCommerce Checkout Page - Fix Paypal Label */ | |
.woocommerce-checkout .woocommerce-checkout-payment ul li label { | |
width: auto; | |
display: inline; | |
} |
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
// Polylang Shortcode - https://wordpress.org/plugins/polylang/ | |
// Add this code in your functions.php | |
// Put shortcode [polylang] to post/page for display flags | |
function polylang_shortcode() { | |
ob_start(); | |
pll_the_languages(array('show_flags'=>1,'show_names'=>0)); | |
$flags = ob_get_clean(); | |
return $flags; | |
} |
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
/* make default sidebar put under main content */ | |
/* force devices more than 980px */ | |
@media (min-width: 981px) { | |
#sidebar { | |
float:left; | |
} | |
#main { | |
float:right; | |
} | |
} |