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 my_is_post_to_update( $continue, $post_id, $xml_node, $import_id ) { | |
| // Run this code on a specific import | |
| if ($import_id === 5) { | |
| // Do something to decide if this post should update | |
| if ( ... ) { | |
| return true; | |
| } | |
| // Don't update this post | |
| return false; | |
| } |
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
| //https://stackoverflow.com/questions/52462239/allow-backorders-and-notify-customer-for-specific-product-categories-in-woocomme | |
| add_filter( 'woocommerce_product_is_in_stock', 'filter_product_is_in_stock', 10, 2 ); | |
| function filter_product_is_in_stock( $is_in_stock, $product ){ | |
| // Here set the products categories in the array (can be terms ids, slugs or names) | |
| $categories = array("clothing"); | |
| if( has_term( $categories, 'product_cat', $product->get_id() ) ){ | |
| $is_in_stock = true; | |
| } |
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( 'wp_enqueue_scripts', 'my_enqueue_fontawesome' ); | |
| function my_enqueue_fontawesome(){ | |
| wp_enqueue_script( 'wp_fontawesome', 'https://kit.fontawesome.com/1339480997.js', [], '5' ); | |
| } |
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
| Multi site opzetten + dupliceren | |
| EN: .com | |
| Japan: .com/ja | |
| China: .com/zh-hans | |
| Volg stappenplan: | |
| https://codex.wordpress.org/Create_A_Network |
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 | |
| add_action('admin_init', function(){ | |
| $query = new WC_Product_Query( array( | |
| 'limit' => -1, | |
| 'type' => 'variable', | |
| 'return' => 'ids', | |
| 'backorders' => 'no', | |
| //'manage_stock' => true |
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
| include('ICS.php'); | |
| date_default_timezone_set('Europe/Amsterdam'); | |
| $date = "18-06-2022"; | |
| $time = "15:30:00"; | |
| $startTime = $date . " " . $time; | |
| if (date('I', strtotime($startTime))) { | |
| $timestamp = strtotime($startTime) - (60*60*2); //minus 2 hours for server time for summer time | |
| $startTime = date('Y-m-d H:i:s', $timestamp); |
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 | |
| //https://woocommerce.com/document/image-sizes-theme-developers/ | |
| add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) { | |
| return array( | |
| 'width' => 150, | |
| 'height' => 150, | |
| 'crop' => 0, | |
| ); | |
| } ); |
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 | |
| // FacetWP pager | |
| add_action('wp', function(){ | |
| if (is_product_category()) { | |
| remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); | |
| remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); | |
| remove_action( 'woocommerce_after_shop_loop', 'avia_woocommerce_after_shop_loop', 10); | |
| add_action( 'woocommerce_after_shop_loop', function(){ | |
| echo '<div class="archive-pager">'; | |
| echo '<div class="pagination">'.facetwp_display( 'pager' ).'</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
| <?php | |
| // Add specific CSS class by filter. | |
| add_filter( 'body_class', function( $classes ) { | |
| $classes[] = 'dsm_body_' . get_current_blog_id(); | |
| 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
| @media (max-width: 1250px) { /* Change the width as you need */ | |
| .responsive #top #avia-menu.av-main-nav .menu-item { | |
| display: none !important; | |
| } | |
| .responsive #top .#avia-menu.av-main-nav .menu-item-avia-special { | |
| display: block !important; | |
| } | |
| } |