├── .gitignore ├── screenshot.png ├── languages └── zh_CN.mo ├── loop-templates ├── content-empty.php ├── content-page.php ├── content.php ├── content-none.php ├── content-archive.php └── content-aside.php ├── includes ├── pagination.php ├── previous-next.php ├── inline-js.php ├── jetpack.php ├── editor.php ├── post-view.php ├── plugins-support.php ├── extras.php ├── comment-form.php ├── control-checkbox-multiple.php ├── security.php ├── list-count-optimize.php ├── woocommerce.php ├── widgets-position.php ├── template-tags.php ├── setup.php ├── widget-singular-menu.php └── widget-slider-unit.php ├── page-templates ├── empty.php ├── blank.php ├── content-only.php ├── content-with-meta.php └── content-with-sidebar.php ├── install-lnmp-on-centos8.sh ├── searchform.php ├── assets ├── js │ ├── checkbox-multiple.js │ ├── theme-customizer.js │ ├── theme.js │ ├── js.cookie-2.2.1.min.js │ └── maizi-admin.js └── bootstrap │ └── css │ ├── bootstrap-reboot.min.css │ └── bootstrap-reboot.css ├── sidebar-footerfull.php ├── woocommerce ├── global │ ├── wrapper-end.php │ ├── wrapper-start.php │ ├── quantity-input.php │ └── form-login.php ├── loop │ ├── pagination.php │ ├── add-to-cart.php │ └── orderby.php ├── single-product │ ├── tabs │ │ ├── description.php │ │ ├── additional-information.php │ │ └── tabs.php │ ├── short-description.php │ └── add-to-cart │ │ ├── variation-add-to-cart-button.php │ │ └── simple.php ├── cart │ ├── proceed-to-checkout-button.php │ ├── cart-empty.php │ ├── mini-cart.php │ └── cart.php ├── myaccount │ ├── navigation.php │ ├── form-lost-password.php │ ├── form-reset-password.php │ ├── form-edit-address.php │ ├── my-address.php │ ├── form-edit-account.php │ ├── my-orders.php │ ├── downloads.php │ ├── form-login.php │ └── orders.php ├── product-searchform.php ├── checkout │ ├── form-coupon.php │ ├── form-checkout.php │ ├── payment.php │ └── form-pay.php └── archive-product.php ├── codesniffer.ruleset.xml ├── README.md ├── woocommerce.php ├── sidebar.php ├── footer.php ├── functions.php ├── single.php ├── sidebar-slider.php ├── editor-style.css ├── archive.php ├── index.php ├── search.php ├── 404.php ├── page.php ├── author.php ├── comments.php ├── .travis.yml └── header.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | assets/**/*.map -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garylab/maizi/HEAD/screenshot.png -------------------------------------------------------------------------------- /languages/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garylab/maizi/HEAD/languages/zh_CN.mo -------------------------------------------------------------------------------- /loop-templates/content-empty.php: -------------------------------------------------------------------------------- 1 | 8 | 18 | -------------------------------------------------------------------------------- /assets/js/checkbox-multiple.js: -------------------------------------------------------------------------------- 1 | jQuery( document ).ready( function() { 2 | 3 | /* === Checkbox Multiple Control === */ 4 | 5 | jQuery( '.customize-control-checkbox-multiple input[type="checkbox"]' ).on( 'change', function() { 6 | 7 | checkbox_values = jQuery( this ).parents( '.customize-control' ).find( 'input[type="checkbox"]:checked' ).map( 8 | function() { 9 | return this.value; 10 | } 11 | ).get().join( ',' ); 12 | 13 | jQuery( this ).parents( '.customize-control' ).find( 'input[type="hidden"]' ).val( checkbox_values ).trigger( 'change' ); 14 | } 15 | ); 16 | 17 | } ); -------------------------------------------------------------------------------- /includes/previous-next.php: -------------------------------------------------------------------------------- 1 | 8 |
9 | 10 |
11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /assets/js/theme-customizer.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * This file adds some LIVE to the Theme Customizer live preview. To leverage 4 | * this, set your custom settings to 'postMessage' and then add your handling 5 | * here. Your javascript should grab settings from customizer controls, and 6 | * then make any necessary changes to the page using jQuery. 7 | * 8 | * @see https://codex.wordpress.org/Theme_Customization_API#Part_3:_Configure_Live_Preview_.28Optional.29 9 | */ 10 | ( function( $ ) { 11 | 12 | // Update the site title in real time... 13 | wp.customize( 'blogname', function( value ) { 14 | value.bind( function( newval ) { 15 | console.log(newval); 16 | $( '.navbar-brand a' ).html( newval ); 17 | } ); 18 | } ); 19 | 20 | } )( jQuery ); 21 | -------------------------------------------------------------------------------- /loop-templates/content-page.php: -------------------------------------------------------------------------------- 1 | 7 |
id="post-"> 8 | 9 |
10 | 11 | ', '' ); ?> 12 | 13 | 18 | 19 |
20 | 21 |
22 | 23 | 24 | 25 | '', 29 | ) ); 30 | ?> 31 | 32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /woocommerce/global/wrapper-end.php: -------------------------------------------------------------------------------- 1 | 23 | 24 | -------------------------------------------------------------------------------- /woocommerce/loop/pagination.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | A custom set of code standard rules to check for WordPress themes. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /includes/inline-js.php: -------------------------------------------------------------------------------- 1 | 350) { 6 | $('.scroll-top').fadeIn(); 7 | } else { 8 | $('.scroll-top').fadeOut(); 9 | } 10 | }); 11 | // Scroll to Top 12 | $('.scroll-top').click(function (e) { 13 | e.preventDefault(); 14 | $("html, body").animate({scrollTop: 0}, 100); 15 | return false; 16 | }); 17 | 18 | // Sidebar menu 19 | $('aside .menu-item a').click(function(e) { 20 | var self = $(this); 21 | if (self.attr('href') === '#') { 22 | e.preventDefault(); 23 | } 24 | $('.menu-item').not(self.parents()).removeClass('current-menu-item'); 25 | self.parent().addClass('current-menu-item'); 26 | }); 27 | }); 28 | })(jQuery); -------------------------------------------------------------------------------- /page-templates/blank.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | > 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /loop-templates/content.php: -------------------------------------------------------------------------------- 1 | 7 |
id="post-"> 8 | 9 |
10 |
11 | 12 | ', '' ); ?> 13 | 14 |
15 | 16 | 17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | '', 32 | ) ); 33 | ?> 34 | 35 |
36 |
37 | 38 |
39 | -------------------------------------------------------------------------------- /woocommerce/single-product/tabs/description.php: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /woocommerce/single-product/short-description.php: -------------------------------------------------------------------------------- 1 | post_excerpt ) { 26 | return; 27 | } 28 | 29 | ?> 30 |
31 | post_excerpt ) ?> 32 |
33 | -------------------------------------------------------------------------------- /woocommerce/cart/proceed-to-checkout-button.php: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /woocommerce/single-product/tabs/additional-information.php: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /woocommerce/cart/cart-empty.php: -------------------------------------------------------------------------------- 1 | 0 ) : ?> 31 |

32 | 33 | 34 | 35 |

36 | 37 | -------------------------------------------------------------------------------- /woocommerce/loop/add-to-cart.php: -------------------------------------------------------------------------------- 1 | %s', 28 | esc_url( $product->add_to_cart_url() ), 29 | esc_attr( isset( $quantity ) ? $quantity : 1 ), 30 | esc_attr( $product->get_id() ), 31 | esc_attr( $product->get_sku() ), 32 | esc_html( $product->add_to_cart_text() ) 33 | ), 34 | $product ); 35 | -------------------------------------------------------------------------------- /woocommerce/global/wrapper-start.php: -------------------------------------------------------------------------------- 1 |
'; 29 | } else { 30 | echo '
'; 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Maizi - Best brand Wordpress theme build with bootstrap 2 | 3 | * [Official Website and Demo](https://www.awaimai.com/maizi) 4 | 5 | > Notice: Built-in Highlight function had been removed, please use plugin **Prismatic** instead. 6 | 7 | ## Basic Features 8 | 9 | - Completely Open source 10 | - Using Bootstrap 4 11 | - Coming with home page slider 12 | - Support multiple type of layout 13 | - Support WooCommerce shop 14 | - Don't need any other plugin 15 | 16 | ## Installation 17 | 18 | ### Classic install 19 | - Download the maizi folder from GitHub or from [https://www.awaimai.com/maizi](https://www.awaimai.com/maizi) 20 | - Upload it into your WordPress installation subfolder here: `/wp-content/themes/` 21 | - Login to your WordPress backend 22 | - Go to Appearance → Themes 23 | - Activate the Maizi theme 24 | 25 | 26 | ### TODO 27 | - [ ] Color scheme. 28 | - [ ] Remove built-in slider widget. 29 | - [ ] Remove footer widget. 30 | - [ ] Remove built-in advertise support. 31 | - [ ] Find a plugins that can add Ads well. 32 | - [ ] Optimize list page title and meta only structure. 33 | - [ ] Add an option to change post and page meta position. 34 | - [ ] Add an option to show/hide "power by" information. 35 | - [ ] Make sidebar list dot better-looking. 36 | - [ ] Translate all words. 37 | - [ ] Add an user manual. -------------------------------------------------------------------------------- /woocommerce/myaccount/navigation.php: -------------------------------------------------------------------------------- 1 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /loop-templates/content-none.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 18 | 19 |
20 | 21 | 23 | 24 |

