Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.119.116.77
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/cynthiaadediran.com/wp-content/themes/gerold/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/cynthiaadediran.com/wp-content/themes/gerold/inc/template-helpers.php
<?php

/**
 * Functions which enhance the theme by Custom Functions
 *
 * @package Gerold_Theme
 * @since Gerold 1.0.0
 * @author ThemeJunction 
 */

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Before Content
 * ---------------------------------------------------------------------------------------
 */
// Preloader
add_action('gerold_before_main_content', 'gerold_preloader');
function gerold_preloader() {
  $geroldPreloader = get_theme_mod('show_preloader', false);

  $loaderText = get_theme_mod('loader_text', esc_html__("Loading", 'gerold'));

  $loaderCharacters = str_split(strtoupper($loaderText));


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

    <div class="preloader">
      <svg viewBox="0 0 1000 1000" preserveAspectRatio="none">
        <path id="preloaderSvg" d="M0,1005S175,995,500,995s500,5,500,5V0H0Z"></path>
      </svg>

      <div class="preloader-heading">

        <?php if (!empty($loaderText)) : ?>
          <div class="load-text">
            <?php foreach ($loaderCharacters as $character) : ?>
              <span><?php echo esc_html($character); ?></span>
            <?php endforeach; ?>
          </div>
        <?php endif; ?>

      </div>
    </div>
  <?php
  endif;
}

// Back to Top
add_action('gerold_before_main_content', 'gerold_back_to_top');
function gerold_back_to_top() {

  $geroldBackToTop = get_theme_mod('gerold_backtotop', false);

  if (!empty($geroldBackToTop)) :
  ?>
    <!-- start: Scroll Area -->
    <div class="gerold-scroll-top">
      <svg class="progress-circle svg-content" width="100%" height="100%" viewBox="-1 -1 102 102">
        <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98" style="
                        transition: stroke-dashoffset 10ms linear 0s;
                        stroke-dasharray: 307.919px, 307.919px;
                        stroke-dashoffset: 71.1186px;
                    "></path>
      </svg>
      <div class="gerold-scroll-top-icon">
        <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 24 24" data-icon="mdi:arrow-up" class="iconify iconify--mdi">
          <path fill="currentColor" d="M13 20h-2V8l-5.5 5.5l-1.42-1.42L12 4.16l7.92 7.92l-1.42 1.42L13 8v12Z">
          </path>
        </svg>
      </div>
    </div>
    <!-- end: Scroll Area -->
    <?php
  endif;
}


/**
 * ---------------------------------------------------------------------------------------
 * Gerold Search Filter
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_search_filter_form')) {
  function gerold_search_filter_form($form) {

    $form = sprintf(
      '<div class="widget_search"><div class="tj-widget__search form_group"><form class="search-form" action="%s" method="get">
       <input type="search" value="%s" required name="s" placeholder="%s">
       <button class="search-btn" type="submit"> <i class="fa-light fa-magnifying-glass"></i> </button>
    </form></div></div>',
      esc_url(home_url('/')),
      esc_attr(get_search_query()),
      esc_html__('Search...', 'gerold')
    );

    return $form;
  }
  add_filter('get_search_form', 'gerold_search_filter_form');
}


/**
 * ---------------------------------------------------------------------------------------
 * Gerold Breadcrumb
 * ---------------------------------------------------------------------------------------
 */
