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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i5h-3LL

HOME


5h-3LL 1.0
DIR: /srv/http/adent.cz/papirnictvi-mb.cz/wp-content/themes/quad-wp
/srv/http/adent.cz/papirnictvi-mb.cz/wp-content/themes/quad-wp/
Upload File:
Current File : /srv/http/adent.cz/papirnictvi-mb.cz/wp-content/themes/quad-wp/functions.php
<?php

if (!defined('ABSPATH')) {
    exit();
}

function quad_is_edit_page($new_edit = null) {
    global $pagenow;
    //make sure we are on the backend
    if (!is_admin()) {
        return false;
    }

    if ($new_edit == "edit") {
        return in_array($pagenow, array('post.php',));
    } else if ($new_edit == "new") {//check for new post page
        return in_array($pagenow, array('post-new.php'));
    } else {//check for either new or edit
        return in_array($pagenow, array('post.php', 'post-new.php'));
    }
}

// CSS and JS files for the site
function quad_front_styles_scripts() {

    wp_enqueue_style('hoverIntent');

    wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/fonts/fontawesome/css/font-awesome.min.css');

    wp_enqueue_style('iconfontcustom', get_template_directory_uri() . '/assets/fonts/iconfontcustom/icon-font-custom.css');

    if (quad_options_var('quad-googlemaps-api') != '') {
        wp_enqueue_script('quad-gmap-sensor', '//maps.google.com/maps/api/js?sensor=false&key=' . esc_attr(quad_options_var('quad-googlemaps-api')), array('jquery'), false, true);
    } else {
        wp_enqueue_script('quad-gmap-sensor', '//maps.google.com/maps/api/js?sensor=false', array('jquery'), false, true);
    }

    wp_enqueue_script('quad-scripts-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), false, true);

    // custom scripts
    wp_register_script('quad-main-js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), false, true);

    if (quad_options_var('quad-header-stickyheader-toggle') == 1) {
        $quad_sticky = true;
    } else {
        $quad_sticky = false;
    }

    wp_localize_script('quad-main-js', 'quad_sticky', array('quad_sticky' => $quad_sticky));

    wp_enqueue_script('quad-main-js');

    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }

    wp_enqueue_style('quad-style-css', get_template_directory_uri() . '/style.css');

    if (quad_options_var('quad-font-switch') == 1 && quad_options_var('quad-custom-font') != '') {
        wp_enqueue_style('quad-user-font1', esc_url_raw(quad_options_var('quad-custom-font')), array(), null);
    } else {
        wp_enqueue_style('quad-fonts', quad_fonts_url(), array(), null);
    }

    if (quad_options_var('quad-font-switch') == 1 && quad_options_var('quad-custom-font2') != '') {
        wp_enqueue_style('quad-user-font2', esc_url_raw(quad_options_var('quad-custom-font2')), array(), null);
    } 
    
    if (class_exists('ReduxFramework')) {
        $custom_css = quad_theme_options_styles();
        if ($custom_css != '') {
            wp_add_inline_style('quad-style-css', $custom_css);
        }
    }
}

if (!is_admin()) {
    add_action('wp_enqueue_scripts', 'quad_front_styles_scripts');
}

function quad_custom_header_fonts() {
    wp_enqueue_style('quad-fonts', quad_fonts_url(), array(), null);
}

add_action('admin_print_styles-appearance_page_custom-header', 'quad_custom_header_fonts');

function quad_fonts_url() {
    $fonts_url = '';

    /* Translators: If there are characters in your language that are not
     * supported by the theme font, translate this to 'off'. Do not translate
     * into your own language.
     */

    $font1 = esc_html_x('on', 'Roboto font: on or off', 'quad-wp');

    if ('off' !== $font1) {
        $font_families = array();

        if ('off' !== $font1) {
            $font_families[] = 'Roboto:400,700,500,400italic,500italic';
        }

        $query_args = array(
            'family' => urlencode(implode('|', $font_families))
        );

        $fonts_url = add_query_arg($query_args, '//fonts.googleapis.com/css');
    }

    return esc_url_raw($fonts_url);
}

// ENQUEUE SCRIPTS AND STYLES
// CSS and JS for admin panels
function quad_admin_scripts_and_styles() {
    if (is_admin()) {
        wp_enqueue_media();
        global $typenow;
        global $pagenow;

        wp_enqueue_script('wp-link');

        $custom_posts = get_post_types(array(
            'public' => true,
            '_builtin' => false
        ));

        if ((quad_is_edit_page() && in_array($typenow, $custom_posts)) || quad_is_edit_page() || $pagenow == "nav-menus.php" || $pagenow == 'admin.php' || $pagenow == "widgets.php") {

            wp_enqueue_style('wp-color-picker');
            wp_enqueue_script('wp-color-picker');

            wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/fonts/fontawesome/css/font-awesome.min.css');

            wp_enqueue_style('iconfontcustom', get_template_directory_uri() . '/assets/fonts/iconfontcustom/icon-font-custom.css');

            wp_enqueue_script('quad-functions-js', get_template_directory_uri() . '/framework/admin/js/functions.js', array('jquery', 'media-upload'), false, true);
            wp_localize_script('quad-functions-js', 'quad_ajax', array('quad_widget_form_nonce' => wp_create_nonce('quad_widget_form_ajax'), 'ajaxurl' => admin_url('admin-ajax.php')));
        }
        wp_enqueue_style('quad-styles-css', get_template_directory_uri() . '/framework/admin/css/styles.css');
    }
}

add_action('admin_enqueue_scripts', 'quad_admin_scripts_and_styles');

// Set up the content width value based on the theme's design.
if (!isset($content_width)) {
    $content_width = 1170;
}

if (!function_exists('quad_theme_config')) {

    function quad_theme_config() {
        add_theme_support('post-thumbnails');
        set_post_thumbnail_size(1140, 0);
        // Crops the uploaded images to certain sizes used for different components and elements
        if (function_exists('add_image_size')) {
            add_image_size('quad_post3_size', 360, 250, true);
            add_image_size('quad_post2_size', 555, 385, true);
            add_image_size('quad_post1_size', 1140, 400, true);
            add_image_size('quad_search_size', 165, 150, true);
        }

        register_nav_menu('quad-main-nav-menu', esc_html__('Quad Menu', 'quad-wp'));

        // translation file
        // Localization Support
        load_theme_textdomain('quad-wp', get_template_directory() . '/languages');

        // Add RSS feed links to <head> for posts and comments.
        add_theme_support('automatic-feed-links');

        add_theme_support('title-tag');

        /*
         * Switch default core markup for search form, comment form, and comments
         * to output valid HTML5.
         */
        add_theme_support('html5', array(
            'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
        ));

        // Allows to link a custom stylesheet file to the TinyMCE visual editor
        add_editor_style(get_template_directory() . '/assets/css/lists.css');

        // Add support for featured content.
        add_theme_support('featured-content', array(
            'featured_content_filter' => 'quad_get_featured_content',
            'max_posts' => 6,
        ));

        add_theme_support('woocommerce');
    }

}

add_action('after_setup_theme', 'quad_theme_config');

function quad_custom_wp_title($title, $sep) {
    global $paged, $page;

    if (is_feed()) {
        return $title;
    } // end if
    // Add the site name.
    $title = get_bloginfo('name');
    $sep = '-';
    // Add the site description for the home/front page.
    $site_description = get_bloginfo('description', 'display');
    if ($site_description && ( is_home() || is_front_page() )) {
        $title = "$title $sep $site_description";
    } else if (is_search()) {
        $title = esc_html__('Search', 'quad-wp') . " $sep $title";
    } else if (is_tag()) {
        $title = esc_html__('Tag', 'quad-wp') . " $sep $title";
    } else if (is_category()) {
        $title = esc_html__('Category', 'quad-wp') . " $sep $title";
    } else if (is_tax()) {
        $title = esc_html__('Taxonomy', 'quad-wp') . " $sep $title";
    } else if (is_archive()) {
        $title = esc_html__('Archive', 'quad-wp') . " $sep $title";
    } else {
        $title = get_the_title() . " $sep $title";
    }
    // Add a page number if necessary.
    if ($paged >= 2 || $page >= 2) {
        $title = sprintf(esc_html__('Page %s', 'quad-wp'), max($paged, $page)) . " $sep $title";
    } // end if

    return esc_html($title);
}

add_filter('wp_title', 'quad_custom_wp_title', 10, 2);


/*
 * conditional statement will show the featured content if at least there is one present
 * and while the page is not being paged (it is not in the second page onwards).
 */

function quad_get_featured_content($num = 1) {
    global $featured;
    $featured = apply_filters('quad_featured_content', array());

    if (is_array($featured) || $num >= count($featured))
        return true;

    return false;
}

// A helper conditional function that returns a boolean value.
function quad_has_featured_posts() {
    return !is_paged() && (bool) quad_get_featured_content();
}

function quad_add_editor_styles() {
    add_editor_style('/assets/css/lists.css');
}

add_action('admin_init', 'quad_add_editor_styles');

// Add Formats Dropdown Menu To MCE
if (!function_exists('quad_style_select')) {

    function quad_style_select($buttons) {
        array_push($buttons, 'styleselect');
        return $buttons;
    }

}

add_filter('mce_buttons', 'quad_style_select');
// Add new styles to the TinyMCE "formats" menu dropdown
if (!function_exists('quad_styles_dropdown')) {

    function quad_styles_dropdown($settings) {

        // Create array of new styles
        $new_styles = array(
            array(
                'title' => esc_html__('List Styles', 'quad-wp'),
                'items' => array(
                    array(
                        'title' => esc_html__('Arrow', 'quad-wp'),
                        'selector' => 'ul',
                        'classes' => 'arrow-right'
                    ),
                    array(
                        'title' => esc_html__('Detail box', 'quad-wp'),
                        'selector' => 'ul',
                        'classes' => 'portfolio-item-details'
                    )
                )
            )
        );

        // Merge old & new styles
        $settings['style_formats_merge'] = true;

        // Add new styles
        $settings['style_formats'] = json_encode($new_styles);

        // Return New Settings
        return $settings;
    }

}
add_filter('tiny_mce_before_init', 'quad_styles_dropdown');

// Widget areas
function quad_widgets_init() {
    // creates the default sidebar
    register_sidebar(array(
        'name' => esc_html__('Default Sidebar', 'quad-wp'),
        'id' => 'quad-default-sidebar',
        'description' => esc_html__('Default widget area', 'quad-wp'),
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h6 class="widget-title">',
        'after_title' => '</h6>',
    ));

    // Generates the the middle widget areas of the footer
    for ($count = 1; $count <= 4; $count++) {
        register_sidebar(array(
            'name' => esc_html__('Footer Widget Area ', 'quad-wp') . $count,
            'id' => 'quad-footer-middle-sidebar-' . $count,
            'description' => esc_html__('Widget area', 'quad-wp'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h6 class="widget-title">',
            'after_title' => '</h6>',
        ));
    }

    for ($count = 1; $count <= 4; $count++) {
        register_sidebar(array(
            'name' => esc_html__('Footer Bottom Widget Area ', 'quad-wp') . $count,
            'id' => 'quad-footer-bottom-sidebar-' . $count,
            'description' => esc_html__('Widget area', 'quad-wp'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h6 class="widget-title">',
            'after_title' => '</h6>',
        ));
    }

    $option_name = 'quad-sidebars-custom';
    if (get_option($option_name) != false) {

        $sidebars_array = get_option($option_name);
        if ($sidebars_array != null) {
            $count = count($sidebars_array);
            $j = 0;

            for ($i = 0; $i < $count; $i = $i + 2) {

                // Stores sidebars titles
                $sidebars_title[$j] = esc_html($sidebars_array[$i]);
                // Stores sidebars description
                $sidebars_description[$j] = esc_html($sidebars_array[$i + 1]);

                if (function_exists('register_sidebar')) {
                    // Registers each sidebar with title and description
                    register_sidebar(array(
                        'name' => $sidebars_title[$j],
                        'id' => sanitize_title_with_dashes($sidebars_title[$j]) . '-' . $j,
                        'description' => $sidebars_description[$j],
                        'before_widget' => '<div id="%1$s" class="widget %2$s">',
                        'after_widget' => '</div>',
                        'class' => 'quad-sidebars-custom',
                        'before_title' => '<h6 class="widget-title">',
                        'after_title' => '</h6>',
                    ));
                }
                $j++;
            }
        }
    }
}

add_action('widgets_init', 'quad_widgets_init');

if (defined('WPB_VC_VERSION')) {
    include_once(get_template_directory() . '/framework/composer/init.php');
}

include_once(get_template_directory() . '/framework/admin/theme_options.php');
include_once(get_template_directory() . '/framework/plugins/tgm-plugin-activation/class-tgm-plugin-activation.php');
include_once(get_template_directory() . '/framework/metaboxes.php');
include_once(get_template_directory() . '/framework/sidebar_ajax.php');
include_once(get_template_directory() . '/framework/widgets.php');

class quad_Nav_Menu_Walker extends Walker_Nav_Menu {

    // Variables used to determine the first menu item
    public $quad_mega_menu = 0;
    public $quad_mega_section = 0;

    function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
        $this->child_count = ( isset($children_elements[$element->ID]) ) ? count($children_elements[$element->ID]) : 0;
        $this->ID = $element->ID;
        $this->depth = $depth;
        $this->have_current = true;
        $mega_count = 0;

        if ($this->child_count > 0) {

            foreach ($children_elements[$element->ID] as $child) {
                if (isset($child->classes)) {
                    foreach ($child->classes as $class) {
                        if ($class == 'quad-nav-mega-enabled') {
                            $mega_count++;
                        }
                    }
                }
            }
        }
        $element->classes[] = 'mega-section-count-' . $mega_count;
        parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
    }

    public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
        $indent = ( $depth ) ? str_repeat("\t", $depth) : '';

        $classes = empty($item->classes) ? array() : (array) $item->classes;
        $check = $check2 = 0;
        foreach ($classes as $class_single) {
            if (trim($class_single) == 'menu-item-has-children') {
                $check = 1;
            }
            if (trim($class_single) == 'quad-nav-mega-enabled') {
                $check2 = 1;
            }
        }
        $classes[] = 'menu-item-' . $item->ID;
        if ($check == 1 && $check2 == 0) {
            $classes[] = 'dropdown';
        }

        /**
         * Filter the CSS class(es) applied to a menu item's <li>.
         *
         * @since 3.0.0
         *
         * @see wp_nav_menu()
         *
         * @param array  $classes The CSS classes that are applied to the menu item's <li>.
         * @param object $item    The current menu item.
         * @param array  $args    An array of wp_nav_menu() arguments.
         */
        $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));

        $class_parts = explode(' ', $class_names);

        $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';

        $mega_count = 0;

        foreach ($class_parts as $class_part) {
            $mega_count_class = explode('mega-section-count-', $class_names);

            if (isset($mega_count_class[1])) {
                $mega_count = (int) $mega_count_class[1];
            }
        }

        /**
         * Filter the ID applied to a menu item's <li>.
         *
         * @since 3.0.1
         *
         * @see wp_nav_menu()
         *
         * @param string $menu_id The ID that is applied to the menu item's <li>.
         * @param object $item    The current menu item.
         * @param array  $args    An array of wp_nav_menu() arguments.
         */
        $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
        $id = $id ? ' id="' . esc_attr($id) . '"' : '';

        $quad_mega_menu_start = $quad_mega_section_start = '';
        global $quad_mega_section;
        global $quad_mega_menu;


        if ($depth == 0) {

            foreach ($classes as $class) {
                if (trim($class) == "quad-nav-mega-enabled") {
                    $mega_col = '';
                    if ($mega_count != 0) {
                        if ($mega_count >= 4) {
                            $mega_col = ' sf-mega-4-col';
                        } else {
                            $mega_col = ' sf-mega-' . $mega_count . '-col';
                        }
                    }

                    $quad_mega_menu_start = '<div class="sf-mega' . $mega_col . '">';
                    $quad_mega_menu = 1;
                }
            }
        }

        if ($depth == 1) {
            foreach ($classes as $class) {
                if (trim($class) == "quad-nav-mega-enabled" && $quad_mega_menu == 1) {
                    if ($quad_mega_section == 1) {
                        $output .= '</ul></div>';
                    }
                    $quad_mega_section_start = '<div class="sf-mega-section"><ul>';
                    $quad_mega_section = 1;
                }
            }
        }

        if ($quad_mega_section_start != '') {
            $output .= $quad_mega_section_start;
        }
        $output .= $indent . '<li' . $id . $class_names . '>';

        $atts = array();
        $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
        $atts['target'] = !empty($item->target) ? $item->target : '';
        $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
        $atts['href'] = !empty($item->url) ? $item->url : '';

        /**
         * Filter the HTML attributes applied to a menu item's <a>.
         *
         * @since 3.6.0
         *
         * @see wp_nav_menu()
         *
         * @param array $atts {
         *     The HTML attributes applied to the menu item's <a>, empty strings are ignored.
         *
         *     @type string $title  Title attribute.
         *     @type string $target Target attribute.
         *     @type string $rel    The rel attribute.
         *     @type string $href   The href attribute.
         * }
         * @param object $item The current menu item.
         * @param array  $args An array of wp_nav_menu() arguments.
         */
        $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);

        $attributes = '';
        foreach ($atts as $attr => $value) {
            if (!empty($value)) {
                $value = ( 'href' === $attr ) ? esc_url($value) : esc_attr($value);
                $attributes .= ' ' . $attr . '="' . $value . '"';
            }
        }

        $item_output = $args->before;
        $item_output .= '<a' . $attributes . '>';
        /** This filter is documented in wp-includes/post-template.php */
        if ($depth == 0) {
            $item_output .= $args->link_before . '<span>' . apply_filters('the_title', $item->title, $item->ID) . '</span>' . $args->link_after;
        } else {
            $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
        }
        $item_output .= '</a>';
        if ($quad_mega_menu_start != '') {
            $item_output .= $quad_mega_menu_start;
        }
        $item_output .= $args->after;

        /**
         * Filter a menu item's starting output.
         *
         * The menu item's starting output only includes $args->before, the opening <a>,
         * the menu item's title, the closing </a>, and $args->after. Currently, there is
         * no filter for modifying the opening and closing <li> for a menu item.
         *
         * @since 3.0.0
         *
         * @see wp_nav_menu()
         *
         * @param string $item_output The menu item's starting HTML output.
         * @param object $item        Menu item data object.
         * @param int    $depth       Depth of menu item. Used for padding.
         * @param array  $args        An array of wp_nav_menu() arguments.
         */
        $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
    }

    function end_lvl(&$output, $depth = 0, $args = array()) {
        $indent = str_repeat("\t", $depth);
        global $quad_mega_section;
        global $quad_mega_menu;
        if ($quad_mega_section == 1) {
            $output .= '</ul></div></div>';
            $quad_mega_section = 0;
            $output .= "$indent\n";
            $quad_mega_menu = 0;
        } else {
            $output .= "$indent</ul>\n";
        }
    }

    function start_lvl(&$output, $depth = 0, $args = array()) {
        $indent = str_repeat("\t", $depth);
        global $quad_mega_menu;
        if ($quad_mega_menu == 1) {
            $output .= "\n$indent\n";
        } else {
            $output .= "\n$indent<ul class=\"sub-menu\">\n";
        }
    }

}

function quad_pages_list() {
    $page_ids = get_all_page_ids();
    $pages_array = array();
    $pages_array['default'] = 'Default';
    foreach ($page_ids as $page_id) {
        // do not include the Auto Draft pages
        if (get_the_title($page_id) != 'Auto Draft') {
            $pages_array[$page_id] = esc_html(get_the_title($page_id));
        }
    }
    return $pages_array;
}

add_filter('body_class', 'quad_body_classes');

function quad_body_classes($classes) {

    $boxed = get_post_meta(quad_relevant_id(), 'quad_page_boxed', true);

    if (quad_options_var('quad-boxed-switch') == 1 || $boxed == 'boxed') {
        $classes[] = ' boxed';
    }

    return $classes;
}

function quad_options_var($type) {
    global $quad_theme_options;
    if (isset($quad_theme_options[$type])) {
        return $quad_theme_options[$type];
    } else {
        return '';
    }
}

function quad_relevant_id() {
    $post_id = '';

    $custom_posts = get_post_types(array(
        'public' => true,
        '_builtin' => false
    ));

    if ((is_archive() || is_tag() || is_category() || is_tax()) && in_array(get_post_type(), $custom_posts)) {
        $post_id = '-1';
    } else if (( is_page() || is_singular('post') || in_array(get_post_type(), $custom_posts) ) && !is_search()) {
        $post_id = get_queried_object_id();
    } else {
        $post_id = get_option('page_for_posts');
    }

    if (class_exists('woocommerce')) {

        if (is_singular('product')) {
            $post_id = get_the_id();
        } else if (is_woocommerce()) {
            $post_id = get_option('woocommerce_shop_page_id');
        }
    }

    return $post_id;
}

if (!function_exists('quad_breadcrumbs')) {

    function quad_breadcrumbs($args = array()) {
        if (is_front_page()) {
            return;
        }
        global $post;
        $defaults = array(
            'separator_icon' => '&gt;',
            'breadcrumbs_id' => 'quad-breadcrumb',
            'color' => '',
            'breadcrumbs_classes' => 'breadcrumb quad-breadcrumbs',
            'home_title' => esc_html__('Home', 'quad-wp')
        );
        $args = apply_filters('quad_breadcrumbs_args', wp_parse_args($args, $defaults));
        $separator = esc_attr($args['separator_icon']);
        /*         * *** Begin Markup **** */
        if ($args['color'] != '') {
            $style = ' style="color:' . esc_attr($args['color']) . ';"';
        } else {
            $style = '';
        }
        // Open the breadcrumbs
        $html = '<ol id="' . esc_attr($args['breadcrumbs_id']) . '" class="' . esc_attr($args['breadcrumbs_classes']) . '"' . $style . '>';
        // Add Homepage link & separator (always present)
        $html .= '<li class="item-home"><a class="bread-link bread-home" href="' . esc_url(get_home_url('/')) . '" title="' . esc_attr($args['home_title']) . '">' . esc_attr($args['home_title']) . '</a></li>';
        $html .= $separator;
        // Post
        if (is_singular('post')) {
            $category = get_the_category();
            $category_values = array_values($category);
            $last_category = end($category_values);
            $cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','), ',');
            $cat_parents = explode(',', $cat_parents);
            foreach ($cat_parents as $parent) {
                $html .= '<li class="item-cat">' . wp_kses($parent, wp_kses_allowed_html('a')) . '</li>';
                $html .= $separator;
            }
            $html .= '<li class="item-current item-' . $post->ID . '"><span class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</span></li>';
        } elseif (is_singular('page')) {
            if ($post->post_parent) {
                $parents = get_post_ancestors($post->ID);
                $parents = array_reverse($parents);
                foreach ($parents as $parent) {
                    $html .= '<li class="item-parent item-parent-' . esc_attr($parent) . '"><a class="bread-parent bread-parent-' . esc_attr($parent) . '" href="' . esc_url(get_permalink($parent)) . '" title="' . get_the_title($parent) . '">' . get_the_title($parent) . '</a></li>';
                    $html .= $separator;
                }
            }
            $html .= '<li class="item-current item-' . $post->ID . '"><span title="' . get_the_title() . '"> ' . get_the_title() . '</span></li>';
        } elseif (is_singular('attachment')) {
            $parent_id = $post->post_parent;
            $parent_title = get_the_title($parent_id);
            $parent_permalink = esc_url(get_permalink($parent_id));
            $html .= '<li class="item-parent"><a class="bread-parent" href="' . esc_url($parent_permalink) . '" title="' . esc_attr($parent_title) . '">' . esc_attr($parent_title) . '</a></li>';
            $html .= $separator;
            $html .= '<li class="item-current item-' . $post->ID . '"><span title="' . get_the_title() . '"> ' . get_the_title() . '</span></li>';
        } elseif (is_singular()) {
            $post_type = get_post_type();
            $post_type_object = get_post_type_object($post_type);
            $post_type_archive = get_post_type_archive_link($post_type);
            $html .= '<li class="item-cat item-custom-post-type-' . esc_attr($post_type) . '"><a class="bread-cat bread-custom-post-type-' . esc_attr($post_type) . '" href="' . esc_url($post_type_archive) . '" title="' . esc_attr($post_type_object->labels->name) . '">' . esc_attr($post_type_object->labels->name) . '</a></li>';
            $html .= $separator;
            $html .= '<li class="item-current item-' . $post->ID . '"><span class="bread-current bread-' . $post->ID . '" title="' . $post->post_title . '">' . $post->post_title . '</span></li>';
        } elseif (is_category()) {
            $parent = get_queried_object()->category_parent;
            if ($parent !== 0) {
                $parent_category = get_category($parent);
                $category_link = get_category_link($parent);
                $html .= '<li class="item-parent item-parent-' . esc_attr($parent_category->slug) . '"><a class="bread-parent bread-parent-' . esc_attr($parent_category->slug) . '" href="' . esc_url($category_link) . '" title="' . esc_attr($parent_category->name) . '">' . esc_attr($parent_category->name) . '</a></li>';
                $html .= $separator;
            }
            $html .= '<li class="item-current item-cat"><span class="bread-current bread-cat" title="' . $post->ID . '">' . single_cat_title('', false) . '</span></li>';
        } elseif (is_tag()) {
            $html .= '<li class="item-current item-tag"><span class="bread-current bread-tag">' . single_tag_title('', false) . '</span></li>';
        } elseif (is_author()) {
            $html .= '<li class="item-current item-author"><span class="bread-current bread-author">' . get_queried_object()->display_name . '</span></li>';
        } elseif (is_day()) {
            $html .= '<li class="item-current item-day"><span class="bread-current bread-day">' . get_the_date() . '</span></li>';
        } elseif (is_month()) {
            $html .= '<li class="item-current item-month"><span class="bread-current bread-month">' . get_the_date('F Y') . '</span></li>';
        } elseif (is_year()) {
            $html .= '<li class="item-current item-year"><span class="bread-current bread-year">' . get_the_date('Y') . '</span></li>';
        } elseif (is_archive()) {
            $custom_tax_name = get_queried_object()->name;
            $html .= '<li class="item-current item-archive"><span class="bread-current bread-archive">' . esc_attr($custom_tax_name) . '</span></li>';
        } elseif (is_search()) {
            $html .= '<li class="item-current item-search"><span class="bread-current bread-search">' . esc_html__('Search results for: ', 'quad-wp') . get_search_query() . '</span></li>';
        } elseif (is_404()) {
            $html .= '<li>' . esc_html__('Error 404', 'quad-wp') . '</li>';
        } elseif (is_home()) {
            $html .= '<li>' . get_the_title(get_option('page_for_posts')) . '</li>';
        }
        $html .= '</ol>';
        $html = apply_filters('quad_breadcrumbs_filter', $html);
        echo wp_kses_post($html);
    }

}

add_filter('the_content_more_link', 'quad_read_more_link');

function quad_read_more_link() {
    return '<p><a class="more-link btn" href="' . get_permalink() . '">' . esc_html__('Read more', 'quad-wp') . '</a></p>';
}