403Webshell
Server IP : 104.26.4.103  /  Your IP : 216.73.216.4
Web Server : nginx/1.27.1
System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : arabianexpress ( 1872)
PHP Version : 8.0.30
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v9321/leapdubai/public_html/wp-content/themes/printx/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v9321/leapdubai/public_html/wp-content/themes/printx/inc/template-helper.php
<?php
/**
 * Custom template tags for this theme
 *
 * Eventually, some of the functionality here could be replaced by core features.
 *
 * @package printx
 */

function get_header_style($style){
    if ( $style == 'header_2'  ) {
        get_template_part( 'template-parts/header/header-2' );
    }elseif ( $style == 'header_3'  ) {
        get_template_part( 'template-parts/header/header-3' );
    }elseif ( $style == 'header_4' ) {
        get_template_part( 'template-parts/header/header-4' );
    }elseif ( $style == 'header_5' ) {
        get_template_part( 'template-parts/header/header-5' );
    }elseif ( $style == 'header_6' ) {
        get_template_part( 'template-parts/header/header-6' );
    }elseif ( $style == 'header_7' ) {
        get_template_part( 'template-parts/header/header-7' );
    }else{
        get_template_part( 'template-parts/header/header-1');
    }
}

function printx_check_header() {
    $tp_header_tabs = function_exists('tpmeta_field')? tpmeta_field('printx_header_tabs') : false;
    $tp_header_style_meta = function_exists('tpmeta_field')? tpmeta_field('printx_header_style') : '';
    $elementor_header_template_meta = function_exists('tpmeta_field')? tpmeta_field('printx_header_templates') : false;

    $printx_header_option_switch = get_theme_mod('printx_header_elementor_switch', false);
    $header_default_style_kirki = get_theme_mod( 'header_layout_custom', 'header_1' );
    $elementor_header_templates_kirki = get_theme_mod( 'printx_header_templates' );
    
    if($tp_header_tabs == 'default'){
        if($printx_header_option_switch){
            if($elementor_header_templates_kirki){
                echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_header_templates_kirki);
            }
        }else{ 
            if($header_default_style_kirki){
                get_header_style($header_default_style_kirki);
            }else{
                get_template_part( 'template-parts/header/header-1' );
            }
        }
    }elseif($tp_header_tabs == 'custom'){
        if ($tp_header_style_meta) {
            get_header_style($tp_header_style_meta);
        }else{
            get_header_style($header_default_style_kirki);
        }  
    }elseif($tp_header_tabs == 'elementor'){
        if($elementor_header_template_meta){
            echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_header_template_meta);
        }else{
            echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_header_templates_kirki);
        }
    }else{
        if($printx_header_option_switch){

            if($elementor_header_templates_kirki){
                echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_header_templates_kirki);
            }else{
                get_template_part( 'template-parts/header/header-1' );
            }
        }else{
            get_header_style($header_default_style_kirki);

        }
        
    }

}
add_action( 'printx_header_style', 'printx_check_header', 10 );

/**
 * [printx_footer_lang description]
 * @return [type] [description]
 */

function printx_footer_lang_defualt() {
?>
<ul>
    <li>
        <a id="tp-copyright__lang-toogle" href="javascript:void(0)">
            <?php echo esc_html__('English', 'printx'); ?>
            <span>
                <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path
                        d="M8.37213 0.917894L8.11008 0.638679C8.02761 0.55148 7.91788 0.503441 7.80061 0.503441C7.68341 0.503441 7.57355 0.55148 7.49108 0.638679L4.50179 3.80193L1.50905 0.635169C1.42671 0.54797 1.31685 0.5 1.19965 0.5C1.08244 0.5 0.972524 0.54797 0.890117 0.635169L0.628001 0.912663C0.457333 1.09312 0.457333 1.38706 0.628001 1.56752L4.19122 5.35148C4.27356 5.43861 4.38328 5.5 4.50153 5.5H4.50289C4.62016 5.5 4.72989 5.43854 4.81223 5.35148L8.37213 1.57777C8.4546 1.49064 8.49987 1.37103 8.5 1.24701C8.5 1.12292 8.4546 1.00496 8.37213 0.917894Z"
                        fill="white" />
                </svg>

            </span>
        </a>

        <?php do_action( 'printx_language' );?>

        <?php
}

