|
Server IP : 10.106.20.8 / Your IP : 216.73.216.148 Web Server : Apache System : Linux webm008.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : sixiemesrc ( 611999) PHP Version : 8.0.30 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/sixiemesrc/new/wp-content/themes/gaaga/helpers/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
if ( ! function_exists( 'gaaga_template_part' ) ) {
/**
* Function that echo module template part.
*/
function gaaga_template_part( $module, $template, $slug = '', $params = array() ) {
echo gaaga_get_template_part( $module, $template, $slug, $params );
}
}
if ( ! function_exists( 'gaaga_get_template_part' ) ) {
/**
* Function that load module template part.
*/
function gaaga_get_template_part( $module, $template, $slug = '', $params = array() ) {
$file_path = '';
$html = '';
$template_path = GAAGA_MODULE_DIR . '/' . $module;
$temp_path = $template_path . '/' . $template;
if ( ! empty( $temp_path ) ) {
if ( ! empty( $slug ) ) {
$file_path = "{$temp_path}-{$slug}.php";
if ( ! file_exists( $file_path ) ) {
$file_path = $temp_path . '.php';
}
} else {
$file_path = $temp_path . '.php';
}
}
$file_path = apply_filters( 'gaaga_get_template_plugin_part', $file_path, $module, $template, $slug);
if ( is_array( $params ) && count( $params ) ) {
extract( $params );
}
if ( $file_path && file_exists( $file_path ) ) {
ob_start();
include( $file_path );
$html = ob_get_clean();
}
return $html;
}
}
if ( ! function_exists( 'gaaga_get_page_id' ) ) {
function gaaga_get_page_id() {
$page_id = get_queried_object_id();
if( is_archive() || is_search() || is_404() || ( is_front_page() && is_home() ) ) {
$page_id = -1;
}
return $page_id;
}
}
/* Convert hexdec color string to rgb(a) string */
if ( ! function_exists( 'gaaga_hex2rgba' ) ) {
function gaaga_hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
if(empty($color)) {
return $default;
}
if ($color[0] == '#' ) {
$color = substr( $color, 1 );
}
if (strlen($color) == 6) {
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
} elseif ( strlen( $color ) == 3 ) {
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
} else {
return $default;
}
$rgb = array_map('hexdec', $hex);
if($opacity){
if(abs($opacity) > 1) {
$opacity = 1.0;
}
$output = implode(",",$rgb).','.$opacity;
} else {
$output = implode(",",$rgb);
}
return $output;
}
}
if ( ! function_exists( 'gaaga_html_output' ) ) {
function gaaga_html_output( $html ) {
return apply_filters( 'gaaga_html_output', $html );
}
}
if ( ! function_exists( 'gaaga_theme_defaults' ) ) {
/**
* Function to load default values
*/
function gaaga_theme_defaults() {
$defaults = array (
'primary_color' => '#dd4242',
'primary_color_rgb' => gaaga_hex2rgba('#dd4242', false),
'secondary_color' => '#3d3d3d',
'secondary_color_rgb' => gaaga_hex2rgba('#3d3d3d', false),
'tertiary_color' => '#000000',
'tertiary_color_rgb' => gaaga_hex2rgba('#000000', false),
'body_bg_color' => '#15171c',
'body_bg_color_rgb' => gaaga_hex2rgba('#15171c', false),
'body_text_color' => '#b5b5b5',
'body_text_color_rgb' => gaaga_hex2rgba('#b5b5b5', false),
'headalt_color' => '#ffffff',
'headalt_color_rgb' => gaaga_hex2rgba('#ffffff', false),
'link_color' => '#ffffff',
'link_color_rgb' => gaaga_hex2rgba('#ffffff', false),
'link_hover_color' => '#dd4242',
'link_hover_color_rgb' => gaaga_hex2rgba('#dd4242', false),
'border_color' => '#717171',
'border_color_rgb' => gaaga_hex2rgba('#717171', false),
'accent_text_color' => '#ffffff',
'accent_text_color_rgb' => gaaga_hex2rgba('#ffffff', false),
'body_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 400,
'fs-desktop' => 16,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.64,
'lh-desktop-unit' => ''
),
'h1_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 60,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'h2_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 50,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'h3_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 44,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'h4_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 30,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'h5_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 26,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'h6_typo' => array (
'font-family' => "Prompt",
'font-fallback' => '"Prompt", sans-serif',
'font-weight' => 600,
'fs-desktop' => 20,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.16,
'lh-desktop-unit' => ''
),
'extra_typo' => array (
'font-family' => "Dancing Script",
'font-fallback' => '"Dancing Script", sans-serif',
'font-weight' => 500,
'fs-desktop' => 18,
'fs-desktop-unit' => 'px',
'lh-desktop' => 1.1,
'lh-desktop-unit' => ''
),
);
return $defaults;
}
}