Get started here.', 'maizi' ), array( 25 | 'a' => array( 26 | 'href' => array(), 27 | ), 28 | ) ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

29 | 30 | 31 | 32 |

33 | 36 | 37 |

38 | 41 |
42 | 43 |
44 | -------------------------------------------------------------------------------- /woocommerce/global/quantity-input.php: -------------------------------------------------------------------------------- 1 | 23 |
24 | 25 |
26 | -------------------------------------------------------------------------------- /woocommerce.php: -------------------------------------------------------------------------------- 1 | 18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /sidebar.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /includes/jetpack.php: -------------------------------------------------------------------------------- 1 | 'main', 20 | 'render' => 'components_infinite_scroll_render', 21 | 'footer' => 'page', 22 | ) ); 23 | 24 | // Add theme support for Responsive Videos. 25 | add_theme_support( 'jetpack-responsive-videos' ); 26 | 27 | // Add theme support for Social Menus 28 | add_theme_support( 'jetpack-social-menu' ); 29 | 30 | } 31 | add_action( 'after_setup_theme', 'components_jetpack_setup' ); 32 | 33 | /** 34 | * Custom render function for Infinite Scroll. 35 | */ 36 | function components_infinite_scroll_render() { 37 | while ( have_posts() ) { 38 | the_post(); 39 | if ( is_search() ) : 40 | get_template_part( 'loop-templates/content', 'search' ); 41 | else : 42 | get_template_part( 'loop-templates/content' ); 43 | endif; 44 | } 45 | } 46 | 47 | function components_social_menu() { 48 | if ( ! function_exists( 'jetpack_social_menu' ) ) { 49 | return; 50 | } else { 51 | jetpack_social_menu(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 52 | 53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | 16 |
17 | apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ), 25 | 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ), 26 | 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : $product->get_min_purchase_quantity(), 27 | ) ); 28 | 29 | /** 30 | * @since 3.0.0. 31 | */ 32 | do_action( 'woocommerce_after_add_to_cart_quantity' ); 33 | ?> 34 | 35 | 36 | 37 | 38 |
39 | -------------------------------------------------------------------------------- /woocommerce/product-searchform.php: -------------------------------------------------------------------------------- 1 | 24 | 34 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 | 52 |
53 | 54 |
55 | 56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /assets/js/js.cookie-2.2.1.min.js: -------------------------------------------------------------------------------- 1 | /*! js-cookie v2.2.1 | MIT */ 2 | 3 | !function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a 9 | 10 | 0 ) : ?> 11 | 12 |
13 | 14 | 58 | 59 | 62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /editor-style.css: -------------------------------------------------------------------------------- 1 | body{font-size:14px;line-height:24px;word-break: break-all; word-wrap: break-word;font-family: microsoft yahei} 2 | img{max-width:100%;padding: 5px;border: solid 1px #e6e6e6;border:none;} 3 | img:hover{background-color: #fbfbfb;border-color: #ddd;} 4 | a{text-decoration: none;} 5 | h2,h3,h4{color:#222;border-bottom:#eee 1px solid;padding-bottom:5px;margin-bottom: 14px;} 6 | h2{font-size:18px;margin-top: 30px} 7 | h3,h4{font-size:14px} 8 | ul{margin:0 0 6px 26px} 9 | ol{margin:16px} 10 | ul li{background: url(data:image/gif;base64,R0lGODlhDQAFAKIAAKOjo6GhoampqYSEhJWVlZ2dnZmZmXx8fCH5BAAAAAAALAAAAAANAAUAAAMVKLfcB6PIScsZJuttLvlgSByK4wQJADs=) no-repeat 0 10px;padding-left: 20px;margin-bottom: 10px;*list-style:disc;*padding-left:0;} 11 | ol li{list-style:decimal;margin-left: 28px;} 12 | p{margin-bottom:14px} 13 | code{padding:1px 4px;border-radius:2px;background-color:#eee;font-family:'courier new';color:#777;margin:0 4px} 14 | table{border-top:solid 1px #ddd;border-left:solid 1px #ddd;width: 100%;margin-bottom: 16px;} 15 | table th{background-color:#f9f9f9;text-align:center} 16 | table td,table th{border-bottom:solid 1px #ddd;border-right:solid 1px #ddd;padding:5px 10px} 17 | .alignleft{float:left;text-align:left;margin-right:10px} 18 | .aligncenter{text-align:center} 19 | .alignright{float:right;text-align:right;margin-left:10px} 20 | 21 | 22 | pre{margin:15px auto;font:12px/20px 'courier new';border:1px solid #d6d6d6;border-left-width:4px;background:#fbfbfb;padding:10px 15px} 23 | blockquote{margin:15px auto;border:1px solid #d6d6d6;border-top-width:3px;padding:15px 20px 10px;background-color:#fdfdfd;} 24 | blockquote p{margin:0;padding:0;text-indent:24px;margin-bottom:10px;} -------------------------------------------------------------------------------- /woocommerce/loop/orderby.php: -------------------------------------------------------------------------------- 1 | 24 |
25 | 30 | $val ) { 33 | if ( 'orderby' === $key || 'submit' === $key ) { 34 | continue; 35 | } 36 | if ( is_array( $val ) ) { 37 | foreach( $val as $innerVal ) { 38 | echo ''; 39 | } 40 | } else { 41 | echo ''; 42 | } 43 | } 44 | ?> 45 |
46 | -------------------------------------------------------------------------------- /woocommerce/checkout/form-coupon.php: -------------------------------------------------------------------------------- 1 | cart->applied_coupons ) ) { 28 | $info_message = apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'maizi' ) . ' ' . __( 'Click here to enter your code', 'maizi' ) . '' ); 29 | wc_print_notice( $info_message, 'notice' ); 30 | } 31 | ?> 32 | 33 | 45 | -------------------------------------------------------------------------------- /includes/editor.php: -------------------------------------------------------------------------------- 1 | 'Lead Paragraph', 26 | 'selector' => 'p', 27 | 'classes' => 'lead', 28 | 'wrapper' => true 29 | ), 30 | array( 31 | 'title' => 'Small', 32 | 'inline' => 'small' 33 | ), 34 | array( 35 | 'title' => 'Blockquote', 36 | 'block' => 'blockquote', 37 | 'classes' => 'blockquote', 38 | 'wrapper' => true 39 | ), 40 | array( 41 | 'title' => 'Blockquote Footer', 42 | 'block' => 'footer', 43 | 'classes' => 'blockquote-footer', 44 | 'wrapper' => true 45 | ), 46 | array( 47 | 'title' => 'Cite', 48 | 'inline' => 'cite' 49 | ) 50 | ); 51 | 52 | if ( isset( $settings['style_formats'] ) ) { 53 | $orig_style_formats = json_decode($settings['style_formats'],true); 54 | $style_formats = array_merge($orig_style_formats,$style_formats); 55 | } 56 | 57 | $settings['style_formats'] = json_encode( $style_formats ); 58 | return $settings; 59 | } 60 | -------------------------------------------------------------------------------- /includes/post-view.php: -------------------------------------------------------------------------------- 1 | ' ); 18 | imgIdInput.val(attachment.id); 19 | delImgLink.removeClass( 'hidden' ); 20 | }); 21 | 22 | frame.open(); 23 | }); 24 | 25 | // DELETE IMAGE LINK 26 | $(document).on( 'click', '.delete-custom-img', function( event ){ 27 | event.preventDefault(); 28 | var self = $(this), 29 | parent = self.parent('.upload-img-box'), 30 | delImgLink = parent.find('.delete-custom-img'), 31 | imgContainer = parent.find('.custom-img-container'), 32 | imgIdInput = parent.find('.custom-img-id'); 33 | 34 | // Clear out the preview image 35 | imgContainer.html( '' ); 36 | // Hide the delete image link 37 | delImgLink.addClass( 'hidden' ); 38 | // Delete the image id from the hidden input 39 | imgIdInput.val( '' ); 40 | }); 41 | 42 | $('#widgets-right .color-picker, .inactive-sidebar .color-picker').wpColorPicker(); 43 | 44 | // Executes wpColorPicker function after AJAX is fired on saving the widget 45 | $(document).ajaxComplete(function() { 46 | $('#widgets-right .color-picker, .inactive-sidebar .color-picker').wpColorPicker(); 47 | }); 48 | }); 49 | -------------------------------------------------------------------------------- /woocommerce/myaccount/form-lost-password.php: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 | 27 |