add_action('gerold_breadcrumb', 'gerold_breadcrumb_func');
function gerold_breadcrumb_func() {
  global $post;

  // id
  $_id = get_the_ID();

  $breadcrumb_class = '';
  $breadcrumb_show = 1;

  $show_breadcrumb = get_theme_mod('show_breadcrumb', true);
  $gerold_error_title = get_theme_mod('gerold_error_title', __('404', 'gerold'));

  // page breadcrumb title
  $page_breadcrumb_title = function_exists('get_field') ? get_field('page_breadcrumb_title', $_id) : '';

  if (!empty($show_breadcrumb)) :
    // title
    if (is_front_page() && is_home()) {
      $title = get_theme_mod('blog_breadcrumb_title', __('Blog', 'gerold'));
      $breadcrumb_class = 'home_front_page';
    } elseif (is_front_page()) {
      $title = get_theme_mod('blog_breadcrumb_title', __('Blog', 'gerold'));
      $breadcrumb_show = 0;
    } elseif (is_home()) {
      $title = get_theme_mod('blog_breadcrumb_title', __('Blog', 'gerold'));
      $breadcrumb_class = 'home_blog_page';
    } elseif (is_single() && 'post' == get_post_type()) {
      if (!empty(get_theme_mod('blog_details_breadcrumb_title'))) {
        $title = get_theme_mod('blog_details_breadcrumb_title', __('Blog Details', 'gerold'));
      } else {
        $title =  get_the_title();
      }
    } elseif (is_single() && 'product' == get_post_type()) {
      $title = get_theme_mod('breadcrumb_product_details', __('Shop', 'gerold'));
    } elseif (is_search()) {
      $title = esc_html__('Search Results for : ', 'gerold') . get_search_query();
    } elseif (is_404()) {
      $title = $gerold_error_title ? $gerold_error_title : esc_html__('404', 'gerold');
      $breadcrumb_show =  0;
    } elseif (function_exists('is_woocommerce') && is_woocommerce()) {
      $title = get_theme_mod('breadcrumb_shop', __('Shop', 'gerold'));
    } elseif (is_archive() && 'services' == get_post_type()) {
      if (!empty(get_theme_mod('breadcrumb_services_title'))) {
        $title = get_theme_mod('breadcrumb_services_title', __('Services', 'gerold'));
      } else {
        $title =  get_the_archive_title();
      }
    } elseif (is_archive() && 'portfolios' == get_post_type()) {
      if (!empty(get_theme_mod('breadcrumb_portfolios_title'))) {
        $title = get_theme_mod('breadcrumb_portfolios_title', __('Portfolios', 'gerold'));
      } else {
        $title =  get_the_archive_title();
      }
    } elseif (is_archive()) {
      $title = get_the_archive_title();
    } else {
      $title = !empty($page_breadcrumb_title) ? $page_breadcrumb_title : get_the_title();
    }


    if (is_single() && 'product' == get_post_type()) {
      $_id = $post->ID;
    } elseif (function_exists("is_shop") and is_shop()) {
      $_id = wc_get_page_id('shop');
    } elseif (is_home() && get_option('page_for_posts')) {
      $_id = get_option('page_for_posts');
    }

    // hide page breadcrumb
    if (is_singular() || is_page()) {
      $is_breadcrumb = function_exists('get_field') ? get_field('hide_page_breadcrumb', $_id) : false;
    } else {
      $is_breadcrumb = false;
    }

    if ((false == $is_breadcrumb) && $breadcrumb_show == 1) {
      // IMAGES
      $breadcrumb_page_bg_image = function_exists('get_field') ? get_field('breadcrumb_page_bg_image', $_id) : '';

      // customizer
      $customizer_bg_img = get_theme_mod('breadcrumb_bg_img');
      $bg_color = get_theme_mod('breadcrumb_bg_color', '#2b2c30');

      $blog_breadcrumb_img = get_theme_mod('blog_breadcrumb_img');
      $blog_details_breadcrumb_img = get_theme_mod('blog_details_breadcrumb_img');

      $breadcrumb_service_img = get_theme_mod('breadcrumb_services_img');
      $breadcrumb_portfolios_img = get_theme_mod('breadcrumb_portfolios_img');
      $error_breadcrumb_img = get_theme_mod('gerold_error_breadcrumb_img');

      // image
      if (is_front_page() && is_home()) {
        $bg_img = $blog_breadcrumb_img ? $blog_breadcrumb_img : $customizer_bg_img;
      } elseif (is_front_page()) {
        $bg_img = $blog_breadcrumb_img ? $blog_breadcrumb_img : $customizer_bg_img;
      } elseif (is_home()) {
        $bg_img = $blog_breadcrumb_img ? $blog_breadcrumb_img : $customizer_bg_img;
      } elseif (is_single() && 'post' == get_post_type()) {
        $bg_img = $blog_details_breadcrumb_img ? $blog_details_breadcrumb_img : (has_post_thumbnail() ? get_the_post_thumbnail_url() : $customizer_bg_img);
      } elseif (is_404()) {
        $bg_img = $error_breadcrumb_img ? $error_breadcrumb_img : $customizer_bg_img;
      } elseif (is_archive() && 'services' == get_post_type()) {
        $bg_img = $breadcrumb_service_img ? $breadcrumb_service_img : $customizer_bg_img;
      } elseif (is_single() && 'services' == get_post_type()) {
        $bg_img = $breadcrumb_service_img ? $breadcrumb_service_img : $customizer_bg_img;
      } elseif (is_archive() && 'portfolios' == get_post_type()) {
        $bg_img = $breadcrumb_portfolios_img ? $breadcrumb_portfolios_img : $customizer_bg_img;
      } elseif (is_single() && 'portfolios' == get_post_type()) {
        $bg_img = $breadcrumb_portfolios_img ? $breadcrumb_portfolios_img : $customizer_bg_img;
      } elseif (is_single()) {
        $bg_img = has_post_thumbnail() ? get_the_post_thumbnail_url() : $customizer_bg_img;
      } else {
        $bg_img = !empty($breadcrumb_page_bg_image['url']) ? $breadcrumb_page_bg_image['url'] : $customizer_bg_img;
      }

      // NAVIGATION
      $breadcrumb_navigation_switch = get_theme_mod('breadcrumb_navigation_switch', false);

      $is_navigation = $breadcrumb_navigation_switch;


      // breadcrumb bg color
      if (!empty($bg_color)) {
        $bgColor = 'data-bg-color="' . $bg_color . '"';
      } else {
        $bgColor = "";
      }

      // breadcrumb bg image
      if (!empty($bg_img)) {
        $bgImage = 'data-bg-image="' . $bg_img . '"';
      } else {
        $bgImage = "";
      }
    ?>
      <div class="breadcrumb_area <?php echo esc_attr($breadcrumb_class); ?>" <?php echo esc_attr($bgColor); ?> <?php echo esc_attr($bgImage);  ?>>
        <div class="container">
          <div class="row">
            <div class="col">
              <div class="breadcrumb_content">
                <h2 class="title wow fadeInUp" data-wow-delay=".3s"><?php echo gerold_kses($title); ?></h2>

                <?php if (!empty($is_navigation)) : ?>
                  <div class="breadcrumb_navigation wow fadeInUp" data-wow-delay=".5s">
                    <?php if (function_exists('bcn_display')) {
                      bcn_display();
                    } ?>
                  </div>
                <?php endif; ?>

              </div>
            </div>
          </div>
        </div>
      </div>
    <?php
    }
  endif;
}
add_filter('bcn_breadcrumb_title', 'gerold_breadcrumb_current_title_trim', 3, 10);
function gerold_breadcrumb_current_title_trim($title, $type, $id) {
  $parentTitle = get_theme_mod('breadcrumb_parent_title', esc_html__("Home", 'gerold'));

  if (in_array('home', $type)) {
    $title = esc_html($parentTitle);
  }
  if (in_array('post', $type)) {
    $title = wp_trim_words($title, 4, '...');
  }
  return $title;
}


