Advertisement
artemsemkin

Untitled

Feb 10th, 2024
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Theme functions and definitions.
  4.  * This child theme was generated by Merlin WP.
  5.  *
  6.  * @link https://developer.wordpress.org/themes/basics/theme-functions/
  7.  */
  8.  
  9. /*
  10.  * If your child theme has more than one .css file (eg. ie.css, style.css, main.css) then
  11.  * you will have to make sure to maintain all of the parent theme dependencies.
  12.  *
  13.  * Make sure you're using the correct handle for loading the parent theme's styles.
  14.  * Failure to use the proper tag will result in a CSS file needlessly being loaded twice.
  15.  * This will usually not affect the site appearance, but it's inefficient and extends your page's loading time.
  16.  *
  17.  * @link https://codex.wordpress.org/Child_Themes
  18.  */
  19. add_action( 'wp_enqueue_scripts', 'kinsey_child_enqueue_styles', 99 );
  20. function kinsey_child_enqueue_styles() {
  21.   wp_enqueue_style( 'kinsey-style', get_template_directory_uri() . '/style.css' );
  22.   wp_enqueue_style(
  23.     'kinsey-child-style',
  24.     get_stylesheet_directory_uri() . '/style.css',
  25.     array( 'kinsey-style' ),
  26.     wp_get_theme()->get( 'Version' )
  27.   );
  28. }
  29.  
  30. add_filter( 'theme_mod_preloader_enabled', function( $value ) {
  31.   // Ex 1: don't show preloader on specific post with ID 1164
  32.   if ( is_single( '1164' ) ) {
  33.     $value = false;
  34.   }
  35.  
  36.   // Ex 2: don't show preloader on specific page with ID 1355
  37.   if ( is_page( '1355' ) ) {
  38.     $value = false;
  39.   }
  40.  
  41.   // Ex 3: don't show preloader on Elementor pages with disabled "TO" AJAX route
  42.   if ( in_array( 'page-no-ajax', get_body_class() ) ) {
  43.     $value = false;
  44.   }
  45.  
  46.   return $value;
  47. });
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement