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
| $options['rtl'] = true; // Example: Enable right-to-left support | |
| $options['animation'] = 'fade'; // Example: Change animation type to fade | |
| $options['smoothHeight'] = false; // Example: Disable smooth height transition | |
| $options['directionNav'] = true; // Example: Enable direction navigation arrows | |
| $options['controlNav'] = 'numbers'; // Example: Use numbers for navigation | |
| $options['slideshow'] = true; // Example: Enable slideshow | |
| $options['animationSpeed'] = 800; // Example: Change animation speed to 800 milliseconds | |
| $options['animationLoop'] = true; // Example: Allow animation looping | |
| $options['allowOneSlide'] = true; // Example: Allow carousel with only one slide |
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 set_default_product_type_variable() { | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($) { | |
| // Set the default product type to "variable" | |
| $('#product-type').val('variable').change(); | |
| }); | |
| </script> | |
| <?php | |
| } |
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 screen and (max-width: 1024px) { | |
| .isotope-item { | |
| display: inline-block; | |
| width: 48%; /* Adjust the width of each item based on the number of columns you want */ | |
| margin: 0 1% 20px; /* Adjust the margin between items and add margin below each item */ | |
| vertical-align: top; /* Align items to the top of the container */ | |
| box-sizing: border-box; /* Include padding and border in the width and height */ | |
| } |
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_email_order_details', 'add_custom_fields_to_order_email', 10, 4); | |
| function add_custom_fields_to_order_email($order, $sent_to_admin, $plain_text, $email) { | |
| foreach ($order->get_items() as $item_id => $item) { | |
| $product_id = $item->get_product_id(); | |
| $expiration_date = get_post_meta($product_id, '_expiration_date', true); | |
| if ( ! empty( $expiration_date ) ) { |
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 exclude_products_from_search($query) { | |
| if (is_admin() || !$query->is_main_query()) { | |
| return; | |
| } | |
| if ($query->is_search) { | |
| $query->set('post_type', array('post', 'page')); // Exclude products from search results | |
| } | |
| } |
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 custom field to product general settings metabox | |
| function custom_product_general_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; | |
| // Custom field | |
| woocommerce_wp_textarea_input( | |
| array( | |
| 'id' => '_custom_product_description', |
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_before_cart', 'apply_discount_and_add_free_product'); | |
| function apply_discount_and_add_free_product() { | |
| global $woocommerce; | |
| if (WC()->cart->has_discount('30OFF')) { | |
| $free_product_id = 14646; | |
| $quantity = 1; | |
| WC()->cart->add_to_cart($free_product_id, $quantity); |
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 query for mobile screens */ | |
| @media only screen and (max-width: 767px) { | |
| /* Adjust styles for filter links on mobile screens */ | |
| .isotope-filter a { | |
| display: block; /* Make links display as block elements */ | |
| margin: 0 0 10px; /* Add margin below each link */ | |
| width: 100%; /* Make links take up full width */ | |
| } | |
| } |
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
| register_taxonomy( 'portfolio-type', 'portfolio', | |
| array( | |
| 'labels' => array( | |
| 'name' => _x( 'Portfolio Types', 'taxonomy general name' , 'genesis-portfolio-pro' ), | |
| 'singular_name' => _x( 'Portfolio Type' , 'taxonomy singular name', 'genesis-portfolio-pro' ), | |
| 'search_items' => __( 'Search Portfolio Types' , 'genesis-portfolio-pro' ), | |
| 'popular_items' => __( 'Popular Portfolio Types' , 'genesis-portfolio-pro' ), | |
| 'all_items' => __( 'All Types' , 'genesis-portfolio-pro' ), | |
| 'edit_item' => __( 'Edit Portfolio Type' , 'genesis-portfolio-pro' ), | |
| 'update_item' => __( 'Update Portfolio Type' , 'genesis-portfolio-pro' ), |
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('init', 'assign_random_free_product'); | |
| function assign_random_free_product() { | |
| $today = date('Y-m-d'); | |
| $assigned_product_date = get_option('random_free_product_date'); | |
| if ( $today != $assigned_product_date ) { | |
| $random_product_id = get_random_free_product(); |