/**
 * ---------------------------------------------------------------------------------------
 * Gerold Header Style
 * ---------------------------------------------------------------------------------------
 */
add_action('gerold_header_style', 'gerold_check_header', 10);
function gerold_check_header() {

  $gerold_select_headers = get_theme_mod('select_headers', 'default');
  $elementor_header_style    = get_theme_mod('elementor_header_style', 0);
  $default_header_style   = get_theme_mod('default_header_style', 'header-style-1');

  // header style from page settings
  $enable_header_settings = function_exists('get_field') ? get_field('enable_header_settings') : false;
  $select_page_headers = function_exists('get_field') ? get_field('select_page_headers') : 'default-headers';

  $page_default_header_style = function_exists('get_field') ? get_field('page_default_header_style') : NULL;
  $page_elementor_header_style = function_exists('get_field') ? get_field('page_elementor_header_style') : NULL;


  // from page headers
  if (!empty($enable_header_settings)) {
    if ('default-headers' == $select_page_headers) {
      // page header style
      if ($page_default_header_style == 'header-style-2') {
        get_template_part('template-parts/header/header-2');
      } elseif ($page_default_header_style == 'header-style-3') {
        get_template_part('template-parts/header/header-3');
      } else {
        get_template_part('template-parts/header/header-1');
      }
    } else {
      if (class_exists('\\Elementor\\Plugin')) {
        if ($page_elementor_header_style) {
          TJ_HF_Builder::render_template($page_elementor_header_style->ID);
        } else {
          printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('No Headers Found! — set custom header {Appearance -> TJ Header Builder}', 'gerold'));
        }
      } else {
        printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('Gerold requires Elementor to be installed and activated.', 'gerold'));
      }
    }
  } else {
    // from cutomizer headers
    if ('default' == $gerold_select_headers) {
      /** default header style **/
      if ($default_header_style == 'header-style-2') {
        get_template_part('template-parts/header/header-2');
      } elseif ($default_header_style == 'header-style-3') {
        get_template_part('template-parts/header/header-3');
      } else {
        get_template_part('template-parts/header/header-1');
      }
    } else {
      if (class_exists('\\Elementor\\Plugin')) {
        if ($elementor_header_style > 0) {
          TJ_HF_Builder::render_template($elementor_header_style);
        } else {
          printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('No Headers Found! — set custom header {Appearance -> TJ Header Builder}', 'gerold'));
        }
      } else {
        printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('Gerold requires Elementor to be installed and activated.', 'gerold'));
      }
    }
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Footer Style
 * ---------------------------------------------------------------------------------------
 */
