| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/arrivealive.org/wp-content/themes/zakra-child/ |
Upload File : |
<?php
/*
* Child theme functions file
*
*/
function zakra_child_enqueue_styles() {
$parent_style = 'zakra-style'; //parent theme style handle 'zakra-style'
//Enqueue parent and chid theme style.css
wp_register_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'zakra_child_style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'zakra_child_enqueue_styles' );
if ( ! function_exists( 'zakra_child_page_header' ) ) :
/**
* Page header.
*/
function zakra_child_page_header() {
$page_header_meta = get_post_meta( zakra_get_post_id(), 'zakra_page_header' );
if (has_post_thumbnail(zakra_get_post_id())) {
$newHeaderImage = wp_get_attachment_url( get_post_thumbnail_id(zakra_get_post_id(), 'thumbnail') );
}
// Return, if page header is disabled from customizer.
if ( ( 'page-header' !== zakra_is_page_title_enabled() && ! zakra_is_breadcrumbs_enabled() ) || ( isset( $page_header_meta[0] ) && ! $page_header_meta[0] ) || is_front_page() ) {
return;
}
$allowed_markup = array( 'h1', 'h2', 'h3', 'h3', 'h4', 'h5', 'h6', 'span', 'p', 'div' );
$markup = get_theme_mod( 'zakra_page_title_markup', 'h1' );
$style = apply_filters( 'zakra_page_title_align_filter', get_theme_mod( 'zakra_page_title_alignment', 'tg-page-header--left' ) );
// If the markup doesn't match the allowed one set default one.
if ( ! in_array( $markup, $allowed_markup, true ) ) {
$markup = 'h1';
}
// Finale.
$markup = apply_filters( 'zakra_page_header_markup', $markup );
do_action( 'zakra_before_page_header' );
if ( zakra_is_woocommerce_active() && function_exists( 'is_woocommerce' ) && is_woocommerce() && 'content-area' === get_theme_mod( 'zakra_page_title_enabled', 'page-header' ) ) {
return;
}
?>
<header class="tg-page-header <?php echo esc_attr( $style ); ?>" <?php echo ( isset($newHeaderImage) ? 'style="background-image: url(' . $newHeaderImage . ') !important;"' : '' ); ?>>
<div class="<?php zakra_css_class( 'zakra_page_header_container_class' ); ?>">
<?php
if ( 'page-header' === get_theme_mod( 'zakra_page_title_enabled', 'page-header' ) ) {
$page_title = zakra_get_title();
// Page header title.
echo sprintf(
'<%1$s class="tg-page-header__title">%2$s</%1$s>',
esc_attr( $markup ),
wp_kses_post( $page_title )
);
}
?>
<?php
// Page header breadcrumb.
if ( function_exists( 'breadcrumb_trail' ) && zakra_is_breadcrumbs_enabled() ) {
// Use WooCommerce breadcrumb.
if ( zakra_is_woocommerce_active() && function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
// Show WC breadcrumb on page header.
if ( 'page-header' === get_theme_mod( 'zakra_page_title_enabled', 'page-header' ) ) {
// Remove Breadcrumb from content.
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
// Make WC breadcrumb with the theme.
woocommerce_breadcrumb(
array(
'wrap_before' => '<nav role="navigation" aria-label="' . esc_html__( 'Breadcrumbs', 'zakra' ) . '" class="breadcrumb-trail breadcrumbs"><ul class="trail-items">',
'wrap_after' => '</ul></nav>',
'before' => '<li class="trail-item">',
'after' => '</li>',
'delimiter' => '',
)
);
}
} else { // Theme breadcrumb.
/**
* Hook - zakra_action_breadcrumbs
*
* @hooked zakra_breadcrumbs - 10
*/
do_action( 'zakra_action_breadcrumbs' );
}
}
?>
</div>
</header>
<!-- /.page-header -->
<?php
do_action( 'zakra_after_page_header' );
}
endif;
function remove_my_action() {
// This was added in the parent theme
// Removing it in order to fire our modified version
remove_action( 'zakra_action_before_content', 'zakra_page_header', 15 );
}
add_action( 'init', 'remove_my_action');
// Add the modified function to the zakra hook
add_action( 'zakra_action_before_content', 'zakra_child_page_header', 20 );
function zakra_child_add_googleanalytics() {
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46190360-2', 'arrivealive.org');
ga('send', 'pageview');
</script>
<?php
}
add_action('wp_head', 'zakra_child_add_googleanalytics');