28 | 29 |

30 | 31 | 32 |

33 | 34 |
35 | 36 | 37 | 38 |

39 | 40 | 41 |

42 | 43 | 44 | 45 |
46 | -------------------------------------------------------------------------------- /includes/plugins-support.php: -------------------------------------------------------------------------------- 1 | ID); 16 | 17 | $post->post_content .= ''; 22 | } 23 | add_action('wp_enqueue_scripts', 'acf_code_field_support_prismatic', 5); 24 | 25 | /** 26 | * Get programing language metas from post metas, programing 27 | * languages metas are defined start with 'lang-' or 'language-'. 28 | * 29 | * @param $post_id 30 | * @return array 31 | */ 32 | function get_programing_language_metas($post_id) { 33 | if (!is_singular()) { 34 | return array(); 35 | } 36 | 37 | $metas = get_post_meta($post_id); 38 | 39 | $languages = array(); 40 | foreach ($metas as $key => $value) { 41 | if ( is_programing_language_meta($key) && $value[0]) { 42 | $languages[$key]['value'] = $value[0]; 43 | $languages[$key]['label'] = get_programing_language_label($key); 44 | } 45 | } 46 | 47 | return $languages; 48 | } 49 | 50 | /** 51 | * Check if a string is start with 'lang-' or 'language-' 52 | * 53 | * @param $key 54 | * @return bool 55 | */ 56 | function is_programing_language_meta($key) { 57 | return substr($key, 0, 5) === 'lang-' || substr($key, 0, 9) === 'language-'; 58 | } 59 | 60 | /** 61 | * Get language label 62 | * @param $key 63 | * @return string 64 | */ 65 | function get_programing_language_label($key) { 66 | if (function_exists('get_field_object')) { 67 | return get_field_object($key)['label']; 68 | } else { 69 | return ucwords( substr($key, strpos($key, '-') + 1) ); 70 | } 71 | } -------------------------------------------------------------------------------- /woocommerce/single-product/tabs/tabs.php: -------------------------------------------------------------------------------- 1 | 32 | 33 |
34 |
    35 | $tab ) : ?> 36 | 39 | 40 |
41 | $tab ) : ?> 42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /page-templates/content-only.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
id="post-"> 29 | 30 |
31 |
32 | 33 | ', '' ); ?> 34 | 35 |
36 | 37 |
38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | 46 | 52 | 53 | 54 | 55 |
56 | 57 |
58 | 59 |
60 | 61 |
62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /includes/extras.php: -------------------------------------------------------------------------------- 1 | $value ) { 46 | if ( 'tag' == $value ) { 47 | unset( $classes[ $key ] ); 48 | } 49 | } 50 | 51 | return $classes; 52 | 53 | } 54 | } 55 | 56 | // Filter custom logo with correct classes. 57 | add_filter( 'get_custom_logo', 'change_logo_class' ); 58 | 59 | if ( ! function_exists( 'change_logo_class' ) ) { 60 | /** 61 | * Replaces logo CSS class. 62 | * 63 | * @param string $html Markup. 64 | * 65 | * @return mixed 66 | */ 67 | function change_logo_class( $html ) { 68 | 69 | $html = str_replace( 'class="custom-logo"', 'class="img-fluid"', $html ); 70 | $html = str_replace( 'class="custom-logo-link"', 'class="navbar-brand custom-logo-link"', $html ); 71 | $html = str_replace( 'alt=""', 'title="Home" alt="logo"' , $html ); 72 | 73 | return $html; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /loop-templates/content-archive.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
id="post-"> 12 | 13 |
14 | 15 |
16 | 17 | 18 |
19 | ID, 'thumbnail', array( 'class' => 'card-img-top bg-gray' ) ); ?> 20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 | ', esc_url( get_permalink() ) ), '' ); ?> 28 | 29 | 30 |
31 | 32 |
33 | 34 | 35 | 36 |
37 | 38 | 39 |
40 | 41 | 42 | 43 |
44 |
45 |
46 | 47 |
48 |
49 | -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 |
33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 |
71 | 72 | 73 | 74 |
75 | 76 |
77 | 78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 19 | 20 |
21 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 |
33 | 34 | 35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
63 | 64 | 65 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 |
74 | 75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 | 47 | 48 | 49 | 50 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 72 | 73 | 74 |
75 | 76 | 77 | 78 |
79 | 80 |
81 | 82 |
83 | 84 | 85 | -------------------------------------------------------------------------------- /woocommerce/myaccount/form-reset-password.php: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 | 27 |

28 | 29 |

30 | 31 | 32 |

33 |

34 | 35 | 36 |

37 | 38 | 39 | 40 | 41 |
42 | 43 | 44 | 45 |

46 | 47 | 48 |

49 | 50 | 51 | 52 |
53 | -------------------------------------------------------------------------------- /woocommerce/single-product/add-to-cart/simple.php: -------------------------------------------------------------------------------- 1 | is_purchasable() ) { 25 | return; 26 | } 27 | 28 | echo wc_get_stock_html( $product ); 29 | 30 | if ( $product->is_in_stock() ) : ?> 31 | 32 | 33 | 34 |
35 | apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ), 48 | 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ), 49 | 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : $product->get_min_purchase_quantity(), 50 | ) ); 51 | 52 | /** 53 | * @since 3.0.0. 54 | */ 55 | do_action( 'woocommerce_after_add_to_cart_quantity' ); 56 | ?> 57 | 58 | 59 | 60 | 66 |
67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /page-templates/content-with-meta.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
id="post-"> 29 | 30 |
31 |
32 | 33 | ', '' ); ?> 34 | 35 |
36 | 37 | 38 | 39 |
40 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 |
49 | 50 |
51 | 52 | 58 | 59 | 60 | 61 |
62 | 63 |
64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /woocommerce/myaccount/form-edit-address.php: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 |

34 | 35 |
36 | 37 | 38 |
39 | $field ) { 41 | if ( isset( $field['country_field'], $address[ $field['country_field'] ] ) ) { 42 | $field['country'] = wc_get_post_data_by_key( $field['country_field'], $address[ $field['country_field'] ]['value'] ); 43 | } 44 | woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) ); 45 | } 46 | ?> 47 |
48 | 49 | 50 | 51 |

52 | 53 | 54 | 55 |

56 |
57 | 58 |
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /includes/comment-form.php: -------------------------------------------------------------------------------- 1 | '
' . __( 'Name', 22 | 'maizi' ) . ( $req ? ' *' : '' ) . ' ' . 23 | '
', 24 | 'email' => '', 27 | 'url' => '
' . 29 | '
', 30 | ); 31 | 32 | return $fields; 33 | } 34 | add_filter( 'comment_form_default_fields', 'bootstrap_comment_form_fields' ); 35 | 36 | 37 | /** 38 | * Builds the form. 39 | * 40 | * @param string $args Arguments for form's fields. 41 | * @return mixed 42 | */ 43 | function bootstrap_comment_form( $args ) { 44 | $args['comment_field'] = '
45 | 46 | 47 |
'; 48 | $args['class_submit'] = 'btn btn-secondary'; // since WP 4.1. 49 | return $args; 50 | } 51 | add_filter( 'comment_form_defaults', 'bootstrap_comment_form' ); 52 | -------------------------------------------------------------------------------- /includes/control-checkbox-multiple.php: -------------------------------------------------------------------------------- 1 | choices ) ) 48 | return; ?> 49 | 50 | label ) ) : ?> 51 | label ); ?> 52 | 53 | 54 | description ) ) : ?> 55 | description; ?> 56 | 57 | 58 | value() ) ? explode( ',', $this->value() ) : $this->value(); ?> 59 | 60 |
    61 | choices as $value => $label ) : ?> 62 | 63 |
  • 64 | 68 |
  • 69 | 70 | 71 |
