Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Theme functions and definitions.
- * This child theme was generated by Merlin WP.
- *
- * @link https://developer.wordpress.org/themes/basics/theme-functions/
- */
- /*
- * If your child theme has more than one .css file (eg. ie.css, style.css, main.css) then
- * you will have to make sure to maintain all of the parent theme dependencies.
- *
- * Make sure you're using the correct handle for loading the parent theme's styles.
- * Failure to use the proper tag will result in a CSS file needlessly being loaded twice.
- * This will usually not affect the site appearance, but it's inefficient and extends your page's loading time.
- *
- * @link https://codex.wordpress.org/Child_Themes
- */
- add_action( 'wp_enqueue_scripts', 'rhye_child_enqueue_styles', 60 );
- function rhye_child_enqueue_styles() {
- wp_enqueue_style( 'rhye-style' , get_template_directory_uri() . '/style.css' );
- wp_enqueue_style( 'rhye-child-style',
- get_stylesheet_directory_uri() . '/style.css',
- array( 'rhye-style' ),
- wp_get_theme()->get('Version')
- );
- // TEST: remove Elementor's frontend on WooCommerce pages
- if ( is_realy_woocommerce_page() ) {
- wp_dequeue_script( 'elementor-frontend' );
- wp_dequeue_style( 'elementor-frontend' );
- wp_deregister_script( 'elementor-frontend' );
- wp_deregister_style( 'elementor-frontend' );
- }
- }
- /**
- * is_realy_woocommerce_page - Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and which are also included)
- *
- * @access public
- * @return bool
- */
- function is_realy_woocommerce_page () {
- if( function_exists ( "is_woocommerce" ) && is_woocommerce()){
- return true;
- }
- $woocommerce_keys = array ( "woocommerce_shop_page_id" ,
- "woocommerce_terms_page_id" ,
- "woocommerce_cart_page_id" ,
- "woocommerce_checkout_page_id" ,
- "woocommerce_pay_page_id" ,
- "woocommerce_thanks_page_id" ,
- "woocommerce_myaccount_page_id" ,
- "woocommerce_edit_address_page_id" ,
- "woocommerce_view_order_page_id" ,
- "woocommerce_change_password_page_id" ,
- "woocommerce_logout_page_id" ,
- "woocommerce_lost_password_page_id" ) ;
- foreach ( $woocommerce_keys as $wc_page_id ) {
- if ( get_the_ID () == get_option ( $wc_page_id , 0 ) ) {
- return true ;
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment