'; } } endif; /* --------------------------------------------------------- Welcome ------------------------------------------------------------ */ function tx_welcome_js() { ?> '; } else { echo ''; } } endif; /* --------------------------------------------------------- Logo ------------------------------------------------------------ */ if ( ! function_exists('tx_logo') ) : function tx_logo() { $site_name = esc_attr( get_bloginfo('name') ); $site_url = esc_url( get_site_url() ); $logo_link = tx_get_option('logo_link_url'); $logo_link = ! empty( $logo_link ) ? esc_url( $logo_link ) : $site_url; $logo_desktop = tx_get_option('tx_logo'); $logo_mobile = tx_get_option('tx_logo_mobile'); $logo_sticky = tx_get_option('tx_logo_sticky'); $logo_mobile_sticky = tx_get_option('tx_logo_mobile_sticky'); $is_sticky_enabled = tx_is_enabled('sticky_header'); // Desktop Logo if ( ! empty($logo_desktop['url']) && ! wp_is_mobile() ) { echo ''; } // Mobile Logo if ( ! empty($logo_mobile['url']) && wp_is_mobile() ) { echo ''; } // Sticky Logos if ( $is_sticky_enabled ) { // Desktop Sticky if ( ! empty($logo_sticky['url']) && ! wp_is_mobile() ) { echo ''; } // Mobile Sticky if ( ! empty($logo_mobile_sticky['url']) && wp_is_mobile() ) { echo ''; } } // Fallback if ( ! class_exists('ReduxFramework') && has_custom_logo() ) { $custom_logo_id = get_theme_mod('custom_logo'); $custom_logo_url = wp_get_attachment_image_url($custom_logo_id, 'full'); echo ''; } elseif ( ! class_exists('ReduxFramework') ) { echo ''; } } endif; add_action( 'tx_logo', 'tx_logo' ); /* --------------------------------------------------------- Search popup ------------------------------------------------------------ */ add_action( 'tx_search', 'tx_search' ); if (!function_exists('tx_search')) : function tx_search() { ?>
class="tx-menu-btn">
'; } } endif; /* --------------------------------------------------------- Side Menu / Hamburger Icon ------------------------------------------------------------ */ add_action('tx_sidemenu_icon', 'tx_sidemenu_icon'); function tx_sidemenu_icon() { if ( tx_is_enabled('side_menu') ) : ?>
> <?php echo esc_attr(get_bloginfo('name')); ?>
$post_count, 'order' => $order, 'nopaging' => false, 'meta_key' => 'post_views_count', 'orderby' => $orderby, 'post_status' => 'publish', ]; if (!empty($cat_ids)) { $query_args['cat'] = $cat_ids; } $args = new WP_Query($query_args); if ($args->have_posts()) { ?>
ads'; } if ( $ad_js ) { $js_code = ''; } if ( $ads_switch && $img_code ) { return tx_insert_after_paragraph( $img_code, $after_p, $content ); } if ( $js_code ) { return tx_insert_after_paragraph( $js_code, $after_p, $content ); } return $content; } add_filter( 'the_content', 'tx_insert_post_ads' ); // Parent Function that makes the magic happen function tx_insert_after_paragraph( $insertion, $paragraph_id, $content ) { $closing_p = '

'; $paragraphs = explode( $closing_p, $content ); foreach ($paragraphs as $index => $paragraph) { if ( trim( $paragraph ) ) { $paragraphs[$index] .= $closing_p; } if ( $paragraph_id == $index + 1 ) { $paragraphs[$index] .= $insertion; } } return implode( '', $paragraphs ); } /* --------------------------------------------------------- Sticky Header ------------------------------------------------------------ */ if ( ! function_exists('tx_sticky_header') ) : function tx_sticky_header() { echo tx_is_enabled('sticky_header') ? 'float-panel' : 'no-sticky'; } endif; /* --------------------------------------------------------- Footer layout ------------------------------------------------------------ */ if ( ! function_exists('tx_footer_width') ) : function tx_footer_width() { $layout = tx_get_option('footer_layout', 'boxed'); // default to 'boxed' if ( $layout === 'width' ) { echo '-fluid'; } // If boxed or unknown, echo nothing } endif; /* --------------------------------------------------------- Footer Style ------------------------------------------------------------ */ add_action( 'footer-style', 'tx_footer_style' ); if ( ! function_exists('tx_footer_style') ) : function tx_footer_style() { $footer_style = tx_get_option('footer-select', 'footer2'); // default from Redux config switch ( $footer_style ) { case 'footer1': get_template_part( 'template-parts/footer/style/style', '1' ); break; case 'footer2': get_template_part( 'template-parts/footer/style/style', '2' ); break; case 'footer3': get_template_part( 'template-parts/footer/style/style', '3' ); break; } } endif; /* --------------------------------------------------------- Cookie Notice Bar ------------------------------------------------------------ */ add_action( 'wp_footer', 'tx_cookieconsent', 900 ); function tx_cookieconsent() { if ( ! tx_is_enabled('cookie_notice') ) { return; } ?>

checked['avas'] ) ) return $transient; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, TX_DEMO_URL.'avas.json' ); // 3 second timeout to avoid issue on the server curl_setopt($ch, CURLOPT_TIMEOUT, 3 ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); // make sure that we received the data in the response is not empty if( empty( $result ) ) return $transient; //check server version against current installed version if( $data = json_decode( $result ) ){ if( version_compare( $transient->checked['avas'], $data->new_version, '<' ) ) $transient->response['avas'] = (array) $data; } return $transient; } /* --------------------------------------------------------- Single Team Social Icons ------------------------------------------------------------ */ add_action('tx_single_team_social_icons', 'tx_single_team_social_icons'); function tx_single_team_social_icons() { global $post; $team_fb = get_post_meta( $post->ID, 'team_fb', true ); $team_tw = get_post_meta( $post->ID, 'team_tw', true ); $team_gp = get_post_meta( $post->ID, 'team_gp', true ); $team_ln = get_post_meta( $post->ID, 'team_ln', true ); $team_in = get_post_meta( $post->ID, 'team_in', true ); if (!empty($team_fb || $team_tw || $team_gp || $team_ln || $team_in) ) : ?>

