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
| // Extend jQuery addClass function to accept callback function | |
| var oAddClass = $.fn.addClass; | |
| $.fn.addClass = function () { | |
| for (var i in arguments) { | |
| var arg = arguments[i]; | |
| if ( !! (arg && arg.constructor && arg.call && arg.apply)) { | |
| arg(); | |
| delete arg; | |
| } | |
| } |
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
| <?php | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
| /** | |
| * Manage WooCommerce styles and scripts. | |
| */ | |
| function grd_woocommerce_script_cleaner() { | |
| // Remove the generator tag | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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
| var brandSlider = $('.brand-banner'); | |
| brandSlider.owlCarousel({ | |
| loop: false, | |
| nav: false, | |
| dots: false, | |
| smartSpeed: 500, | |
| margin: 0, | |
| responsive: { | |
| 0: { | |
| items: 1 |
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
| // Create post WP REST API with Framework7 | |
| app.request({ | |
| url: 'https://example.com/wp-json/wp/v2/posts', | |
| dataType: 'json', | |
| crossDomain: true, | |
| contentType: 'application/json', | |
| data: { | |
| title: 'The title for the object.', | |
| content: 'The content for the object.', | |
| status: 'publish', |
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
| /** | |
| * @package Thz Framework | |
| * @author Themezly | |
| * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only | |
| * @websites http://www.themezly.com | http://www.youjoomla.com | http://www.yjsimplegrid.com | |
| */ | |
| class ThzelGetElementSettings { | |
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_action( 'woocommerce_product_query', function( $qeury ) { | |
| if ( empty( $qeury->query_vars['orderby'] ) || 'popularity' !== $qeury->query_vars['orderby'] ) { | |
| return; | |
| } | |
| add_filter( 'posts_clauses', function( $args ) { | |
| $args['orderby'] = ' CASE wc_product_meta_lookup.min_price WHEN 0 THEN 1 | |
| ELSE -1 | |
| END ASC, wc_product_meta_lookup.total_sales DESC, wc_product_meta_lookup.product_id DESC | |
| '; |
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
| <?php | |
| /** | |
| * Display the custom text field | |
| * @since 1.0.0 | |
| */ | |
| function cfwc_create_custom_field() { | |
| $args = array( | |
| 'id' => 'custom_text_field_title', | |
| 'label' => __( 'Product Name In Thai', 'cfwc' ), | |
| 'class' => 'cfwc-custom-field', |
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
| <?php | |
| /** | |
| * Plugin Name: Custom Fields for WooCommerce | |
| * Description: Add custom fields to WooCommerce products | |
| * Version: 1.0.0 | |
| * Author: Gareth Harris | |
| * Author URI: https://catapultthemes.com/ | |
| * Text Domain: cfwc | |
| * WC requires at least: 3.4.0 | |
| * WC tested up to: 3.4.2 |
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
| function bd_woocommerce_quantity_input_args( $args, $product ) { | |
| $args['input_value'] = 1; // Starting value | |
| $args['max_value'] = 800; // Maximum value | |
| $args['min_value'] = 1; // Minimum value | |
| $args['step'] = 1; // Quantity steps | |
| return $args; | |
| } | |
| add_filter( 'woocommerce_quantity_input_args', 'bd_woocommerce_quantity_input_args', 10, 2 ); |
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_shortcode( 'global_recent_posts', 'global_recent_posts_sc' ); | |
| function global_recent_posts_sc( $atts ) { | |
| $atts = wp_parse_args( $atts, array( | |
| 'order' => 'ASC', | |
| 'orderby' => 'post_title', | |
| 'is_meta' => 0, | |
| 'post_type' => 'post', | |
| 'post_status' => 'publish', | |
| 'recentglobalpostsdisplay' => 'title_content', | |
| 'recentglobalpostsnumber' => '5', |