72 | 73 | link(); ?> value="" /> 74 | enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) { 29 | echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'maizi' ) ); 30 | return; 31 | } 32 | 33 | ?> 34 | 35 |
36 | 37 | checkout_fields ) > 0 ) : ?> 38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 |

56 | 57 | 58 | 59 |
60 | 61 |
62 | 63 | 64 | 65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /woocommerce/global/form-login.php: -------------------------------------------------------------------------------- 1 | 28 | 63 | -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 | 32 | 33 |
34 | 35 |

36 | 37 |

38 | 39 |
40 | 41 | 42 | 43 |
44 | 45 | 46 | 47 | 48 | 49 |
50 | 51 |

52 | 53 |
    54 | 'count', 57 | 'order' => 'DESC', 58 | 'show_count' => 1, 59 | 'title_li' => '', 60 | 'number' => 10, 61 | ) ); 62 | ?> 63 |
64 | 65 |
66 | 67 | 68 | 69 | ' . sprintf( __( 'Try looking in the monthly archives. %1$s', 72 | 'maizi' ), convert_smilies( ':)' ) ) . '

'; 73 | the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); 74 | ?> 75 | 76 | 77 | 78 |
79 | 80 |
81 | 82 |
83 | 84 |
85 | 86 |
87 | 88 |
89 | 90 |
91 | 92 | 93 | -------------------------------------------------------------------------------- /page-templates/content-with-sidebar.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 | 35 | 36 |
id="post-"> 37 | 38 |
39 |
40 | 41 | ', '' ); ?> 42 | 43 |
44 | 45 |
46 | 47 | 48 | 49 |
50 |
51 | 52 |
53 | 54 | 60 | 61 | 62 | 63 |
64 | 65 |
66 | 67 | 68 | 69 |
70 | 71 |
72 | 73 |
74 | 75 | 76 | -------------------------------------------------------------------------------- /includes/security.php: -------------------------------------------------------------------------------- 1 | ERROR: Stop guessing!'; 39 | } 40 | 41 | add_filter( 'login_errors', 'show_less_login_info' ); 42 | 43 | 44 | /** 45 | * Disable the emoji's 46 | */ 47 | function disable_emojis() { 48 | remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); 49 | remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); 50 | remove_action( 'wp_print_styles', 'print_emoji_styles' ); 51 | remove_action( 'admin_print_styles', 'print_emoji_styles' ); 52 | remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); 53 | remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 54 | remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); 55 | add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); 56 | add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 ); 57 | } 58 | add_action( 'init', 'disable_emojis' ); 59 | 60 | function disable_emojis_tinymce( $plugins ) { 61 | if ( is_array( $plugins ) ) { 62 | return array_diff( $plugins, array( 'wpemoji' ) ); 63 | } else { 64 | return array(); 65 | } 66 | } 67 | 68 | function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) { 69 | if ( 'dns-prefetch' == $relation_type ) { 70 | /** This filter is documented in wp-includes/formatting.php */ 71 | $emoji_svg_url = apply_filters( 'emoji_svg_url', '__return_false' ); 72 | 73 | $urls = array_diff( $urls, array( $emoji_svg_url ) ); 74 | } 75 | 76 | return $urls; 77 | } -------------------------------------------------------------------------------- /includes/list-count-optimize.php: -------------------------------------------------------------------------------- 1 | set('no_found_rows', true); 23 | } 24 | } 25 | add_filter( 'pre_get_posts', 'maizi_set_no_found_rows', 10, 1 ); 26 | 27 | 28 | if ( ! function_exists( 'maizi_set_found_posts' ) ) { 29 | 30 | /** 31 | * Workout the pagination values. 32 | * 33 | * Uses the query parts to run a custom count(*) query against the database 34 | * then constructs and sets the pagination results for this wp_query. 35 | * 36 | * @param array $clauses Array of clauses that make up the SQL query. 37 | * @param WP_Query $wp_query The WP_Query instance. Passed by reference. 38 | * @return array 39 | */ 40 | function maizi_set_found_posts($clauses, \WP_Query $wp_query) 41 | { 42 | // Don't proceed if it's a singular page. 43 | if ($wp_query->is_singular()) { 44 | return $clauses; 45 | } 46 | 47 | global $wpdb; 48 | 49 | // Check if they're set. 50 | $where = isset($clauses['where']) ? $clauses['where'] : ''; 51 | $join = isset($clauses['join']) ? $clauses['join'] : ''; 52 | $distinct = isset($clauses['distinct']) ? $clauses['distinct'] : ''; 53 | 54 | // Construct and run the query. Set the result as the 'found_posts' 55 | // param on the main query we want to run. 56 | $wp_query->found_posts = (int)$wpdb->get_row("SELECT $distinct COUNT(*) AS total FROM {$wpdb->posts} $join WHERE 1=1 $where")->total; 57 | 58 | // Work out how many posts per page there should be. 59 | $posts_per_page = (!empty($wp_query->query_vars['posts_per_page']) ? absint($wp_query->query_vars['posts_per_page']) : absint(get_option('posts_per_page'))); 60 | 61 | // Set the max_num_pages. 62 | $wp_query->max_num_pages = ceil($wp_query->found_posts / $posts_per_page); 63 | 64 | // Return the $clauses so the main query can run. 65 | return $clauses; 66 | } 67 | } 68 | add_filter( 'posts_clauses', 'maizi_set_found_posts', 10, 2 ); -------------------------------------------------------------------------------- /loop-templates/content-aside.php: -------------------------------------------------------------------------------- 1 | 7 |
id="post-"> 8 | 9 |
10 |
11 | 12 | ', '' ); ?> 13 | 14 |

15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 |

30 |
31 | 44 |
45 |
46 | 47 |
48 | $value) : ?> 49 | 50 |
51 |
52 |
53 | 54 | 55 |
56 | 57 |

58 |
59 | 60 |
61 | 62 | 63 | 64 | '', 68 | ) ); 69 | ?> 70 | 71 |
72 |
73 |
74 | -------------------------------------------------------------------------------- /woocommerce/checkout/payment.php: -------------------------------------------------------------------------------- 1 | 26 |
27 | cart->needs_payment() ) : ?> 28 |
    29 | $gateway ) ); 33 | } 34 | } else { 35 | echo '
  • ' . apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_country() ? __( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'maizi' ) : __( 'Please fill in your details above to see available payment methods.', 'maizi' ) ) . '
  • '; 36 | } 37 | ?> 38 |
39 | 40 |
41 | 45 | 46 | 47 | 48 | 49 | 50 | ' ); ?> 51 | 52 | 53 | 54 | 55 |
56 |
57 | 17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 |
id="post-"> 41 | 42 |
43 |
44 | 45 | ', '' ); ?> 46 | 47 |
48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |
63 | 64 | 70 | 71 | 72 | 73 |
74 | 75 |
76 | 77 | 78 | 79 |
80 | 81 |
82 | 83 |
84 | 85 | -------------------------------------------------------------------------------- /author.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 |
33 | 34 | 66 | 67 |
    68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
  • 76 | 78 | 79 | 80 |
  • 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
92 | 93 |
94 | 95 | 96 | 97 | 98 |
99 | 100 | 101 | 102 |
103 | 104 |
105 | 106 |
107 | 108 | 109 | -------------------------------------------------------------------------------- /comments.php: -------------------------------------------------------------------------------- 1 | 26 | 27 |
28 | 29 | 30 |

31 | 32 | 34 | 35 |

36 | 37 | 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through. ?> 38 | 49 | 50 | 51 |
52 | 'div', 55 | 'short_ping' => true, 56 | 'avatar_size' => 36, 57 | 'max_depth' => 2, 58 | 'walker' => new WP_Bootstrap_Comments_Walker(), 59 | ) ); 60 | ?> 61 |
62 | 63 | 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through. ?> 64 | 75 | 76 | 77 | 78 | 79 | 83 | 84 |

