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 | |
| function date_span_filter($start_date, $end_date) { | |
| if ( $start_date ) { | |
| // Dates should both be in a Y-m-d format | |
| $start_calendar_date = date('j F Y', strtotime($start_date)); | |
| if ( ! $end_date ) { | |
| // There is no range. Just return the required start date | |
| $date = $start_calendar_date; | |
| } else { | |
| if ( $start_date == $end_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
| <?php | |
| if ( is_singular('product') ) { | |
| global $post; | |
| // get categories | |
| $terms = wp_get_post_terms( $post->ID, 'product_cat' ); | |
| foreach ( $terms as $term ) $cats_array[] = $term->term_id; |
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 | |
| /* | |
| ############################## | |
| ########### Search ########### | |
| ############################## | |
| Included are steps to help make this script easier for other to follow | |
| All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10 | |
| [list_searcheable_acf list all the custom fields we want to include in our search query] | |
| @return [array] [list of custom fields] |
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 the field to the checkout | |
| **/ | |
| add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
| function my_custom_checkout_field( $checkout ) { | |
| echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
| /** |
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
| WordPress Block Development Made Easy | |
| https://webdevstudios.com/2020/06/16/wordpress-block-development/ | |
| Using Markdown and Localization in the WordPress Block Editor | |
| https://css-tricks.com/using-markdown-and-localization-in-the-wordpress-block-editor/ | |
| Gutenberg blocks: Add custom default class names | |
| https://poolghost.com/add-custom-default-class-names-to-gutenberg-blocks/ | |
| How to Create a Simple Gutenberg Block Pattern in WordPress |
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 | |
| /* Pull apart OEmbed video link to get thumbnails out*/ | |
| function get_video_thumbnail_uri( $video_uri ) { | |
| $thumbnail_uri = ''; | |
| // determine the type of video and the video id | |
| $video = parse_video_uri( $video_uri ); | |
| // get youtube thumbnail |
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
| ##lang | |
| AddDefaultCharset UTF-8 | |
| DefaultLanguage en-US | |
| #fix permalinks in woo | |
| <Directory /> | |
| Options FollowSymLinks | |
| AllowOverride All | |
| </Directory> |
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 | |
| //Disable gutenberg style in Front | |
| function jjm_deregister_styles() { | |
| wp_dequeue_style( 'wp-block-library' ); | |
| } | |
| add_action( 'wp_print_styles', 'jjm_deregister_styles', 100 ); | |
| /** | |
| * Theme Block defaults | |
| */ |
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 | |
| /* Parse the video uri/url to determine the video type/source and the video id */ | |
| function parse_video_uri( $url ) { | |
| // Parse the url | |
| $parse = parse_url( $url ); | |
| // Set blank variables | |
| $video_type = ''; | |
| $video_id = ''; |