array( 'href' => array() ), 'span' => array(), 'i' => array( 'class' => array() ) ); $siteUrl = home_url('/'); if( has_custom_logo() ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); $siteLogo = ''; $siteLogo .= ''; return $siteLogo; } elseif( !edura_opt('edura_text_title') && edura_opt('edura_site_logo', 'url' ) ){ $siteLogo = ''.esc_attr__( 'logo', 'edura' ).''; return ''; }elseif( edura_opt('edura_text_title') ){ return '

'; }else{ return '

'; } } // custom meta id callback function edura_meta( $id = '' ){ $value = get_post_meta( get_the_ID(), '_edura_'.$id, true ); return $value; } // Blog Date Permalink function edura_blog_date_permalink() { $year = get_the_time('Y'); $month_link = get_the_time('m'); $day = get_the_time('d'); $link = get_day_link( $year, $month_link, $day); return $link; } //audio format iframe match function edura_iframe_match() { $audio_content = edura_embedded_media( array('audio', 'iframe') ); $iframe_match = preg_match("/\iframe\b/i",$audio_content, $match); return $iframe_match; } //Post embedded media function edura_embedded_media( $type = array() ){ $content = do_shortcode( apply_filters( 'the_content', get_the_content() ) ); $embed = get_media_embedded_in_content( $content, $type ); if( in_array( 'audio' , $type) ){ if( count( $embed ) > 0 ){ $output = str_replace( '?visual=true', '?visual=false', $embed[0] ); }else{ $output = ''; } }else{ if( count( $embed ) > 0 ){ $output = $embed[0]; }else{ $output = ''; } } return $output; } // WP post link pages function edura_link_pages(){ wp_link_pages( array( 'before' => '', 'link_before' => '', 'link_after' => '', 'pagelink' => '' . esc_html__( 'Page', 'edura' ) . ' %', 'separator' => ', ', ) ); } // Data Background image attr function edura_data_bg_attr( $imgUrl = '' ){ return 'data-bg-img="'.esc_url( $imgUrl ).'"'; } // image alt tag function edura_image_alt( $url = '' ){ if( $url != '' ){ // attachment id by url $attachmentid = attachment_url_to_postid( esc_url( $url ) ); // attachment alt tag $image_alt = get_post_meta( esc_html( $attachmentid ) , '_wp_attachment_image_alt', true ); if( $image_alt ){ return $image_alt ; }else{ $filename = pathinfo( esc_url( $url ) ); $alt = str_replace( '-', ' ', $filename['filename'] ); return $alt; } }else{ return; } } // Flat Content wysiwyg output with meta key and post id function edura_get_textareahtml_output( $content ) { global $wp_embed; $content = $wp_embed->autoembed( $content ); $content = $wp_embed->run_shortcode( $content ); $content = wpautop( $content ); $content = do_shortcode( $content ); return $content; } /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function edura_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'edura_pingback_header' ); // Excerpt More function edura_excerpt_more( $more ) { return '...'; } add_filter( 'excerpt_more', 'edura_excerpt_more' ); // edura comment template callback function edura_comment_callback( $comment, $args, $depth ) { $add_below = 'comment'; ?>
  • >
    user_id; // Get the user's avatar (profile image) $avatar_url = get_avatar_url($user_id); ?>
    esc_url( $avatar_url ), ) ); } ?>

    Reply', 'edura' ); $edit_reply_text = wp_kses_post( ' Edit', 'edura' ); comment_reply_link(array_merge( $args, array( 'add_below' => $add_below, 'depth' => 3, 'max_depth' => 5, 'reply_text' => $reply_text ) ) ); edit_comment_link( $edit_reply_text, ' ', '' ); ?>
    comment_approved == '0' ) : ?>

    array( 'class' => array() ), 'i' => array( 'class' => array() ), 'span' => array( 'class' => array(), ), 'a' => array( 'href' => array(), 'title' => array(), 'class' => array(), ), 'br' => array(), 'em' => array(), 'strong' => array(), 'b' => array(), ); echo ''; } function edura_social_icon(){ $edura_social_icon = edura_opt( 'edura_social_links' ); if( ! empty( $edura_social_icon ) && isset( $edura_social_icon ) ){ foreach( $edura_social_icon as $social_icon ){ if( ! empty( $social_icon['title'] ) ){ echo ' '; } } } } function edura_custom_menu(){ $edura_custom_menu = edura_opt( 'edura_custom_menu' ); if( ! empty( $edura_custom_menu ) && isset( $edura_custom_menu ) ){ echo ''; } } // global header function edura_global_header_option() { if( class_exists( 'ReduxFramework' ) ){ global $woocommerce; if( ! empty( $woocommerce->cart->cart_contents_count ) ){ $count = $woocommerce->cart->cart_contents_count; }else{ $count = "0"; } if(edura_opt('edura_menu_icon')){ $menu_icon = ''; }else{ $menu_icon = 'hide-icon'; } // Edura Widget Enable Disable $edura_btn_text = edura_opt('edura_btn_text'); $edura_btn_url = edura_opt('edura_btn_url'); $edura_header_search_switcher = edura_opt( 'edura_search_switcher' ); $edura_header_cart_switcher = edura_opt( 'edura_cart_switcher' ); $edura_wishlist_switcher = edura_opt( 'edura_wishlist_switcher' ); $edura_cate_switcher = edura_opt( 'edura_cate_switcher' ); $edura_btn_switcher = edura_opt( 'edura_btn_switcher' ); echo edura_search_box(); echo edura_mobile_menu(); echo '
    '; echo '
    '; edura_header_topbar(); echo '
    '; echo ''; echo ''; echo '
    '; echo '
    '; if( $count > 0 ){ echo ''; echo '
    '; echo '
    '; echo ''; echo '
    '; echo '

    '.esc_html( 'Shopping cart', 'edura' ).'

    '; echo '
    '; woocommerce_mini_cart(); echo '
    '; echo '
    '; echo '
    '; echo '
    '; echo ''; } }else{ edura_global_header(); } } // edura woocommerce breadcrumb function edura_woo_breadcrumb( $args ) { return array( 'delimiter' => '', 'wrap_before' => '', 'before' => '
  • ', 'after' => '
  • ', 'home' => _x( 'Home', 'breadcrumb', 'edura' ), ); } add_filter( 'woocommerce_breadcrumb_defaults', 'edura_woo_breadcrumb' ); function edura_custom_search_form( $class ) { echo ''; echo ''; echo ''; } //Fire the wp_body_open action. if ( ! function_exists( 'wp_body_open' ) ) { function wp_body_open() { do_action( 'wp_body_open' ); } } //Remove Tag-Clouds inline style add_filter( 'wp_generate_tag_cloud', 'edura_remove_tagcloud_inline_style',10,1 ); function edura_remove_tagcloud_inline_style( $input ){ return preg_replace('/ style=("|\')(.*?)("|\')/','',$input ); } function edura_setPostViews( $postID ) { $count_key = 'post_views_count'; $count = get_post_meta( $postID, $count_key, true ); if( $count == '' ){ $count = 0; delete_post_meta( $postID, $count_key ); add_post_meta( $postID, $count_key, '0' ); }else{ $count++; update_post_meta( $postID, $count_key, $count ); } } function edura_getPostViews( $postID ){ $count_key = 'post_views_count'; $count = get_post_meta( $postID, $count_key, true ); if( $count == '' ){ delete_post_meta( $postID, $count_key ); add_post_meta( $postID, $count_key, '0' ); return __( '0', 'edura' ); } return $count; } /* This code filters the Categories archive widget to include the post count inside the link */ add_filter( 'wp_list_categories', 'edura_cat_count_span' ); function edura_cat_count_span( $links ) { $links = str_replace(' (', ' ', $links); $links = str_replace(')', '', $links); return $links; } /* This code filters the Archive widget to include the post count inside the link */ add_filter( 'get_archives_link', 'edura_archive_count_span' ); function edura_archive_count_span( $links ) { $links = str_replace(' (', ' ', $links); $links = str_replace(')', '', $links); return $links; } //header search box if(! function_exists('edura_search_box')){ function edura_search_box(){ echo ''; } } // mobile logo function edura_mobile_logo() { $logo_url = edura_opt('edura_mobile_logo', 'url' ); $mobile_menu = ''; if( !empty($logo_url )){ $mobile_menu = ''; }else{ $mobile_menu .= ''; } return $mobile_menu; } //header mobile menu if(! function_exists('edura_mobile_menu')){ function edura_mobile_menu(){ echo '
    '; echo '
    '; echo ''; if( class_exists('ReduxFramework') ){ if(!empty(edura_opt('edura_menu_menu_show') )){ echo edura_mobile_logo(); } }else{ echo ''; } echo '
    '; if( has_nav_menu( 'primary-menu' ) ) { echo '
    '; wp_nav_menu( array( "theme_location" => 'primary-menu', "container" => '', "menu_class" => '' ) ); echo '
    '; } echo '
    '; echo '
    '; echo '
    '; } } //Offcanvas box if(! function_exists('edura_offcanvas_box')){ function edura_offcanvas_box(){ echo '
    '; echo '
    '; echo ''; if(is_active_sidebar('edura-offcanvth-sidebar')){ dynamic_sidebar( 'edura-offcanvth-sidebar' ); }else{ echo '

    No Widget Added

    '; echo '

    Please add some widget in Offcanvs Sidebar

    '; } echo '
    '; echo '
    '; } } //header Cart Offcanvas if( ! function_exists( 'edura_header_cart_offcanvas' ) ){ function edura_header_cart_offcanvas(){ ?>

    '; echo '
    '; echo ' '; echo '
    '; } } if( ! function_exists( 'edura_header_topbar' ) ){ function edura_header_topbar(){ $edura_show_header_topbar = edura_opt( 'edura_header_topbar_switcher' ); $edura_show_social_icon = edura_opt( 'edura_social_switcher' ); $edura_login_text = edura_opt('edura_login_text'); $edura_login_url = edura_opt('edura_login_url'); $user_id = get_current_user_id(); $user = get_user_by('ID', $user_id); $phone = edura_opt( 'edura_topbar_phone_text' ); $email = edura_opt( 'edura_topbar_email_text' ); $replace = array(' ','-',' - '); $with = array('','',''); $phoneurl = str_replace( $replace, $with, $phone ); $emailurl = str_replace( $replace, $with, $email ); if( $edura_show_header_topbar ){ $allowhtml = array( 'a' => array( 'href' => array(), 'class' => array() ), 'u' => array( 'class' => array() ), 'span' => array( 'class' => array() ), 'i' => array( 'class' => array() ) ); echo ''; echo '
    '; echo '
    '; echo '
    '; echo '
    '; echo ''; echo '
    '; echo ''; echo '
    '; echo '
    '; echo '
    '; echo '
    '; } } } // Add Extra Class On Comment Reply Button function edura_custom_comment_reply_link( $content ) { $extra_classes = 'reply-btn'; return preg_replace( '/comment-reply-link/', 'comment-reply-link ' . $extra_classes, $content); } add_filter('comment_reply_link', 'edura_custom_comment_reply_link', 99); // Add Extra Class On Edit Comment Link function edura_custom_edit_comment_link( $content ) { $extra_classes = 'reply-btn'; return preg_replace( '/comment-edit-link/', 'comment-edit-link ' . $extra_classes, $content); } add_filter('edit_comment_link', 'edura_custom_edit_comment_link', 99); function edura_post_classes( $classes, $class, $post_id ) { global $wp; $actual_link = home_url(add_query_arg(array(), $wp->request)); if ( get_post_type() === 'post' ) { if( strpos($actual_link, '/profile') == false ) { $classes[] = "th-blog blog-single"; }else{ $classes[] = "space-top space-extra-bottom bg-smoke"; } }elseif( get_post_type() === 'product' ){ // Return Class }elseif( get_post_type() === 'page' ){ $classes[] = "page--item"; } return $classes; } add_filter( 'post_class', 'edura_post_classes', 10, 3 ); add_filter('wpcf7_autop_or_not', '__return_false');