85 | 86 | 87 | 88 | 89 | 90 |
91 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Travis CI (MIT License) configuration file for the Underscores WordPress theme. 2 | # @link https://travis-ci.org/ 3 | 4 | # For use with the Maizi WordPress theme 5 | # @link https://github.com/yeszao/maizi 6 | 7 | # Ditch sudo and use containers. 8 | # @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F 9 | # @link http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure 10 | sudo: false 11 | 12 | # Declare project language. 13 | # @link http://about.travis-ci.org/docs/user/languages/php/ 14 | language: php 15 | 16 | # Declare versions of PHP to use. Use one decimal max. 17 | # @link http://docs.travis-ci.com/user/build-configuration/ 18 | matrix: 19 | fast_finish: true 20 | 21 | include: 22 | # Current $required_php_version for WordPress: 5.2.4 23 | # aliased to 5.2.17 24 | - php: '5.2' 25 | # aliased to a recent 5.6.x version 26 | - php: '5.6' 27 | env: SNIFF=1 28 | # aliased to a recent 7.0.x version 29 | - php: '7.0' 30 | env: SNIFF=1 31 | # aliased to a recent 7.1.x version 32 | - php: '7.1' 33 | # aliased to a recent hhvm version 34 | - php: 'hhvm' 35 | 36 | allow_failures: 37 | - php: 'hhvm' 38 | 39 | # Use this to prepare the system to install prerequisites or dependencies. 40 | # e.g. sudo apt-get update. 41 | # Failures in this section will result in build status 'errored'. 42 | # before_install: 43 | 44 | # Use this to prepare your build for testing. 45 | # e.g. copy database configurations, environment variables, etc. 46 | # Failures in this section will result in build status 'errored'. 47 | before_script: 48 | - export PHPCS_DIR=/tmp/phpcs 49 | - export SNIFFS_DIR=/tmp/sniffs 50 | # Install CodeSniffer for WordPress Coding Standards checks. 51 | - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi 52 | # Install WordPress Coding Standards. 53 | - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi 54 | # Install PHP Compatibility sniffs. 55 | - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi 56 | # Set install path for PHPCS sniffs. 57 | # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 58 | - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi 59 | # After CodeSniffer install you should refresh your path. 60 | - if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi 61 | 62 | # Run test script commands. 63 | # Default is specific to project language. 64 | # All commands must exit with code 0 on success. Anything else is considered failure. 65 | script: 66 | # Search for PHP syntax errors. 67 | - find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l 68 | # Run WordPress Coding Standards checking 69 | - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php --ignore=*/woocommerce/*,*/inc/*; fi 70 | -------------------------------------------------------------------------------- /woocommerce/archive-product.php: -------------------------------------------------------------------------------- 1 | 24 | 25 | 34 | 35 | 36 | 37 |

38 | 39 | 40 | 41 | 50 | 51 | 52 | 53 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 83 | 84 | woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?> 85 | 86 | 87 | 88 | 89 | 90 | 98 | 99 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /woocommerce/myaccount/my-address.php: -------------------------------------------------------------------------------- 1 | __( 'Billing address', 'maizi' ), 28 | 'shipping' => __( 'Shipping address', 'maizi' ), 29 | ), $customer_id ); 30 | } else { 31 | $get_addresses = apply_filters( 'woocommerce_my_account_get_addresses', array( 32 | 'billing' => __( 'Billing address', 'maizi' ), 33 | ), $customer_id ); 34 | } 35 | 36 | $oldcol = 1; 37 | $col = 1; 38 | ?> 39 | 40 |

41 | 42 |

43 | 44 | '; ?> 45 | 46 | $title ) : ?> 47 | 48 |
49 |
50 |

51 | 52 |
53 |
54 | get_user_meta( $customer_id, $name . '_first_name', true ), 57 | 'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ), 58 | 'company' => get_user_meta( $customer_id, $name . '_company', true ), 59 | 'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ), 60 | 'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ), 61 | 'city' => get_user_meta( $customer_id, $name . '_city', true ), 62 | 'state' => get_user_meta( $customer_id, $name . '_state', true ), 63 | 'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ), 64 | 'country' => get_user_meta( $customer_id, $name . '_country', true ), 65 | ), $customer_id, $name ); 66 | 67 | $formatted_address = WC()->countries->get_formatted_address( $address ); 68 | 69 | if ( ! $formatted_address ) 70 | _e( 'You have not set up this type of address yet.', 'maizi' ); 71 | else 72 | echo $formatted_address; 73 | ?> 74 |
75 |
76 | 77 | 78 | 79 | '; ?> 80 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | section and everything up till
6 | * 7 | */ 8 | 9 | $container = get_theme_mod( 'maizi_container_type' ); 10 | ?> 11 | 12 | > 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <?php wp_title( '-', true, 'right' ); ?> 23 | 24 | 25 | 26 | > 27 | 28 |
29 | 30 | 31 |
32 | 33 | 87 | 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /assets/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /woocommerce/myaccount/form-edit-account.php: -------------------------------------------------------------------------------- 1 | 24 | 25 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /woocommerce/checkout/form-pay.php: -------------------------------------------------------------------------------- 1 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | get_items() ) > 0 ) : ?> 36 | get_items() as $item_id => $item ) : ?> 37 | 42 | 43 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | get_order_item_totals() ) : ?> 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
44 | display_item_meta( $item ); 49 | do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order ); 50 | ?> 51 | ' . sprintf( '× %s', esc_html( $item['qty'] ) ) . '', $item ); ?>get_formatted_line_subtotal( $item ); ?>
69 | 70 |
71 | needs_payment() ) : ?> 72 |
    73 | $gateway ) ); 77 | } 78 | } else { 79 | echo '
  • ' . apply_filters( 'woocommerce_no_available_payment_methods_message', __( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'maizi' ) ) . '
  • '; 80 | } 81 | ?> 82 |
83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | ' ); ?> 92 | 93 | 94 | 95 | 96 |
97 |
98 |
99 | -------------------------------------------------------------------------------- /woocommerce/cart/mini-cart.php: -------------------------------------------------------------------------------- 1 | 25 | 26 | cart->is_empty() ) : ?> 27 | 28 |
    29 | cart->get_cart() as $cart_item_key => $cart_item ) { 33 | $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); 34 | $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); 35 | 36 | if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) { 37 | $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ); 38 | $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); 39 | $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); 40 | $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); 41 | ?> 42 |
  • 43 | ×', 46 | esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), 47 | __( 'Remove this item', 'woocommerce' ), 48 | esc_attr( $product_id ), 49 | esc_attr( $_product->get_sku() ) 50 | ), $cart_item_key ); 51 | ?> 52 | is_visible() ) : ?> 53 | 54 | 55 | 56 | 57 | 58 | 59 | cart->get_item_data( $cart_item ); ?> 60 | 61 | ' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '', $cart_item, $cart_item_key ); ?> 62 |
  • 63 | 69 |
70 | 71 | 72 |

: cart->get_cart_subtotal(); ?>

73 | 74 | 75 | 76 |

77 | 78 | 79 |

80 | 81 |

82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /woocommerce/myaccount/my-orders.php: -------------------------------------------------------------------------------- 1 | __( 'Order', 'maizi' ), 14 | 'order-date' => __( 'Date', 'maizi' ), 15 | 'order-status' => __( 'Status', 'maizi' ), 16 | 'order-total' => __( 'Total', 'maizi' ), 17 | 'order-actions' => ' ', 18 | ) ); 19 | 20 | $customer_orders = get_posts( apply_filters( 'woocommerce_my_account_my_orders_query', array( 21 | 'numberposts' => $order_count, 22 | 'meta_key' => '_customer_user', 23 | 'meta_value' => get_current_user_id(), 24 | 'post_type' => wc_get_order_types( 'view-orders' ), 25 | 'post_status' => array_keys( wc_get_order_statuses() ) 26 | ) ) ); 27 | 28 | if ( $customer_orders ) : ?> 29 | 30 |

31 | 32 | 33 | 34 | 35 | 36 | $column_name ) : ?> 37 | 38 | 39 | 40 | 41 | 42 | 43 | get_item_count(); 46 | ?> 47 | 48 | $column_name ) : ?> 49 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /includes/woocommerce.php: -------------------------------------------------------------------------------- 1 |