/**
 * [printx_header_lang description]
 * @return [type] [description]
 */

function printx_header_lang_defualt() {
    $printx_header_lang = get_theme_mod( 'printx_header_lang', true );
    if ( $printx_header_lang ): ?>

        <ul>
            <li>
                <a id="tp-header-top-4__language-toogle" href="javascript:void(0)">
                    <?php echo esc_html__('English', 'printx'); ?>
                    <span>
                        <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <path
                                d="M8.37213 0.917894L8.11008 0.638679C8.02761 0.55148 7.91788 0.503441 7.80061 0.503441C7.68341 0.503441 7.57355 0.55148 7.49108 0.638679L4.50179 3.80193L1.50905 0.635169C1.42671 0.54797 1.31685 0.5 1.19965 0.5C1.08244 0.5 0.972524 0.54797 0.890117 0.635169L0.628001 0.912663C0.457333 1.09312 0.457333 1.38706 0.628001 1.56752L4.19122 5.35148C4.27356 5.43861 4.38328 5.5 4.50153 5.5H4.50289C4.62016 5.5 4.72989 5.43854 4.81223 5.35148L8.37213 1.57777C8.4546 1.49064 8.49987 1.37103 8.5 1.24701C8.5 1.12292 8.4546 1.00496 8.37213 0.917894Z"
                                fill="white" />
                        </svg>

                    </span>
                </a>

                <?php do_action( 'printx_language' );?>

                <?php endif;?>
                <?php
}

/**
 * [printx_language_list description]
 * @return [type] [description]
 */
function _printx_language( $mar ) {
    return $mar;
}
function printx_language_list() {

    $mar = '';
    $languages = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
    if ( !empty( $languages ) ) {
        $mar = '<ul class="tp-header-lang-list tp-lang-list">';
        foreach ( $languages as $lan ) {
            $active = $lan['active'] == 1 ? 'active' : '';
            $mar .= '<li class="' . $active . '"><a href="' . $lan['url'] . '">' . $lan['translated_name'] . '</a></li>';
        }
        $mar .= '</ul>';
    } else {
        //remove this code when send themeforest reviewer team
        $mar .= '<ul class="tp-header-top-4__value-submenu">';
        $mar .= '<li><a href="#">' . esc_html__( 'English', 'printx' ) . '</a></li>';
        $mar .= '<li><a href="#">' . esc_html__( 'Bangla', 'printx' ) . '</a></li>';
        $mar .= '<li><a href="#">' . esc_html__( 'French', 'printx' ) . '</a></li>';
        $mar .= '<li><a href="#">' . esc_html__( 'Hindi', 'printx' ) . '</a></li>';
        $mar .= ' </ul></li></ul>';
    }
    print _printx_language( $mar );
}
add_action( 'printx_language', 'printx_language_list' );


// header logo
function printx_header_logo() { ?>
                <?php
        
    $printx_logo_on = function_exists('tpmeta_field')? tpmeta_field('printx_en_secondary_logo') : '';
    $printx_logo = get_template_directory_uri() . '/assets/img/logo/logo.png';
    $printx_logo_black = get_template_directory_uri() . '/assets/img/logo/white-logo.png';
    $bg_img_from_page = function_exists('tpmeta_image_field')? tpmeta_image_field('printx_page_logo') : '';

    $printx_site_logo = get_theme_mod( 'header_logo', $printx_logo );
    $printx_secondary_logo = get_theme_mod( 'header_secondary_logo', $printx_logo_black );
    
?>

                <?php if ( $printx_logo_on == 'on' ) : ?>
                <a class="secondary-logo" href="<?php print esc_url( home_url( '/' ) );?>">
                    <img src="<?php print esc_url( $printx_secondary_logo );?>"
                        alt="<?php print esc_attr__( 'logo', 'printx' );?>" />
                </a>
                <?php else : ?>
                <a class="standard-logo header-logo" href="<?php print esc_url( home_url( '/' ) );?>">
                    <?php if(!empty($bg_img_from_page['url'])) : ?>
                    <img src="<?php print esc_url( $bg_img_from_page['url'] );?>"
                        alt="<?php print esc_attr__( 'logo', 'printx' );?>" />
                    <?php else : ?>
                    <img src="<?php print esc_url( $printx_site_logo );?>"
                        alt="<?php print esc_attr__( 'logo', 'printx' );?>" />
                    <?php endif; ?>
                </a>
                <?php endif; ?>
                <?php
}
/**
 * [printx_header_social_profiles description]
 * @return [type] [description]
 */
