| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/revivere/www/wp-content/themes/astra-child-theme/ |
Upload File : |
<?php
/**
* Astra Child Theme functions and definitions
*/
// Enqueue styles
function astra_child_enqueue_styles() {
// Parent theme styles
wp_enqueue_style('astra-theme-css', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get('Version'));
// Child theme styles
wp_enqueue_style('astra-child-style', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), '1.0.2');
}
add_action('wp_enqueue_scripts', 'astra_child_enqueue_styles');
// Enqueue GSAP and custom scripts
function astra_child_enqueue_scripts() {
// GSAP Core - UMD version
wp_enqueue_script('gsap-core', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js', array(), '3.12.5', true);
// Load GSAP plugins (free versions only)
$gsap_plugins = array(
'ScrollTrigger' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js',
'ScrollToPlugin' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollToPlugin.min.js',
'Draggable' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/Draggable.min.js',
'MotionPathPlugin' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/MotionPathPlugin.min.js',
'Flip' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/Flip.min.js',
'Observer' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/Observer.min.js',
'TextPlugin' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/TextPlugin.min.js',
'CustomEase' => 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/CustomEase.min.js',
);
foreach ($gsap_plugins as $plugin => $url) {
wp_enqueue_script('gsap-' . strtolower($plugin), $url, array('gsap-core'), '3.12.5', true);
}
// Lenis Smooth Scroll (free alternative to ScrollSmoother)
wp_enqueue_script('lenis-scroll', 'https://unpkg.com/lenis@1.1.5/dist/lenis.min.js', array(), '1.1.5', true);
// Custom animation scripts
wp_enqueue_script('astra-child-animations', get_stylesheet_directory_uri() . '/animations.js', array('gsap-core', 'jquery'), '1.0.2', true);
wp_enqueue_script('astra-child-smooth-scroll', get_stylesheet_directory_uri() . '/smooth-scroll.js', array('gsap-core', 'lenis-scroll', 'jquery'), '1.0.2', true);
}
add_action('wp_enqueue_scripts', 'astra_child_enqueue_scripts');
// No wrapper divs needed for Lenis - it works differently
// But we'll add a class to body for Lenis
function astra_child_add_lenis_class() {
?>
<script>
document.documentElement.classList.add('lenis');
document.documentElement.classList.add('lenis-smooth');
</script>
<?php
}
add_action('wp_head', 'astra_child_add_lenis_class');
// Make Elementor compatible with smooth scrolling
function astra_child_elementor_compatibility() {
?>
<style>
/* Lenis smooth scroll styles */
html.lenis,
html.lenis body {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
.lenis.lenis-scrolling iframe {
pointer-events: none;
}
/* Ensure Elementor popups and sticky elements work */
.elementor-popup-modal {
z-index: 9999 !important;
}
/* Fix for Elementor carousels */
.elementor-widget-testimonial-carousel,
.elementor-widget-media-carousel,
.elementor-widget-image-carousel {
position: relative;
z-index: 2;
}
/* Animation classes base visibility */
.fade-heading,
.timeline-box .timeline-item,
.grid-card {
opacity: 1; /* Changed from 0 to 1 to ensure visibility */
}
</style>
<?php
}
add_action('wp_head', 'astra_child_elementor_compatibility');
?>