tag. 43 | $args['class'][] = 'form-group'; 44 | // Add a class to the form input itself. 45 | $args['input_class'] = array( 'form-control', 'input-lg' ); 46 | $args['label_class'] = array( 'control-label' ); 47 | $args['custom_attributes'] = array( 48 | 'data-plugin' => 'select2', 49 | 'data-allow-clear' => 'true', 50 | 'aria-hidden' => 'true', 51 | // Add custom data attributes to the form input itself. 52 | ); 53 | break; 54 | // By default WooCommerce will populate a select with the country names - $args 55 | // defined for this specific input type targets only the country select element. 56 | case 'country' : 57 | $args['class'][] = 'form-group single-country'; 58 | $args['label_class'] = array( 'control-label' ); 59 | $args['input_class'] = array( 'form-control' ); 60 | break; 61 | // By default WooCommerce will populate a select with state names - $args defined 62 | // for this specific input type targets only the country select element. 63 | case 'state' : 64 | // Add class to the field's html element wrapper. 65 | $args['class'][] = 'form-group'; 66 | // add class to the form input itself. 67 | $args['input_class'] = array( 'form-control', 'input-lg' ); 68 | $args['label_class'] = array( 'control-label' ); 69 | $args['custom_attributes'] = array( 70 | 'data-plugin' => 'select2', 71 | 'data-allow-clear' => 'true', 72 | 'aria-hidden' => 'true', 73 | ); 74 | break; 75 | case 'password' : 76 | case 'text' : 77 | case 'email' : 78 | case 'tel' : 79 | case 'number' : 80 | $args['class'][] = 'form-group'; 81 | $args['input_class'] = array( 'form-control', 'input-lg' ); 82 | $args['label_class'] = array( 'control-label' ); 83 | break; 84 | case 'textarea' : 85 | $args['input_class'] = array( 'form-control', 'input-lg' ); 86 | $args['label_class'] = array( 'control-label' ); 87 | break; 88 | case 'checkbox' : 89 | $args['label_class'] = array( 'custom-control custom-checkbox' ); 90 | $args['input_class'] = array( 'custom-control-input', 'input-lg' ); 91 | break; 92 | case 'radio' : 93 | $args['label_class'] = array( 'custom-control custom-radio' ); 94 | $args['input_class'] = array( 'custom-control-input', 'input-lg' ); 95 | break; 96 | default : 97 | $args['class'][] = 'form-group'; 98 | $args['input_class'] = array( 'form-control', 'input-lg' ); 99 | $args['label_class'] = array( 'control-label' ); 100 | break; 101 | } // end switch ($args). 102 | return $args; 103 | } 104 | 105 | add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 10 ); 106 | function woo_rename_tabs( $tabs ) { 107 | // Rename the description tab 108 | if (isset($tabs['description'])) { 109 | $tabs['description']['title'] = __('Product Details', 'maizi'); 110 | } 111 | // Rename the reviews tab 112 | if (isset($tabs['reviews'])) { 113 | $tabs['reviews']['title'] = __('Reviews', 'maizi'); 114 | } 115 | // Rename the additional information tab 116 | if (isset($tabs['additional_information'])) { 117 | $tabs['additional_information']['title'] = __('Specifications', 'maizi'); 118 | } 119 | 120 | return $tabs; 121 | } -------------------------------------------------------------------------------- /woocommerce/myaccount/downloads.php: -------------------------------------------------------------------------------- 1 | customer->get_downloadable_products(); 26 | $has_downloads = (bool) $downloads; 27 | 28 | do_action( 'woocommerce_before_account_downloads', $has_downloads ); ?> 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | $column_name ) : ?> 38 | 39 | 40 | 41 | 42 | 43 | 44 | $column_name ) : ?> 45 | 90 | 91 | 92 | 93 |
46 | 52 | 53 | 54 | 55 | 57 | 58 | 59 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | array( 75 | 'url' => $download['download_url'], 76 | 'name' => __( 'Download', 'maizi' ), 77 | ), 78 | ); 79 | if ( $actions = apply_filters( 'woocommerce_account_download_actions', $actions, $download ) ) { 80 | foreach ( $actions as $key => $action ) { 81 | echo '' . esc_html( $action['name'] ) . ''; 82 | } 83 | } 84 | ?> 85 | 89 |
94 | 95 | 96 |
97 | 98 | 99 | 100 | 101 |
102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /includes/widgets-position.php: -------------------------------------------------------------------------------- 1 | 6) : 28 | $css_class .= '3'; 29 | elseif ($count == 6): 30 | $css_class .= '2'; 31 | elseif ($count == 3 || $count == 5): 32 | $css_class .= '4'; 33 | elseif ($count == 2): 34 | $css_class .= '6'; 35 | elseif ($count == 1): 36 | $css_class .= '12'; 37 | endif; 38 | 39 | return $css_class; 40 | } 41 | 42 | 43 | if ( ! function_exists( 'maizi_widgets_init' ) ) { 44 | /** 45 | * Initializes themes widgets. 46 | */ 47 | function maizi_widgets_init() { 48 | register_sidebar( array( 49 | 'name' => __( 'Global Sidebar', 'maizi' ), 50 | 'id' => 'global-sidebar', 51 | 'description' => 'Global sidebar widget area', 52 | 'before_widget' => '', 54 | 'before_title' => '

', 55 | 'after_title' => '

', 56 | ) ); 57 | 58 | register_sidebar( array( 59 | 'name' => __( 'Index Sidebar', 'maizi' ), 60 | 'id' => 'index-sidebar', 61 | 'description' => 'Index sidebar widget area', 62 | 'before_widget' => '', 64 | 'before_title' => '

', 65 | 'after_title' => '

', 66 | ) ); 67 | 68 | register_sidebar( array( 69 | 'name' => __( 'Single Sidebar', 'maizi' ), 70 | 'id' => 'single-sidebar', 71 | 'description' => 'Single sidebar widget area', 72 | 'before_widget' => '', 74 | 'before_title' => '

', 75 | 'after_title' => '

', 76 | ) ); 77 | 78 | register_sidebar( array( 79 | 'name' => __( 'Page Sidebar', 'maizi' ), 80 | 'id' => 'page-sidebar', 81 | 'description' => 'page sidebar widget area', 82 | 'before_widget' => '', 84 | 'before_title' => '

', 85 | 'after_title' => '

', 86 | ) ); 87 | 88 | register_sidebar( array( 89 | 'name' => __( 'Archive Sidebar', 'maizi' ), 90 | 'id' => 'archive-sidebar', 91 | 'description' => 'Archive sidebar widget area', 92 | 'before_widget' => '', 94 | 'before_title' => '

', 95 | 'after_title' => '

', 96 | ) ); 97 | 98 | if ( function_exists( 'is_woocommerce' ) ) { 99 | register_sidebar( array( 100 | 'name' => __( 'Shop Sidebar', 'maizi' ), 101 | 'id' => 'shop-sidebar', 102 | 'description' => 'WooCommerce sidebar widget area', 103 | 'before_widget' => '', 105 | 'before_title' => '

', 106 | 'after_title' => '

', 107 | ) ); 108 | } 109 | 110 | register_sidebar( array( 111 | 'name' => __( 'Index Slider', 'maizi' ), 112 | 'id' => 'index-slider', 113 | 'description' => 'Index slider area. Place two or more widgets here and they will slide!', 114 | 'before_widget' => '', 116 | 'before_title' => '', 117 | 'after_title' => '', 118 | ) ); 119 | 120 | register_sidebar( array( 121 | 'name' => __( 'Footer Full', 'maizi' ), 122 | 'id' => 'footerfull', 123 | 'description' => 'Widget area below main content and above footer', 124 | 'before_widget' => '' . PHP_EOL, 126 | 'before_title' => '

', 127 | 'after_title' => '

', 128 | ) ); 129 | 130 | register_sidebar( array( 131 | 'name' => __( 'Footer Copyright', 'maizi' ), 132 | 'id' => 'footer-copyright', 133 | 'description' => 'Widget area below Footer Full and above page bottom', 134 | 'before_widget' => '', 136 | 'before_title' => '', 137 | 'after_title' => '', 138 | ) ); 139 | 140 | } 141 | } 142 | add_action( 'widgets_init', 'maizi_widgets_init' ); 143 | 144 | -------------------------------------------------------------------------------- /includes/template-tags.php: -------------------------------------------------------------------------------- 1 | %2$s'; 17 | $posted_on = sprintf( $posted_on, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); 18 | echo ' ', $posted_on, ''; 19 | } 20 | 21 | if ( in_array('author', $list_meta) ) { 22 | $byline = sprintf( 23 | '' . esc_html( get_the_author() ) . '' 24 | ); 25 | echo ''; 26 | } 27 | 28 | if ( in_array('pv', $list_meta) ) { 29 | echo ' ', 30 | get_post_views(get_the_ID()), 31 | // esc_html__( 'View', 'maizi' ), 32 | ''; 33 | } 34 | 35 | if ( in_array('category', $list_meta) && 'post' === get_post_type() ) { 36 | /* translators: used between list items, there is a space after the comma */ 37 | $categories_list = get_the_category_list( esc_html__( ', ', 'maizi' ) ); 38 | $categories_list = str_replace( ' %s', $categories_list ); 41 | } 42 | } 43 | 44 | if ( in_array('tags', $list_meta) && 'post' === get_post_type() ) { 45 | $tags_list = get_the_tag_list('', esc_html__(', ', 'maizi')); 46 | $tags_list = str_replace( ' %s', $tags_list); 49 | } 50 | } 51 | 52 | if ( in_array('comment_link', $list_meta) ) { 53 | $comments_number = get_comments_number(); 54 | if (!post_password_required() && (comments_open() || $comments_number)) { 55 | echo ' '; 56 | comments_popup_link(__('Leave a Comment'), __('1 Comment'), esc_html__('% Comments', 'maizi'), 57 | 'text-muted'); 58 | echo ''; 59 | } 60 | } 61 | 62 | edit_post_link( 63 | __( 'Edit' ), 64 | ' ', 65 | '', 66 | 0, 67 | 'text-muted' 68 | ); 69 | } 70 | endif; 71 | 72 | /** 73 | * Returns true if a blog has more than 1 category. 74 | * 75 | * @return bool 76 | */ 77 | function maizi_categorized_blog() { 78 | $all_the_cool_cats = get_transient( 'maizi_categories' ); 79 | if ( false === $all_the_cool_cats ) { 80 | // Create an array of all the categories that are attached to posts. 81 | $all_the_cool_cats = get_categories( array( 82 | 'fields' => 'ids', 83 | 'hide_empty' => 1, 84 | // We only need to know if there is more than one category. 85 | 'number' => 2, 86 | ) ); 87 | // Count the number of categories that are attached to the posts. 88 | $all_the_cool_cats = count( $all_the_cool_cats ); 89 | set_transient( 'maizi_categories', $all_the_cool_cats ); 90 | } 91 | if ( $all_the_cool_cats > 1 ) { 92 | // This blog has more than 1 category so components_categorized_blog should return true. 93 | return true; 94 | } else { 95 | // This blog has only 1 category so components_categorized_blog should return false. 96 | return false; 97 | } 98 | } 99 | 100 | /** 101 | * Flush out the transients used in maizi_categorized_blog. 102 | */ 103 | function maizi_category_transient_flusher() { 104 | if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { 105 | return; 106 | } 107 | // Like, beat it. Dig? 108 | delete_transient( 'maizi_categories' ); 109 | } 110 | 111 | add_action( 'edit_category', 'maizi_category_transient_flusher' ); 112 | add_action( 'save_post', 'maizi_category_transient_flusher' ); 113 | 114 | /** 115 | * Custom excerpt function 116 | * 117 | * @param int $limit int excerpt word limit. 118 | */ 119 | function maizi_excerpt( $limit = 180 ) { 120 | $excerpt = get_the_content(); 121 | $excerpt = str_replace(' ', ' ', $excerpt); 122 | $excerpt = preg_replace( '/\s+/', ' ', strip_tags( $excerpt ) ); 123 | if ( mb_strwidth( $excerpt ) > $limit ) { 124 | $excerpt = mb_strimwidth( $excerpt, 0, $limit, '…' ); 125 | } 126 | 127 | echo $excerpt; 128 | } 129 | -------------------------------------------------------------------------------- /woocommerce/myaccount/form-login.php: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 | 72 | 73 |
74 | 75 |

76 | 77 |
78 | 79 | 80 | 81 | 82 | 83 |

84 | 85 | 86 |

87 | 88 | 89 | 90 |

91 | 92 | 93 |

94 | 95 | 96 | 97 |

98 | 99 | 100 |

101 | 102 | 103 | 104 | 105 |
106 | 107 | 108 | 109 | 110 |

111 | 112 | 113 |

114 | 115 | 116 | 117 |
118 | 119 |
120 | 121 |
122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /woocommerce/myaccount/orders.php: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | $column_name ) : ?> 33 | 34 | 35 | 36 | 37 | 38 | 39 | orders as $customer_order ) : 40 | $order = wc_get_order( $customer_order ); 41 | $item_count = $order->get_item_count(); 42 | ?> 43 | 44 | $column_name ) : ?> 45 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | max_num_pages ) : ?> 108 |
109 | 110 | 111 | 112 | 113 | max_num_pages ) !== $current_page ) : ?> 114 | 115 | 116 |
117 | 118 | 119 | 120 |
121 | 122 | 123 | 124 | 125 |
126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /includes/setup.php: -------------------------------------------------------------------------------- 1 | __( 'Primary Menu', 'maizi' ), 21 | ) ); 22 | 23 | add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); 24 | add_theme_support( 'post-thumbnails' ); 25 | add_theme_support( 'customize-selective-refresh-widgets' ); 26 | add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); 27 | add_theme_support( 'custom-background' ); 28 | add_theme_support( 'custom-logo' ); 29 | 30 | add_editor_style( 'editor-style.css' ); 31 | 32 | // check if settings are set, if not set defaults. 33 | // Caution: DO NOT check existence using === always check with == . 34 | // Latest blog posts style. 35 | $maizi_sidebar_position = get_theme_mod( 'maizi_sidebar_position' ); 36 | if ( '' == $maizi_sidebar_position ) { 37 | set_theme_mod( 'maizi_sidebar_position', 'left' ); 38 | } 39 | 40 | // Container width. 41 | $maizi_container_type = get_theme_mod( 'maizi_container_type' ); 42 | if ( '' == $maizi_container_type ) { 43 | set_theme_mod( 'maizi_container_type', 'container' ); 44 | } 45 | 46 | // List type. 47 | $maizi_container_type = get_theme_mod( 'maizi_post_list_type' ); 48 | if ( '' == $maizi_container_type ) { 49 | set_theme_mod( 'maizi_post_list_type', 'excerpt' ); 50 | } 51 | 52 | // Excerpt word numbers. 53 | $maizi_container_type = get_theme_mod( 'maizi_excerpt_word_number' ); 54 | if ( '' == $maizi_container_type ) { 55 | set_theme_mod( 'maizi_excerpt_word_number', 180 ); 56 | } 57 | } 58 | endif; 59 | add_action( 'after_setup_theme', 'maizi_setup' ); 60 | 61 | 62 | if ( ! function_exists( 'add_script' ) ) { 63 | /** 64 | * Register javascript and css file. 65 | */ 66 | function add_script() { 67 | // CSS file. 68 | wp_enqueue_style('dashicons'); 69 | wp_enqueue_style( 'bootstrap-css', 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css', array(), '4.6.1' ); 70 | wp_enqueue_style( 'prism-css', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism.min.css', array(), '1.28.0' ); 71 | wp_enqueue_style( 'prism-okaidia-css', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism-okaidia.min.css', array(), '1.28.0' ); 72 | wp_enqueue_style( 'style-css', get_stylesheet_directory_uri() . '/style.css', array(), '1.0.12' ); 73 | 74 | // JS file. 75 | wp_enqueue_script('jquery'); 76 | wp_enqueue_script( 'popper-js', 'https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js', array(), '1.16.1', 77 | true ); 78 | wp_enqueue_script( 'bootstrap-js', 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js', array(), '4.6.1', true ); 79 | wp_enqueue_script( 'js-cookie', 'https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js', array(), '3.0.1', true ); 80 | wp_enqueue_script( 'prism-js', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/prism.js', false, '1.28.0' ); 81 | wp_enqueue_script( 'prism-autoloader-js', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/plugins/autoloader/prism-autoloader.min.js', false, '1.23.0' ); 82 | wp_enqueue_script( 'theme-js', get_template_directory_uri() . '/assets/js/theme.js', array(), '1.28.0', true ); 83 | 84 | wp_register_script( 'inline-js', '', [], '', true ); 85 | wp_enqueue_script( 'inline-js'); 86 | } 87 | } 88 | add_action( 'wp_enqueue_scripts', 'add_script' ); 89 | 90 | 91 | /** 92 | * Use custom title 93 | */ 94 | function maizi_wp_title( $title, $sep, $seplocation ) { 95 | $paged = get_query_var( 'paged' ); 96 | $blog_name = get_bloginfo( 'name' ); 97 | $site_description = get_bloginfo( 'description' ); 98 | 99 | // Add page number. 100 | $page_num = $paged > 1 ? sprintf( __( 'Page %s' ), $paged ) : ''; 101 | 102 | // is front. 103 | if ( is_front_page() || is_home() ) { 104 | if ( $paged > 1 ) { 105 | return sprintf( '%s %s %s', $page_num, $sep, $blog_name ); 106 | } 107 | if ( $site_description ) { 108 | return sprintf( '%s %s %s', $blog_name, $sep, $site_description ); 109 | } 110 | } 111 | 112 | $title = trim( str_replace( '–', $sep, $title ), $sep . ' ' ); 113 | 114 | if ( 'left' === $seplocation ) { 115 | $title = sprintf( '%s %s %s %s %s', $blog_name, $sep, $title, $sep, $page_num ); 116 | } 117 | $title = sprintf( '%s %s %s %s %s', $page_num, $sep, $title, $sep, $blog_name ); 118 | 119 | return trim( $title, $sep . ' ' ); 120 | } 121 | 122 | add_filter( 'wp_title', 'maizi_wp_title', 10, 3 ); 123 | 124 | 125 | /** 126 | * Replace image url if use https 127 | * @param $content 128 | * 129 | * @return mixed 130 | */ 131 | function https_image_replacer( $content ) { 132 | if ( is_ssl() ) { 133 | $host_name = $_SERVER['HTTP_HOST']; 134 | $http_host_name = 'http://' . $host_name . '/wp-content/uploads'; 135 | $https_host_name = 'https://' . $host_name . '/wp-content/uploads'; 136 | $content = str_replace( $http_host_name, $https_host_name, $content ); 137 | } 138 | 139 | return $content; 140 | } 141 | add_filter('the_content', 'https_image_replacer'); 142 | 143 | 144 | /** 145 | * Get current url link 146 | * @return string 147 | */ 148 | function get_url(){ 149 | global $wp; 150 | return home_url( $wp->request ); 151 | } 152 | 153 | 154 | function the_icp() { 155 | if ( defined( 'WP_ZH_CN_ICP_NUM' ) && WP_ZH_CN_ICP_NUM && 156 | get_option( 'zh_cn_l10n_icp_num' ) ) { 157 | echo '' . 159 | esc_attr( get_option( 'zh_cn_l10n_icp_num' ) ) . 160 | "\n"; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /includes/widget-singular-menu.php: -------------------------------------------------------------------------------- 1 | '', 14 | 'page_id' => '', 15 | 'category_id' => '', 16 | ); 17 | 18 | /** 19 | * Sets up the widgets name etc 20 | */ 21 | public function __construct() { 22 | $widget_ops = array( 23 | 'classname' => 'sidebar_menu_widget', 24 | 'description' => esc_html__('Add custom menu to specific category sidebar', 'maizi'), 25 | ); 26 | parent::__construct( 'Sidebar_Singular_Menu_Widget', esc_html__('Category Sidebar Menu', 'maizi'), $widget_ops ); 27 | } 28 | 29 | public function isPage( $page_id ) { 30 | global $post; 31 | if (is_page() && (in_array($post->post_parent, $page_id) || is_page($page_id))) { 32 | return true; 33 | } 34 | return false; 35 | } 36 | 37 | public function isCategory( $category_id ) { 38 | if ( is_category($category_id) || ( is_single() && in_category( $category_id, get_the_ID() ) ) ) { 39 | return true; 40 | } 41 | return false; 42 | } 43 | 44 | /** 45 | * Outputs the content of the widget 46 | * 47 | * @param array $args 48 | * @param array $instance 49 | */ 50 | public function widget( $args, $instance ) { 51 | if (empty($instance['page_id']) && empty($instance['category_id'])) { 52 | return ; 53 | } 54 | 55 | $page_id = explode(',', trim($instance['page_id'])); 56 | $category_id = explode(',', trim($instance['category_id'])); 57 | if ( ! $this->isCategory($category_id) && ! $this->isPage( $page_id ) ) { 58 | return ; 59 | } 60 | 61 | echo $args['before_widget']; 62 | if ( ! empty( $instance['title'] ) ) { 63 | echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; 64 | } 65 | 66 | $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false; 67 | $nav_menu_args = array( 68 | 'fallback_cb' => '', 69 | 'menu' => $nav_menu 70 | ); 71 | wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance ) ); 72 | 73 | echo $args['after_widget']; 74 | } 75 | 76 | /** 77 | * Outputs the options form on admin 78 | * 79 | * @param array $instance The widget options 80 | */ 81 | public function form( $instance ) { 82 | global $wp_customize; 83 | $instance = wp_parse_args((array)$instance, $this->defaults); 84 | ?> 85 |

