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
| /* dynamic body class per group */ | |
| add_filter( 'body_class', function( $classes ) { | |
| $group = get_user_meta( get_current_user_id(), 'customer_group', true ); | |
| if ( ! empty( $group ) && false !== $group ) { | |
| return array_merge( $classes, array( $group ) ); | |
| } else { | |
| 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
| /* add additional content to passster */ | |
| add_filter( 'passster_content', 'passster_scroller_element', 10, 1 ); | |
| function passster_scroller_element( $content ) { | |
| $content .= '<span id="passster-scroll"></span>'; | |
| return $content; | |
| } | |
| /* add a auto scroller when content successfully unlocked */ |
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_single_product_summary', 'mp_show_original_price', 9 ); | |
| function mp_show_original_price() { | |
| $product = wc_get_product( get_the_id() ); | |
| $regular_price = get_post_meta( $product->get_id(), '_regular_price', true ); | |
| echo 'UVP: ' . wc_price( $regular_price ); | |
| } |
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 topbar for demo */ | |
| add_action( 'wp_footer', 'atomion_fix_topbar' ); | |
| function atomion_fix_topbar() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function( $ ) { | |
| var resizeTimer; |
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
| // modify these two lines | |
| $user_email = '[email protected]'; | |
| $user_password = '123456'; | |
| if ( !username_exists( $user_email ) ) { | |
| $user_id = wp_create_user( $user_email, $user_password, $user_email ); | |
| wp_update_user( array( 'ID' => $user_id, 'nickname' => $user_email ) ); | |
| $user = new WP_User( $user_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
| add_action( 'wp_footer', 'hide_model_if_mobile' ); | |
| function hide_model_if_mobile() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function( $ ) { | |
| var width = $(window).width(); | |
| if ( width <= 768 ) { | |
| $( 'check-viewport' ).css('display', 'none'); |
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
| .psag .box { | |
| max-width: 1150px !important; | |
| } | |
| .psag .box .box-left, .psag .box .box-right { | |
| width: 100%; | |
| position: relative; | |
| text-align: center; | |
| padding: 30px !important; | |
| } |
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
| if ( $('body').hasClass('single-post') ) { | |
| window.addEventListener('scroll', function(e) { | |
| var s = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; | |
| var body = document.body; | |
| var html = document.documentElement; | |
| var d = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
| var c = window.innerHeight; | |
| var position = (s / (d - c)) * 100; | |
| if ( $( "#atomion-progress-bar" ).length ) { |
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_head', 'delete_cw2_options'); | |
| function delete_cw2_options() { | |
| delete_option('cwv3_d_title'); | |
| delete_option('cwv3_d_msg'); | |
| delete_option('cwv3_enter_txt'); | |
| delete_option('cwv3_exit_txt'); | |
| } |
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 allow_excel_mime_types( $mimes ) { | |
| $mimes['xls|xlsx'] = 'application/vnd.ms-excel'; | |
| return $mimes; | |
| } | |
| add_filter( 'mime_types', 'allow_excel_mime_types' ); |