function printx_header_social_profiles() {
    $printx_topbar_fb_url = get_theme_mod( 'header_facebook_link', __( '#', 'printx' ) );
    $printx_topbar_twitter_url = get_theme_mod( 'header_twitter_link', __( '#', 'printx' ) );
    $printx_topbar_instagram_url = get_theme_mod( 'header_instagram_link', __( '#', 'printx' ) );
    $printx_topbar_linkedin_url = get_theme_mod( 'header_linkedin_link', __( '#', 'printx' ) );
    $printx_topbar_youtube_url = get_theme_mod( 'header_youtube_link', __( '#', 'printx' ) );
    ?>
                <?php if ( !empty( $printx_topbar_fb_url ) ): ?>
                <a href="<?php print esc_url( $printx_topbar_fb_url );?>"><i class="fa-brands fa-facebook-f"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_topbar_twitter_url ) ): ?>
                <a href="<?php print esc_url( $printx_topbar_twitter_url );?>"><i class="fa-brands fa-twitter"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_topbar_instagram_url ) ): ?>
                <a href="<?php print esc_url( $printx_topbar_instagram_url );?>"><i
                        class="fa-brands fa-instagram"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_topbar_linkedin_url ) ): ?>
                <a href="<?php print esc_url( $printx_topbar_linkedin_url );?>"><i class="fab fa-linkedin"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_topbar_youtube_url ) ): ?>
                <a href="<?php print esc_url( $printx_topbar_youtube_url );?>"><i class="fab fa-youtube"></i></a>
                <?php endif;?>

                <?php
}
/**
 * [printx_footer_social_profiles description]
 * @return [type] [description]
 */
function printx_footer_social_profiles() {
    $printx_footer_fb_url = get_theme_mod( 'footer_facebook_link', __( '#', 'printx' ) );
    $printx_footer_twitter_url = get_theme_mod( 'footer_twitter_link', __( '#', 'printx' ) );
    $printx_footer_instagram_url = get_theme_mod( 'footer_instagram_link', __( '#', 'printx' ) );
    $printx_footer_linkedin_url = get_theme_mod( 'footer_linkedin_link', __( '#', 'printx' ) );
    $printx_footer_youtube_url = get_theme_mod( 'footer_youtube_link', __( '#', 'printx' ) );
    ?>
                <?php if ( !empty( $printx_footer_fb_url ) ): ?>
                <a href="<?php print esc_url( $printx_footer_fb_url );?>"><i class="fa-brands fa-facebook-f"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_footer_twitter_url ) ): ?>
                <a href="<?php print esc_url( $printx_footer_twitter_url );?>"><i class="fa-brands fa-twitter"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_footer_instagram_url ) ): ?>
                <a href="<?php print esc_url( $printx_footer_instagram_url );?>"><i
                        class="fa-brands fa-instagram"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_footer_linkedin_url ) ): ?>
                <a href="<?php print esc_url( $printx_footer_linkedin_url );?>"><i class="fab fa-linkedin"></i></a>
                <?php endif;?>

                <?php if ( !empty( $printx_footer_youtube_url ) ): ?>
                <a href="<?php print esc_url( $printx_footer_youtube_url );?>"><i class="fab fa-youtube"></i></a>
                <?php endif;?>

                <?php
}
/**
 * [header_top_social description]
 * @return [type] [description]
 */
function header_top_social() {
    $header_topSocial_switch = get_theme_mod( 'header_topSocial_switch', false );
    $header_top_facebook = get_theme_mod( 'header_top_facebook', __( '#', 'printx' ) );
    $header_top_twitter = get_theme_mod( 'header_top_twitter', __( '#', 'printx' ) );
    $header_top_linkedin = get_theme_mod( 'header_top_linkedin', __( '#', 'printx' ) );
    $header_top_instagram = get_theme_mod( 'header_top_instagram', __( '#', 'printx' ) );
    $header_top_youtube = get_theme_mod( 'header_top_youtube', __( '#', 'printx' ) );
    
    if(!empty($header_topSocial_switch)) : 
        ?>
                <div class="tp-header-top-2__social-box text-end">
                    <?php if(!empty($header_top_facebook)) : ?>
                    <a href="<?php echo esc_url($header_top_facebook); ?>"><i class="fab fa-facebook-f"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_twitter)) : ?>
                    <a href="<?php echo esc_url($header_top_twitter); ?>"><i class="fab fa-twitter"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_linkedin)) : ?>
                    <a href="<?php echo esc_url($header_top_linkedin); ?>"><i class="fab fa-linkedin"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_instagram)) : ?>
                    <a href="<?php echo esc_url($header_top_instagram); ?>"><i class="fab fa-instagram"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_youtube)) : ?>
                    <a href="<?php echo esc_url($header_top_youtube); ?>"><i class="fab fa-youtube"></i></a>
                    <?php endif; ?>
                </div>

                <?php