86 | 87 | 88 |

89 |

90 | 91 | 92 |

93 |

94 | 95 | 97 |

98 | 106 | 116 | 134 | '', 36 | 'bg_color' => '#ffffff', 37 | 'img' => '', 38 | 'img_link' => '', 39 | 'caption' => '', 40 | 'height' => '350px', 41 | 'is_full' => '', 42 | ); 43 | 44 | function __construct() { 45 | parent::__construct( false, 'Slider Unit', array( 'description' => 'Add this unit to index slider' ) ); 46 | } 47 | 48 | function widget( $args, $instance ) { 49 | extract( $args ); 50 | extract( $instance ); 51 | 52 | apply_filters( 'widget_name', $instance['title'] ); 53 | 54 | $text = $before_widget; 55 | $text .= "
"; 56 | 57 | if ( isset( $is_full ) && $is_full ) { 58 | $text .= '
'; 59 | } else { 60 | $text .= '
'; 61 | } 62 | 63 | $text .= $img_link ? "" : ''; 64 | 65 | $img_url = wp_get_attachment_image_src( $img, 'full' ); 66 | $img_url = $img_url[0]; 67 | $text .= $img ? "" : ''; 68 | 69 | $text .= $img_link ? '' : ''; 70 | 71 | if ( $caption ) { 72 | $text .= ''; 75 | } 76 | 77 | $text .= '
'; 78 | 79 | $text .= $after_widget; 80 | 81 | echo $text; 82 | } 83 | 84 | function form( $instance ) { 85 | $instance = wp_parse_args( (array) $instance, $this->defaults ); 86 | ?> 87 |

88 | 91 | 95 |

96 | 97 |

98 | 101 |
102 | 106 |

107 | 108 |

109 | 112 | 116 |

117 | 118 |
119 | 122 |
123 |
124 |
125 | 126 | 128 | 129 |
130 | 131 |
132 | 133 |
134 |
135 |
136 | 140 | 141 | 142 | 143 | 144 |
145 | 146 |

147 | 150 | 154 |

155 | 156 |

157 | 160 | 164 |

165 | 166 |

167 | /> 172 | 175 |

176 | 181 | -------------------------------------------------------------------------------- /woocommerce/cart/cart.php: -------------------------------------------------------------------------------- 1 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | cart->get_cart() as $cart_item_key => $cart_item ) { 46 | $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); 47 | $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); 48 | 49 | if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) { 50 | $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); 51 | ?> 52 | 53 | 54 | 65 | 66 | 77 | 78 | 95 | 96 | 101 | 102 | 118 | 119 | 124 | 125 | 129 | 130 | 131 | 132 | 133 | 148 | 149 | 150 | 151 | 152 |
  
55 | ×', 58 | esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), 59 | __( 'Remove this item', 'woocommerce' ), 60 | esc_attr( $product_id ), 61 | esc_attr( $_product->get_sku() ) 62 | ), $cart_item_key ); 63 | ?> 64 | 67 | get_image(), $cart_item, $cart_item_key ); 69 | 70 | if ( ! $product_permalink ) { 71 | echo $thumbnail; 72 | } else { 73 | printf( '%s', esc_url( $product_permalink ), $thumbnail ); 74 | } 75 | ?> 76 | 79 | get_name(), $cart_item, $cart_item_key ) . ' '; 82 | } else { 83 | echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ); 84 | } 85 | 86 | // Meta data 87 | echo WC()->cart->get_item_data( $cart_item ); 88 | 89 | // Backorder notification 90 | if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) { 91 | echo '

' . esc_html__( 'Available on backorder', 'woocommerce' ) . '

'; 92 | } 93 | ?> 94 |
97 | cart->get_product_price( $_product ), $cart_item, $cart_item_key ); 99 | ?> 100 | 103 | is_sold_individually() ) { 105 | $product_quantity = sprintf( '1 ', $cart_item_key ); 106 | } else { 107 | $product_quantity = woocommerce_quantity_input( array( 108 | 'input_name' => "cart[{$cart_item_key}][qty]", 109 | 'input_value' => $cart_item['quantity'], 110 | 'max_value' => $_product->get_max_purchase_quantity(), 111 | 'min_value' => '0', 112 | ), $_product, false ); 113 | } 114 | 115 | echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); 116 | ?> 117 | 120 | cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); 122 | ?> 123 |
134 | 135 | 136 |
137 | 138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |
153 | 154 |
155 | 156 |
157 | 166 |
167 | 168 | 169 | --------------------------------------------------------------------------------