| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/themes/glaza/includes/ |
Upload File : |
<?php
/**
* header pingback
*/
if ( ! function_exists( 'glaza_pingback_header' ) ):
function glaza_pingback_header() {
if ( is_singular() && pings_open() ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
<?php endif;
}
endif;
add_action( 'wp_head', 'glaza_pingback_header' );
/**
* @param $html
*
* @return bool
* remove post view
*/
if ( ! function_exists( 'glaza_post_views_remove' ) ) :
function glaza_post_views_remove( $html ) {
if ( is_single() ) {
return false;
} else {
return $html;
}
}
endif;
add_filter( 'pvc_post_views_html', 'glaza_post_views_remove' );
//body class
if ( ! function_exists( 'glaza_body_add_class' ) ) {
function glaza_body_add_class( $classes ) {
$navbar_sticky = glaza_get_option( 'navbar_sticky' );
$navbar_sticky_smart = glaza_get_option( 'navbar_sticky_smart' );
$site_tooltips = glaza_get_option( 'site_tooltips' );
$site_tooltips_touch = glaza_get_option( 'site_tooltips_touch' );
$embed_responsive = glaza_get_option( 'single_post_embed_responsive' );
$smooth_display = glaza_get_option( 'smooth_display' );
$site_back_to_top = glaza_get_option( 'site_back_to_top' );
$site_breadcrumb = glaza_get_option( 'site_breadcrumb' );
if ( is_home() && ! empty( $site_breadcrumb ) ) {
$site_breadcrumb = glaza_get_option( 'blog_breadcrumb' );
}
if ( ! empty( $navbar_sticky ) ) {
$classes[] = 'is-navbar-sticky';
}
if ( ! empty( $site_breadcrumb ) && ( function_exists( 'bcn_display' ) || function_exists( 'yoast_breadcrumb' ) ) ) {
$classes[] = 'is-breadcrumb';
} else {
$classes[] = 'none-breadcrumb';
}
if ( ! empty( $navbar_sticky_smart ) ) {
$classes[] = 'is-smart-sticky';
}
if ( ! empty( $site_tooltips ) ) {
$classes[] = 'is-tooltips';
if ( ! empty( $site_tooltips_touch ) ) {
$classes[] = 'is-tooltips-touch';
}
}
if ( ! empty( $embed_responsive ) ) {
$classes[] = 'is-embed-responsive';
}
if ( ! empty( $site_back_to_top ) ) {
$classes[] = 'is-back-top';
}
if ( ! empty( $smooth_display ) ) {
$classes[] = 'is-smooth-display';
}
if ( is_single() && 'post' == get_post_type() ) {
$single_layout = glaza_check_post_layout();
$classes[] = 'is-single-' . trim( $single_layout );
}
return $classes;
}
}
add_filter( 'body_class', 'glaza_body_add_class', 20 );
//slider
if ( ! function_exists( 'glaza_body_data' ) ) {
function glaza_body_data() {
$slider_play = glaza_get_option( 'slider_play' );
$slider_speed = glaza_get_option( 'slider_speed' );
if ( empty( $slider_play ) ) {
$slider_play = 0;
} else {
$slider_play = 1;
}
if ( empty( $slider_speed ) ) {
$slider_speed = 5550;
}
if ( intval( $slider_speed ) < 1500 ) {
$slider_speed = 1500;
}
$str = '';
$str .= 'data-slider_play="' . esc_attr( $slider_play ) . '" ';
$str .= 'data-slider_speed="' . esc_attr( $slider_speed ) . '" ';
return $str;
}
}
/**
* redirect to active plugin
*/
if ( ! function_exists( 'glaza_after_theme_active' ) ) {
function glaza_after_theme_active() {
global $pagenow;
if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
$first_active = get_option( 'glaza_first_active_theme', '' );
if ( ! empty( $first_active ) ) {
update_option( 'glaza_first_active_theme', '1' );
} else {
add_option( 'glaza_first_active_theme', '1' );
}
//redirect
wp_redirect( admin_url( 'admin.php?page=glaza-plugins' ) );
exit;
}
}
}
add_action( 'after_switch_theme', 'glaza_after_theme_active' );