endif; 
}

/**
 * [header_top_social_2 description]
 * @return [type] [description]
 */
function header_top_social_2() {
    $header_topSocial_switch = get_theme_mod( 'header_topSocial_switch', false );
    $header_top_facebook = get_theme_mod( 'header_top_facebook', __( '#', 'printx' ) );
    $header_top_twitter = get_theme_mod( 'header_top_twitter', __( '#', 'printx' ) );
    $header_top_linkedin = get_theme_mod( 'header_top_linkedin', __( '#', 'printx' ) );
    $header_top_instagram = get_theme_mod( 'header_top_instagram', __( '#', 'printx' ) );
    $header_top_youtube = get_theme_mod( 'header_top_youtube', __( '#', 'printx' ) );
    
    if(!empty($header_topSocial_switch)) : 
        ?>
                <div class="tp-header-top-5__social-box d-none d-sm-block text-end">
                    <?php if(!empty($header_top_facebook)) : ?>
                    <a href="<?php echo esc_url($header_top_facebook); ?>"><i class="fab fa-facebook-f"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_twitter)) : ?>
                    <a href="<?php echo esc_url($header_top_twitter); ?>"><i class="fab fa-twitter"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_linkedin)) : ?>
                    <a href="<?php echo esc_url($header_top_linkedin); ?>"><i class="fab fa-linkedin"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_instagram)) : ?>
                    <a href="<?php echo esc_url($header_top_instagram); ?>"><i class="fab fa-instagram"></i></a>
                    <?php endif; ?>
                    <?php if(!empty($header_top_youtube)) : ?>
                    <a href="<?php echo esc_url($header_top_youtube); ?>"><i class="fab fa-youtube"></i></a>
                    <?php endif; ?>
                </div>

                <?php
endif; 
}

/**
 * [header_side_social description]
 * @return [type] [description]
 */
function header_side_social() {
    $header_sideSocial_switch = get_theme_mod( 'header_sideSocial_switch', false );
    $header_side_facebook = get_theme_mod( 'header_side_facebook', __( '#', 'printx' ) );
    $header_side_twitter = get_theme_mod( 'header_side_twitter', __( '#', 'printx' ) );
    $header_side_linkedin = get_theme_mod( 'header_side_linkedin', __( '#', 'printx' ) );
    $header_side_instagram = get_theme_mod( 'header_side_instagram', __( '#', 'printx' ) );
    $header_side_youtube = get_theme_mod( 'header_side_youtube', __( '#', 'printx' ) );
    
    if(!empty($header_sideSocial_switch)) : 
        ?>
                <div class="tpoffcanvas__social">
                    <div class="social-icon">
                        <?php if(!empty($header_side_facebook)) : ?>
                        <a href="<?php echo esc_url($header_side_facebook); ?>"><i class="fab fa-facebook-f"></i></a>
                        <?php endif; ?>
                        <?php if(!empty($header_side_twitter)) : ?>
                        <a href="<?php echo esc_url($header_side_twitter); ?>"><i class="fab fa-twitter"></i></a>
                        <?php endif; ?>
                        <?php if(!empty($header_side_linkedin)) : ?>
                        <a href="<?php echo esc_url($header_side_linkedin); ?>"><i class="fab fa-linkedin"></i></a>
                        <?php endif; ?>
                        <?php if(!empty($header_side_instagram)) : ?>
                        <a href="<?php echo esc_url($header_side_instagram); ?>"><i class="fab fa-instagram"></i></a>
                        <?php endif; ?>
                        <?php if(!empty($header_side_youtube)) : ?>
                        <a href="<?php echo esc_url($header_side_youtube); ?>"><i class="fab fa-youtube"></i></a>
                        <?php endif; ?>
                    </div>
                </div>

                <?php
endif; 
}

// side_contact_info
function side_contact_info(){
    $header_sideCon_switch = get_theme_mod( 'header_sideCon_switch', false );
    $header_sidCon_title = get_theme_mod( 'header_sidCon_title', __( 'Contact', 'printx' ) );
    $header_side_location = get_theme_mod( 'header_side_location', __( 'Melbone st, Australia.', 'printx' ) );
    $header_side_loc_url = get_theme_mod( 'header_side_loc_url', '#' );
    $header_side_email = get_theme_mod( 'header_side_email', __( 'printx@gmail.com', 'printx' ) );
    $header_side_mail_url = get_theme_mod( 'header_side_mail_url', '#' );
    $header_side_phone = get_theme_mod( 'header_side_phone', __( '48 555 223 224', 'printx' ) );
    $header_side_phone_url = get_theme_mod( 'header_side_phone_url', '#' );

    if(!empty($header_sideCon_switch)) : 
    ?>

                <div class="tpoffcanvas__contact-info">
                    <?php if(!empty($header_sidCon_title)) : ?>
                    <div class="tpoffcanvas__contact-title">
                        <h5><?php echo printx_kses($header_sidCon_title); ?></h5>
                    </div>
                    <?php endif; ?>
                    <ul>

                        <?php if(!empty($header_side_location)) : ?>
                        <li>
                            <i class="fa-light fa-location-dot"></i>
                            <?php if(!empty($header_side_loc_url)) : ?>
                            <a href="<?php echo esc_url($header_side_loc_url); ?>"
                                target="_blank"><?php echo printx_kses($header_side_location); ?></a>
                            <?php else : ?>
                            <p class="text-white"><?php echo printx_kses($header_side_location); ?></p>
                            <?php endif; ?>
                        </li>
                        <?php endif; ?>

                        <?php if(!empty($header_side_email)) : ?>
                        <li>
                            <i class="fas fa-envelope"></i>
                            <?php if(!empty($header_side_mail_url)) : ?>
                            <a href="<?php echo esc_url($header_side_mail_url); ?>"
                                target="_blank"><?php echo printx_kses($header_side_email); ?></a>
                            <?php else : ?>
                            <p class="text-white"><?php echo printx_kses($header_side_email); ?></p>
                            <?php endif; ?>
                        </li>
                        <?php endif; ?>

                        <?php if(!empty($header_side_phone)) : ?>
                        <li>
                            <i class="fal fa-phone-alt"></i>
                            <?php if(!empty($header_side_phone_url)) : ?>
                            <a href="<?php echo esc_url($header_side_phone_url); ?>"
                                target="_blank"><?php echo printx_kses($header_side_phone); ?></a>
                            <?php else : ?>
                            <p class="text-white"><?php echo printx_kses($header_side_phone); ?></p>
                            <?php endif; ?>
                        </li>
                        <?php endif; ?>
                    </ul>
                </div>

                <?php
    endif; 
}

/**
 * [printx_header_menu description]
 * @return [type] [description]
 */
function printx_header_menu() {
    ?>
                <?php
        wp_nav_menu( [
            'theme_location' => 'main-menu',
            'menu_class'     => '',
            'container'      => '',
            'fallback_cb'    => 'printx_Navwalker_Class::fallback',
            'walker'         => new \TPCore\Widgets\printx_Navwalker_Class,
        ] );
    ?>
                <?php
}


/**
 * [printx_category_menu description]
 * @return [type] [description]
 */
function printx_category_menu() {
    wp_nav_menu( [
        'theme_location' => 'category-menu',
        'menu_class'     => 'm-0',
        'container'      => '',
        'fallback_cb'    => 'Printx_Navwalker_Class_2::fallback',
        'walker'         =>  new \TPCore\Widgets\Printx_Navwalker_Class_2,
    ] );
}


 /*
 * printx footer
 */
add_action( 'printx_footer_style', 'printx_check_footer', 10 );


function get_footer_style($style){
    if( $style == 'footer_2'  ) {
        get_template_part( 'template-parts/footer/footer-2' );
    }elseif ( $style == 'footer_3'  ) {
        get_template_part( 'template-parts/footer/footer-3' );
    }elseif ( $style == 'footer_4' ) {
        get_template_part( 'template-parts/footer/footer-4' );
    }elseif ( $style == 'footer_5' ) {
        get_template_part( 'template-parts/footer/footer-5' );
    }else{
        get_template_part( 'template-parts/footer/footer-1');
    }
}

function printx_check_footer() {
    $tp_footer_tabs = function_exists('tpmeta_field')? tpmeta_field('printx_footer_tabs') : '';
    $printx_footer_style = function_exists( 'tpmeta_field' ) ? tpmeta_field( 'printx_footer_style' ) : NULL;
    $footer_template = function_exists('tpmeta_field')? tpmeta_field('printx_footer_template') : false;

    $printx_footer_option_switch = get_theme_mod( 'printx_footer_elementor_switch', false );
    $elementor_footer_template = get_theme_mod( 'printx_footer_templates');
    $printx_default_footer_style = get_theme_mod( 'footer_layout', 'footer_1' );

    if($tp_footer_tabs == 'default'){
        if($printx_footer_option_switch){
            if($elementor_footer_template){
                echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_footer_template);
            }
        }else{ 
            if($printx_default_footer_style){
                get_footer_style($printx_default_footer_style);
            }else{
                get_template_part( 'template-parts/footer/footer-1' );
            }
        }
    }elseif($tp_footer_tabs == 'custom'){
        if ($printx_footer_style) {
            get_footer_style($printx_footer_style);
        }else{
            get_footer_style($printx_default_footer_style);
        }  
    }elseif($tp_footer_tabs == 'elementor'){
        if($footer_template){
            echo \Elementor\Plugin::$instance->frontend->get_builder_content($footer_template);
        }else{
            echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_footer_template);
        }

    }else{
        if($printx_footer_option_switch){

            if($elementor_footer_template){
                echo \Elementor\Plugin::$instance->frontend->get_builder_content($elementor_footer_template);
            }else{
                get_template_part( 'template-parts/footer/footer-1' );
            }
        }else{
            get_footer_style($printx_default_footer_style);

        }
    }
}

// printx_copyright_text
function printx_copyright_text() {
   print get_theme_mod( 'footer_copyright', esc_html__( '© 2023 printx, All Rights Reserved. Design By Theme Pure', 'printx' ) );
}


/**
 *
 * pagination
 */
if ( !function_exists( 'printx_pagination' ) ) {

    function _printx_pagi_callback( $pagination ) {
        return $pagination;
    }

    //page navegation
    function printx_pagination( $prev, $next, $pages, $args ) {
        global $wp_query, $wp_rewrite;
        $menu = '';
        $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;

        if ( $pages == '' ) {
            global $wp_query;
            $pages = $wp_query->max_num_pages;

            if ( !$pages ) {
                $pages = 1;
            }

        }

        $pagination = [
            'base'      => add_query_arg( 'paged', '%#%' ),
            'format'    => '',
            'total'     => $pages,
            'current'   => $current,
            'prev_text' => $prev,
            'next_text' => $next,
            'type'      => 'array',
        ];

        //rewrite permalinks
        if ( $wp_rewrite->using_permalinks() ) {
            $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );
        }

        if ( !empty( $wp_query->query_vars['s'] ) ) {
            $pagination['add_args'] = ['s' => get_query_var( 's' )];
        }

        $pagi = '';
        if ( paginate_links( $pagination ) != '' ) {
            $paginations = paginate_links( $pagination );
            $pagi .= '<ul>';
            foreach ( $paginations as $key => $pg ) {
                $pagi .= '<li>' . $pg . '</li>';
            }
            $pagi .= '</ul>';
        }

        print _printx_pagi_callback( $pagi );
    }
}