ID, 'team-category' ); if ( $terms && ! is_wp_error( $terms ) ) : $taxonomy = array(); foreach ( $terms as $term ) : $taxonomy[] = $term->name; endforeach; $cat_name = join( " ", $taxonomy); $cat_link = get_term_link( $term ); else: $cat_name = ''; endif; if(!empty($cat_name)) : ?>

Redux option key $fonts = [ 'CustomFont' => 'tx_custom_font_ttf', 'CustomFontTwo' => 'tx_custom_font_two', // Add more as needed ]; $registered = []; foreach ( $fonts as $family => $opt_key ) { $opt = tx_get_option( $opt_key ); $url = is_array( $opt ) ? ($opt['url'] ?? '') : $opt; if ( $url ) { $registered[ $family ] = $url; } } return $registered; // ['CustomFont' => 'url', ...] } /** * Enqueue all @font-face rules for uploaded fonts only */ function tx_enqueue_custom_fonts() { $fonts = tx_get_uploaded_custom_fonts(); $css = ''; foreach ( $fonts as $family => $url ) { // Fix protocol for mixed content if ( is_ssl() ) { $url = preg_replace( '/^http:/i', 'https:', $url ); } $css .= " @font-face { font-family: '{$family}'; src: url('" . esc_url( $url ) . "') format('truetype'); font-weight: 400; font-style: normal; } "; } if ( $css ) { wp_add_inline_style( 'elementor-frontend', $css ); wp_add_inline_style( 'elementor-editor', $css ); } } add_action( 'wp_enqueue_scripts', 'tx_enqueue_custom_fonts', 20 ); add_action( 'elementor/frontend/after_enqueue_styles', 'tx_enqueue_custom_fonts', 20 ); add_action( 'elementor/preview/enqueue_styles', 'tx_enqueue_custom_fonts', 20 ); add_action( 'elementor/editor/after_enqueue_styles', 'tx_enqueue_custom_fonts', 20 ); /** * Register only the uploaded fonts in Elementor */ add_action( 'elementor/init', function() { add_filter( 'elementor/fonts/groups', function( $groups ) { // Show "Avas Custom Font" group only if there are fonts if ( ! tx_get_uploaded_custom_fonts() ) return $groups; return [ 'tx-custom-fonts' => __( 'Avas Custom Font', 'avas' ) ] + $groups; } ); add_filter( 'elementor/fonts/additional_fonts', function( $elementor_fonts ) { $fonts = tx_get_uploaded_custom_fonts(); $customs = []; foreach ( $fonts as $family => $url ) { $customs[ $family ] = 'tx-custom-fonts'; } return $customs + $elementor_fonts; } ); } ); /* --------------------------------------------------------- EOF ------------------------------------------------------------ */