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_shortcode('read_more_less', 'read_more_less_button_handler'); | |
| function read_more_less_button_handler( $attrs, $content ){ | |
| $title = $attrs['title']; | |
| if( !$title ) | |
| $title = "Learn More"; | |
| return ' | |
| <div class="readmorelessbutton-container"> |
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
| <!-- Change POSTER, MP4_URL, WEBM_URL and OGG_URL --> | |
| <!-- Might need to add some height to main element --> | |
| <div class="video-hero jquery-background-video-wrapper demo-video-wrapper"> | |
| <video class="jquery-background-video" autoplay muted loop poster="POSTER"> | |
| <source src="MP4_URL" type="video/mp4"> | |
| <source src="WEBM_URL" type="video/webm"> | |
| <source src="OGG_URL" type="video/ogg"> | |
| </video> | |
| <div class="video-hero--content"></div> | |
| </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 | |
| // Admin -> WC -> Settings -> Advanced -> Page Setup | |
| add_filter( 'woocommerce_settings_pages' , 'add_new_woocommerce_settings_pages' ); | |
| function add_new_woocommerce_settings_pages( $settings ){ | |
| $new_pages = array(); | |
| foreach( $settings as $s ){ | |
| if( $s['id'] == 'advanced_page_options' ){ | |
| $new_pages[] = array( |
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 | |
| // ONLY FOR TESTING | |
| add_filter("gform_pre_render", "gform_skip_page"); | |
| function gform_skip_page($form) { | |
| if(!rgpost("is_submit_{$form['id']}") && rgget('form_page')) | |
| GFFormDisplay::$submission[$form['id']]["page_number"] = rgget('form_page'); | |
| return $form; | |
| } |
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_filter( 'posts_search', 'm_cars_search_vin' ); | |
| function m_cars_search_vin( $where ) { | |
| global $pagenow, $wpdb, $wp; | |
| // check if we are on the right page & performing a search & for the right post type | |
| if ( 'edit.php' != $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'cars' != $wp->query_vars['post_type'] ) { | |
| return $where; |
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
| <div class="video-container"> | |
| <div class="another-container"> | |
| <iframe src="https://player.vimeo.com/video/VIMEO-ID?background=1" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> | |
| </div> | |
| </div> | |
| <style> | |
| .video-container{ height: 550px; overflow: hidden; } | |
| .another-container{ height:0; overflow:hidden; position: relative; padding-bottom: 56.25%; /* 16:9 */ } | |
| #mobile_video_container iframe{ |
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_value = 'xyz'; // whatever | |
| $field_value = sprintf( '^%1$s$|s:%2$u:"%1$s";', $search_value, strlen( $search_value ) ); | |
| $args = array( | |
| 'post_type' => 'post', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => 'user_field', | |
| 'value' => $field_value, |
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 remove_class_hook( $tag, $class_name = '', $method_name = '', $priority = 10 ) { | |
| global $wp_filter; | |
| $is_hook_removed = false; | |
| if ( ! empty( $wp_filter[ $tag ]->callbacks[ $priority ] ) ) { | |
| $methods = wp_list_pluck( $wp_filter[ $tag ]->callbacks[ $priority ], 'function' ); | |
| $found_hooks = ! empty( $methods ) ? wp_list_filter( $methods, array( 1 => $method_name ) ) : array(); | |
| foreach( $found_hooks as $hook_key => $hook ) { | |
| if ( ! empty( $hook[0] ) && is_object( $hook[0] ) && get_class( $hook[0] ) === $class_name ) { |
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
| .myImg { | |
| object-fit: cover; /* also works for videos. Can also use contain*/ | |
| width: 320px; | |
| height: 180px; | |
| } | |
| /* The Netflix Way */ | |
| /* | |
| this one works everywhere and it is my favorite! You’ll need to wrap your image with a relative padded parent. |
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
| FIX BITNAMI WEIRD CACHE ISSUE: | |
| 1)Comment out these lines in /opt/bitnami/apache2/conf/httpd.conf using # in front of these 2: | |
| Include conf/pagespeed.conf | |
| Include conf/pagespeed_libraries.conf | |
| 2) PHP has Op Cache enabled by these lines in sudo nano /opt/bitnami/php/etc/php.ini | |
| opcache.enable=1 |