// theme color
function printx_custom_color() {
    // color 1
    $color_1_1 = get_theme_mod( 'color_1_1', '#FF4E8D' );
    $color_1_2 = get_theme_mod( 'color_1_2', '#AE34E8' );
    $color_1_3 = get_theme_mod( 'color_1_3', '#3E8DFF' );
    
    // color 2
    $color_2 = get_theme_mod( 'color_2', '#6B14FA' );

    // color 3
    $color_3 = get_theme_mod( 'color_3', '#951DF6' );

    // color 4
    $color_4 = get_theme_mod( 'color_4', '#72747C' );

    wp_enqueue_style( 'printx-custom', PRINTX_THEME_CSS_DIR . 'printx-custom.css', [] );
    
        if (!empty($color_1_1) || !empty($color_1_2) || !empty($color_1_3) || !empty($color_2) || !empty($color_3) || !empty($color_4)) {
        $custom_css = '';
        $custom_css .= "html:root {
            --tp-theme-1: linear-gradient(90.07deg, $color_1_1 32.43%, $color_1_2 58.79%, $color_1_3 105.32%);
            --tp-theme-2: $color_2;
            --tp-theme-3: $color_3;
            --tp-text-body: $color_4;
        }";

        wp_add_inline_style( 'printx-custom', $custom_css );
    }
}
add_action( 'wp_enqueue_scripts', 'printx_custom_color' );

// printx_kses_intermediate
function printx_kses_intermediate( $string = '' ) {
    return wp_kses( $string, printx_get_allowed_html_tags( 'intermediate' ) );
}

function printx_get_allowed_html_tags( $level = 'basic' ) {
    $allowed_html = [
        'b'      => [],
        'i'      => [],
        'u'      => [],
        'em'     => [],
        'br'     => [],
        'abbr'   => [
            'title' => [],
        ],
        'span'   => [
            'class' => [],
        ],
        'strong' => [],
        'a'      => [
            'href'  => [],
            'title' => [],
            'class' => [],
            'id'    => [],
        ],
    ];

    if ($level === 'intermediate') {
        $allowed_html['a'] = [
            'href' => [],
            'title' => [],
            'class' => [],
            'id' => [],
        ];
        $allowed_html['div'] = [
            'class' => [],
            'id' => [],
        ];
        $allowed_html['img'] = [
            'src' => [],
            'class' => [],
            'alt' => [],
        ];
        $allowed_html['del'] = [
            'class' => [],
        ];
        $allowed_html['ins'] = [
            'class' => [],
        ];
        $allowed_html['bdi'] = [
            'class' => [],
        ];
        $allowed_html['i'] = [
            'class' => [],
            'data-rating-value' => [],
        ];
    }

    return $allowed_html;
}



// WP kses allowed tags
// ----------------------------------------------------------------------------------------
function printx_kses($raw){

   $allowed_tags = array(
      'a'                         => array(
         'class'   => array(),
         'href'    => array(),
         'rel'  => array(),
         'title'   => array(),
         'target' => array(),
      ),
      'abbr'                      => array(
         'title' => array(),
      ),
      'b'                         => array(),
      'blockquote'                => array(
         'cite' => array(),
      ),
      'cite'                      => array(
         'title' => array(),
      ),
      'code'                      => array(),
      'del'                    => array(
         'datetime'   => array(),
         'title'      => array(),
      ),
      'dd'                     => array(),
      'div'                    => array(
         'class'   => array(),
         'title'   => array(),
         'style'   => array(),
      ),
      'dl'                     => array(),
      'dt'                     => array(),
      'em'                     => array(),
      'h1'                     => array(),
      'h2'                     => array(),
      'h3'                     => array(),
      'h4'                     => array(),
      'h5'                     => array(),
      'h6'                     => array(),
      'i'                         => array(
         'class' => array(),
      ),
      'img'                    => array(
         'alt'  => array(),
         'class'   => array(),
         'height' => array(),
         'src'  => array(),
         'width'   => array(),
      ),
      'li'                     => array(
         'class' => array(),
      ),
      'ol'                     => array(
         'class' => array(),
      ),
      'p'                         => array(
         'class' => array(),
      ),
      'q'                         => array(
         'cite'    => array(),
         'title'   => array(),
      ),
      'span'                      => array(
         'class'   => array(),
         'title'   => array(),
         'style'   => array(),
      ),
      'iframe'                 => array(
         'width'         => array(),
         'height'     => array(),
         'scrolling'     => array(),
         'frameborder'   => array(),
         'allow'         => array(),
         'src'        => array(),
      ),
      'strike'                 => array(),
      'br'                     => array(),
      'strong'                 => array(),
      'data-wow-duration'            => array(),
      'data-wow-delay'            => array(),
      'data-wallpaper-options'       => array(),
      'data-stellar-background-ratio'   => array(),
      'ul'                     => array(
         'class' => array(),
      ),
      'svg' => array(
           'class' => true,
           'aria-hidden' => true,
           'aria-labelledby' => true,
           'role' => true,
           'xmlns' => true,
           'width' => true,
           'height' => true,
           'viewbox' => true, // <= Must be lower case!
       ),
       'g'     => array( 'fill' => true ),
       'title' => array( 'title' => true ),
       'path'  => array( 'd' => true, 'fill' => true,  ),
      );

   if (function_exists('wp_kses')) { // WP is here
      $allowed = wp_kses($raw, $allowed_tags);
   } else {
      $allowed = $raw;
   }

   return $allowed;
} 