add_action('gerold_footer_style', 'gerold_check_footer', 10);
function gerold_check_footer() {

  $gerold_select_footers = get_theme_mod('select_footers', 'default');
  $elementor_footer_style    = get_theme_mod('elementor_footer_style', 0);
  $default_footer_style   = get_theme_mod('default_footer_style', 'footer-style-1');

  // footer style from page settings
  $enable_footer_settings = function_exists('get_field') ? get_field('enable_footer_settings') : false;
  $select_page_footers = function_exists('get_field') ? get_field('select_page_footers') : 'default-footers';

  $page_default_footer_style = function_exists('get_field') ? get_field('page_default_footer_style') : NULL;
  $page_elementor_footer_style = function_exists('get_field') ? get_field('page_elementor_footer_style') : NULL;


  // from Page Footers
  if (!empty($enable_footer_settings)) {
    if ('default-footers' == $select_page_footers) {
      // page footer style
      if ($page_default_footer_style == 'footer-style-3') {
        get_template_part('template-parts/footer/footer-3');
      } elseif ($page_default_footer_style == 'footer-style-2') {
        get_template_part('template-parts/footer/footer-2');
      } else {
        get_template_part('template-parts/footer/footer-1');
      }
    } else {

      if (class_exists('\\Elementor\\Plugin')) {
        if ($page_elementor_footer_style) {
          TJ_HF_Builder::render_template($page_elementor_footer_style->ID);
        } else {
          printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('No Footers Found! — set custom header {Appearance -> TJ Footer Builder}', 'gerold'));
        }
      } else {
        printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('Gerold requires Elementor to be installed and activated.', 'gerold'));
      }
    }
  } else {
    // from cutomizer Footers
    if ('default' == $gerold_select_footers) {
      /** default footer style **/
      if ($default_footer_style == 'footer-style-2') {
        get_template_part('template-parts/footer/footer-2');
      } elseif ($default_footer_style == 'footer-style-3') {
        get_template_part('template-parts/footer/footer-3');
      } else {
        get_template_part('template-parts/footer/footer-1');
      }
    } else {

      if (class_exists('\\Elementor\\Plugin')) {
        if ($elementor_footer_style > 0) {
          TJ_HF_Builder::render_template($elementor_footer_style);
        } else {
          printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('No Footers Found! — set custom header {Appearance -> TJ Footer Builder}', 'gerold'));
        }
      } else {
        printf('<div class="alert alert-warning" role="alert">%s</div>', esc_html__('Gerold requires Elementor to be installed and activated.', 'gerold'));
      }
    }
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Header Logo
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_header_logo')) {
  function gerold_header_logo() { ?>
    <?php
    $gerold_page_sec_logo_on = function_exists('get_field') ? get_field('is_enable_sec_logo') : NULL;

    $primary_logo       = GEROLD_ASSETS_IMAGES_URL . '/logos/logo-primary.png';
    $secondary_logo = GEROLD_ASSETS_IMAGES_URL . '/logos/logo-secondary.png';

    $gerold_primary_logo      = get_theme_mod('primary_logo', $primary_logo);
    $gerold_secondary_logo = get_theme_mod('secondary_logo', $secondary_logo);
    ?>

    <?php if (!empty($gerold_page_sec_logo_on)) : ?>
      <a class="secondary-logo" href="<?php echo esc_url(home_url('/')); ?>">
        <img src="<?php echo esc_url($gerold_secondary_logo); ?>" alt="<?php echo esc_attr__('logo', 'gerold'); ?>" />
      </a>
    <?php else : ?>
      <a class="primary-logo" href="<?php echo esc_url(home_url('/')); ?>">
        <img src="<?php echo esc_url($gerold_primary_logo); ?>" alt="<?php echo esc_attr__('logo', 'gerold'); ?>" />
      </a>
    <?php endif; ?>
    <?php
  }
}


