• id="li-comment-">
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    esc_url( 'https://www.coothemes.com/themes/acool.php' ), 'upgrade_text' => __( 'Upgrade To Pro »', 'acool' ), 'WP_version' => get_bloginfo( 'version' ), 'old_version_message' => __( 'Some settings might be missing or disorganized in this version of WordPress. So we suggest you to upgrade to version 4.0 or better.', 'acool' ) ); wp_localize_script( 'acool_customizer_custom', 'clean_box_misc_links', $clean_box_misc_links ); wp_enqueue_style( 'acool_customizer_custom_css', get_template_directory_uri() . '/css/customizer.css'); } add_action( 'customize_controls_enqueue_scripts', 'acool_customize_scripts'); /** * Gets option value from the single theme option, stored as an array in the database * if all options stored in one row. * Stores the serialized array with theme options into the global variable on the first function run on the page. * * If options are stored as separate rows in database, it simply uses get_option() function. * * @param string $option_name Theme option name. * @param string $default Default value that should be set if the theme option isn't set. */ if ( ! function_exists( 'acool_get_option' ) ){ function acool_get_option( $ct_row,$option_name,$default ) { $arr = get_option($ct_row); if(is_array($arr)) { @$option_value = $arr[$option_name]; if($option_value !='') { return $option_value; } else { if(array_key_exists($option_name,$arr) ){ return false; } else { return $default; } } } else { return $default; } } } /** * WordPress breadcrumbs * //since 1.0.2 acool_breadcrumbs() */ function acool_breadcrumbs() { $delimiter = '»'; $name = __( 'Home', 'acool' ); //text for the 'Home' link $currentBefore = ''; $currentAfter = ''; if ( !is_home() && !is_front_page() || is_paged() ) { echo '
    '; global $post; $home = esc_url(home_url()); echo ' '.$name. ' ' . $delimiter . ' '; if ( is_category() ) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' ')); echo $currentBefore; esc_html( single_cat_title()); echo $currentAfter; } elseif ( is_day() ) { echo '' . get_the_time('Y') . ' ' . $delimiter . ''; echo '' . esc_html(get_the_time('F')) . '' . $delimiter . ' '; echo $currentBefore . esc_html(get_the_time('d') ). $currentAfter; } elseif ( is_month() ) { echo '' . esc_html(get_the_time('Y') ). ' ' . $delimiter . ''; echo $currentBefore . esc_html(get_the_time('F')) . $currentAfter; } elseif ( is_year() ) { echo $currentBefore . esc_html(get_the_time('Y')) . $currentAfter; } elseif ( is_single() ) { $cat = get_the_category(); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); echo $currentBefore; esc_html( the_title()); echo $currentAfter; } elseif ( is_page() && !$post->post_parent ) { echo $currentBefore; esc_html( the_title()); echo $currentAfter; } elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' '; echo $currentBefore; esc_html( the_title()); echo $currentAfter; } elseif ( is_search() ) { echo $currentBefore . __('Search results for '','acool') . get_search_query() . ''' . $currentAfter; } elseif ( is_tag() ) { echo $currentBefore . __('Posts tagged '','acool') ; esc_html(single_tag_title()); echo ''' . $currentAfter; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $currentBefore . __('Articles posted by ','acool') . esc_html($userdata->display_name) . $currentAfter; } elseif ( is_404() ) { echo $currentBefore . __('Error 404','acool') . $currentAfter; } if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' ('; echo __('Page', 'acool') . ' ' . get_query_var('paged'); if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')'; } echo '
    '; } } //add page number function acool_paging_nav(){ global $wp_query; $pages = $wp_query->max_num_pages; if ( $pages >= 2 ): $big = 999999999; $paginate = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'end_size' => 13, 'type' => 'array' )); echo '
    '; endif; } //header add mobile_nav function acool_add_mobile_navigation(){ printf( '
    %1$s
    ', esc_html__( 'Select Page', 'acool' ) ); } add_action( 'ct_header_top', 'acool_add_mobile_navigation' ); /* * get background * --------------------------------------------------------------------- */ function acool_get_background($args,$opacity=1) { $background = ""; if (is_array($args)) { if (isset($args['image']) && $args['image']!="") { $background .= "background-image:url(".esc_url($args['image']). ");"; $background .= "background-repeat: ".esc_attr($args['repeat']).";"; $background .= "background-position: ".esc_attr($args['position']).";"; $background .= "background-attachment: ".esc_attr($args['attachment']).";"; } if(isset($args['color']) && $args['color'] !="") { $rgb = acool_hex2rgb($args['color']); $background .= "background-color:rgba(".$rgb[0].",".$rgb[1].",".$rgb[2].",".esc_attr($opacity).");"; } } return $background; } /** * Convert Hex Code to RGB #FFFFFF -> 255 255 255 * @param string $hex Color Hex Code * @return array RGB values */ function acool_hex2rgb( $hex ) { if ( strpos( $hex,'rgb' ) !== FALSE ) { $rgb_part = strstr( $hex, '(' ); $rgb_part = trim($rgb_part, '(' ); $rgb_part = rtrim($rgb_part, ')' ); $rgb_part = explode( ',', $rgb_part ); $rgb = array($rgb_part[0], $rgb_part[1], $rgb_part[2], $rgb_part[3]); } elseif( $hex == 'transparent' ) { $rgb = array( '255', '255', '255', '0' ); } else { $hex = str_replace( '#', '', $hex ); if( strlen( $hex ) == 3 ) { $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); } else { $r = hexdec( substr( $hex, 0, 2 ) ); $g = hexdec( substr( $hex, 2, 2 ) ); $b = hexdec( substr( $hex, 4, 2 ) ); } $rgb = array( $r, $g, $b ); } return $rgb; // returns an array with the rgb values } /* this function gets thumbnail from Post Thumbnail or Custom field or First post image */ if ( ! function_exists( 'acool_get_thumbnail' ) ) { function acool_get_thumbnail($post_id) { //if ( $post == '' ) global $post; if(has_post_thumbnail()) { $ct_post_thumbnail_fullpath=wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), "Full"); $thumb_array['fullpath'] = esc_url($ct_post_thumbnail_fullpath[0]); }else{ $post_content = get_post($post_id)->post_content; $thumb_array['fullpath'] = acool_catch_that_image($post_content); } if($post = 'front-page' && $thumb_array['fullpath']=="" ) { $thumb_array['fullpath'] = esc_url(of_get_option('default-featured-image')); } if($post = 'front-page' && $thumb_array['fullpath']=="" ) { $thumb_array['fullpath'] = esc_url(get_template_directory_uri()."/images/default-thumbnail.jpg"); } return $thumb_array; } } function acool_catch_that_image($post_content) { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post_content, $matches); if($output!='') $first_img = $matches[1][0]; return $first_img; } function acool_get_title($str,$limit) { if(strlen($str) > $limit) { $str = substr($str, 0, $limit); } echo $str; } //post_meta function acool_show_post_meta() { ?>