// This code filters the Archive widget to include the post count inside the link /
add_filter( 'get_archives_link', 'printx_archive_count_span' );
function printx_archive_count_span( $links ) {
    $links = str_replace('</a>&nbsp;(', '<span >(', $links);
    $links = str_replace(')', ')</span></a> ', $links);
    return $links;
}


// This code filters the Category widget to include the post count inside the link /
add_filter('wp_list_categories', 'printx_cat_count_span');
function printx_cat_count_span($links) {
  $links = str_replace('</a> (', '<span>', $links);
  $links = str_replace(')', '</span></a>', $links);
  return $links;
}

// related portfolios post
class RelatedPosts {
    private $current_post_id;
    private $post_type;
    private $cat_texonomy;

    public function __construct($current_post_id, $post_type, $cat_texonomy) {
        $this->current_post_id = $current_post_id;
        $this->post_type = $post_type;
        $this->cat_texonomy = $cat_texonomy;
    }

    public function get_related_posts() {
        $args = array(
            'post_type' => $this->post_type,
            'posts_per_page' => 3,
            'post__not_in' => array($this->current_post_id),
            'tax_query' => array(
                'relation' => 'AND',
                array(
                    'taxonomy' => $this->cat_texonomy,
                    'field' => 'term_id',
                    'terms' => wp_get_post_terms($this->current_post_id, $this->cat_texonomy, array("fields" => "ids")),
                ),
                array(
                    'taxonomy' => 'post_format',
                    'field' => 'slug',
                    'terms' => array('post-format-quote'), // Exclude the 'quote' post format
                    'operator' => 'NOT IN',
                ),
            ),
        );

        $related_posts_query = new WP_Query($args);
        return $related_posts_query->get_posts();
    }
} 

// printx_product_search
function printx_product_search() {
    ?>
                <form method="get" action="<?php print esc_url( home_url( '/shop' ) );?>">
                    <input type="text" name="s" value="<?php print esc_attr( get_search_query() )?>"
                        placeholder="<?php print esc_attr__( 'Search for products........', 'printx' );?>">
                </form>
                <?php
}

// printx_product_search_2
function printx_product_search_2() {
    ?>
                <form method="get" action="<?php print esc_url( home_url( '/shop' ) );?>">
                    <input type="text" name="s" value="<?php print esc_attr( get_search_query() )?>"
                        placeholder="<?php print esc_attr__( 'Search', 'printx' );?>">
                    <button type="submit" class="tp-header-middle-5__search-box">
                        <span>
                            <svg width="15" height="15" viewBox="0 0 15 15" fill="none"
                                xmlns="http://www.w3.org/2000/svg">
                                <path
                                    d="M14.7719 13.6626L11.0742 9.94962C12.0249 8.85844 12.5459 7.48552 12.5459 6.05624C12.5459 2.71688 9.73177 0 6.27293 0C2.81409 0 0 2.71688 0 6.05624C0 9.3956 2.81409 12.1125 6.27293 12.1125C7.57143 12.1125 8.80883 11.7344 9.86677 11.0166L13.5926 14.7578C13.7484 14.9139 13.9578 15 14.1823 15C14.3947 15 14.5963 14.9218 14.7493 14.7796C15.0744 14.4776 15.0848 13.9768 14.7719 13.6626ZM6.27293 1.57989C8.82956 1.57989 10.9094 3.58793 10.9094 6.05624C10.9094 8.52456 8.82956 10.5326 6.27293 10.5326C3.7163 10.5326 1.63642 8.52456 1.63642 6.05624C1.63642 3.58793 3.7163 1.57989 6.27293 1.57989Z"
                                    fill="#6D7079" />
                            </svg>
                        </span>
                    </button>
                </form>
                <?php
}

Youez - 2016 - github.com/yon3zu
LinuXploit