/**
 * ---------------------------------------------------------------------------------------
 * Gerold Footer Logo
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_footer_logo')) {
  function gerold_footer_logo() {
    $gerold_footer_logo = get_theme_mod('footer_logo', GEROLD_ASSETS_IMAGES_URL . '/logos/logo-primary.png');

    if (!empty($gerold_footer_logo)) : ?>
      <div class="footer-logo-box">
        <a href="<?php echo esc_url(home_url('/')); ?>">
          <img src="<?php echo esc_url($gerold_footer_logo); ?>" alt="<?php echo esc_attr__('logo', 'gerold'); ?>">
        </a>
      </div>
    <?php endif;
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Header Menu
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_header_menu')) {
  function gerold_header_menu() {

    if (has_nav_menu('main-menu')) {
      wp_nav_menu([
        'theme_location' => 'main-menu',
        'menu_class'     => '',
        'menu_id'        => '',
        'container'      => '',
        'fallback_cb'    => 'Gerold_Navwalker_Class::fallback',
        'walker'         => new Gerold_Navwalker_Class,
      ]);
    } else {
      wp_nav_menu([
        'menu_class'     => '',
        'container'      => '',
      ]);
    }
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Mobile Menu
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_mobile_menu')) {
  function gerold_mobile_menu() {

    $gerold_menu = wp_nav_menu([
      'theme_location' => 'main-menu',
      'menu_class'     => '',
      'container'      => '',
      'menu_id'        => 'mobile-menu-active',
      'echo'           => false,
    ]);

    $gerold_menu = str_replace("menu-item-has-children", "menu-item-has-children has-children", $gerold_menu);
    echo wp_kses_post($gerold_menu);
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Header Footer Menu
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_footer_menu')) {
  function gerold_footer_menu() {
    if (has_nav_menu('footer-menu')) {
      wp_nav_menu([
        'theme_location' => 'footer-menu',
        'menu_class'     => '',
        'container'      => '',
        'fallback_cb'    => 'Gerold_Navwalker_Class::fallback',
        'walker'         => new Gerold_Navwalker_Class,
      ]);
    } else {
      wp_nav_menu([
        'menu_class'     => '',
        'container'      => '',
      ]);
    }
  }
}


/**
 * ---------------------------------------------------------------------------------------
 * Gerold Copyright Text
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_copyright_text')) {
  function gerold_copyright_text() {
    $gerold_copyright = get_theme_mod('gerold_copyright', gerold_kses('&copy; 2024 All rights Reserved. Design By <a href="#" target="_blank">ThemeJunction</a>'));
    echo gerold_kses($gerold_copyright);
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Header Socials
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_header_socials')) {
  function gerold_header_socials() {
    $gerold_header_fb_link        = get_theme_mod('header_fb_link', __('https://facebook.com/', 'gerold'));
    $gerold_header_twitter_link   = get_theme_mod('header_twitter_link', __('https://twitter.com/', 'gerold'));
    $gerold_header_linkedin_link  = get_theme_mod('header_linkedin_link', __('https://linkedin.com/', 'gerold'));
    $gerold_header_instagram_link = get_theme_mod('header_instagram_link', __('https://instagram.com/', 'gerold'));
    $gerold_header_youtube_link   = get_theme_mod('header_youtube_link', __('https://youtube.com/', 'gerold'));
    ?>
    <ul>
      <?php if (!empty($gerold_header_fb_link)) : ?>
        <li><a href="<?php echo esc_url($gerold_header_fb_link); ?>"><span><i class="fab fa-facebook-f"></i></span></a></li>
      <?php endif; ?>

      <?php if (!empty($gerold_header_twitter_link)) : ?>
        <li><a href="<?php echo esc_url($gerold_header_twitter_link); ?>"><span><i class="fab fa-twitter"></i></span></a></li>
      <?php endif; ?>

      <?php if (!empty($gerold_header_instagram_link)) : ?>
        <li><a href="<?php echo esc_url($gerold_header_instagram_link); ?>"><span><i class="fab fa-instagram"></i></span></a></li>
      <?php endif; ?>

      <?php if (!empty($gerold_header_linkedin_link)) : ?>
        <li><a href="<?php echo esc_url($gerold_header_linkedin_link); ?>"><span><i class="fab fa-linkedin-in"></i></span></a></li>
      <?php endif; ?>

      <?php if (!empty($gerold_header_youtube_link)) : ?>
        <li><a href="<?php echo esc_url($gerold_header_youtube_link); ?>"><span><i class="fab fa-youtube"></i></span></a></li>
      <?php endif; ?>
    </ul>

  <?php
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Footer Socials
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_footer_socials')) {
  function gerold_footer_socials() {
    $gerold_footer_fb_link        = get_theme_mod('footer_fb_link', __('#', 'gerold'));
    $gerold_footer_twitter_link   = get_theme_mod('footer_twitter_link', __('#', 'gerold'));
    $gerold_footer_instagram_link = get_theme_mod('footer_instagram_link', __('#', 'gerold'));
    $gerold_footer_linkedin_link  = get_theme_mod('footer_linkedin_link', __('#', 'gerold'));
    $gerold_footer_youtube_link   = get_theme_mod('footer_youtube_link', __('#', 'gerold'));
  ?>
    <ul>
      <?php if (!empty($gerold_footer_fb_link)) : ?>
        <li>
          <a href="<?php echo esc_url($gerold_footer_fb_link); ?>">
            <i class="fab fa-facebook-f"></i>
          </a>
        </li>
      <?php endif; ?>

      <?php if (!empty($gerold_footer_twitter_link)) : ?>
        <li>
          <a href="<?php echo esc_url($gerold_footer_twitter_link); ?>">
            <i class="fab fa-twitter"></i>
          </a>
        </li>
      <?php endif; ?>

      <?php if (!empty($gerold_footer_instagram_link)) : ?>
        <li>
          <a href="<?php echo esc_url($gerold_footer_instagram_link); ?>">
            <i class="fab fa-instagram"></i>
          </a>
        </li>
      <?php endif; ?>

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

      <?php if (!empty($gerold_footer_youtube_link)) : ?>
        <li>
          <a href="<?php echo esc_url($gerold_footer_youtube_link); ?>">
            <i class="fab fa-youtube"></i>
          </a>
        </li>
      <?php endif; ?>
    </ul>
  <?php
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Pagination
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_pagination')) {

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

  //page navigation
  function gerold_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>';
    }

    echo _gerold_pagi_callback($pagi);
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * Gerold Comment
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_comment')) {
  function gerold_comment($comment, $args, $depth) {
    $GLOBAL['comment'] = $comment;
    extract($args, EXTR_SKIP);
    $args['reply_text'] = 'Reply';
    $replayClass        = 'comment-depth-' . esc_attr($depth);
  ?>
    <li class="tj__comment" id="comment-<?php comment_ID(); ?>">
      <div class="tj-comment__wrap">
        <?php if (get_avatar($comment)) : ?>
          <div class="comment__avatar">
            <?php echo get_avatar($comment, 102, null, null, ['class' => []]); ?>
          </div>
        <?php endif; ?>
        <div class="comment__text">
          <div class="avatar__name">
            <h5><?php echo get_comment_author_link(); ?></h5>
            <span><?php comment_time(get_option('date_format')); ?></span>
          </div>
          <?php comment_text(); ?>

          <div class="comment__reply">
            <?php comment_reply_link(array_merge($args, ['depth' => $depth, 'max_depth' => $args['max_depth']])); ?>
          </div>

        </div>
      </div>
  <?php
  }
}

/**
 * ---------------------------------------------------------------------------------------
 * WP kses allowed tags
 * ---------------------------------------------------------------------------------------
 */
if (!function_exists('gerold_kses')) {
  function gerold_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;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit