Advertisement
artemsemkin

Asli: preloader image indicator

Apr 4th, 2024 (edited)
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1. <?php
  2.  
  3. // 1. Create file in your child theme: /wp-content/themes/asli-child/template-parts/preloader/preloader.php with the contents below.
  4. // 2. Put the correct URI to your loading gif to the <img> below.
  5. // 3. Enable theme's preloader in Elementor Site settings and adjust "Final Delay Before Displaying Page" under "Animation" tab as you need.
  6.  
  7. $defaults = array(
  8.   'beforeLoadingText'            => arts_get_kit_settings(
  9.     'preloader_before_loading_text',
  10.     esc_html__( 'Loading...', 'asli' )
  11.   ),
  12.   'afterLoadingText'             => arts_get_kit_settings(
  13.     'preloader_after_loading_text',
  14.     esc_html__( 'Filmmaker & Photographer', 'asli' )
  15.   ),
  16.   'headingText'                  => arts_get_kit_settings(
  17.     'preloader_heading_text',
  18.     esc_html__( 'Asli Wells', 'asli' )
  19.   ),
  20.   'counterEnabled'               => arts_get_kit_settings( 'preloader_counter_enabled', true ),
  21.   'slidingImagesEnabled'         => arts_get_kit_settings( 'preloader_sliding_images_enabled', true ),
  22.   'slidingImages'                => arts_get_kit_settings( 'preloader_sliding_images' ),
  23.   'slidingImagesSize'            => arts_get_kit_settings( 'preloader_sliding_images_size', 'full' ),
  24.   'slidingImagesCustomDimension' => arts_get_kit_settings( 'preloader_sliding_images_custom_dimension', null ),
  25. );
  26. $args     = wp_parse_args( $args, $defaults );
  27.  
  28. $attributes = array(
  29.   'class' => array(
  30.     'section-fullheight',
  31.     'text-center',
  32.   ),
  33.   'id'    => 'page-preloader',
  34. );
  35.  
  36. $attributes = arts_add_component_attributes(
  37.   $attributes,
  38.   array(
  39.     'name'         => 'Preloader',
  40.     'hasAnimation' => true,
  41.   )
  42. );
  43.  
  44. ?>
  45.  
  46. <div <?php arts_print_attributes( $attributes ); ?>>
  47.   <div class="preloader__wrapper js-preloader__wrapper">
  48.     <!-- Adjust "src" to the path to your image -->
  49.     <img src="https://PATH_TO_YOUR.GIF" alt="" class="preloader__image">
  50.     <?php // get_template_part( 'template-parts/preloader/partials/fast-sliding-images', null, $args ); ?>
  51.     <?php // get_template_part( 'template-parts/preloader/partials/heading', null, $args ); ?>
  52.     <?php // get_template_part( 'template-parts/preloader/partials/counter', null, $args ); ?>
  53.     <?php // get_template_part( 'template-parts/preloader/partials/bottom-content', null, $args ); ?>
  54.   </div>
  55. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement