function canary_sidebars(){ $sidebars=array( array( 'name' => __( LJ_THEME_NAME.' Widget Area','canary' ), 'id' => LJ_THEME_SLUG.'_sidebar', 'description' => __( 'Add widgets here to appear in your sidebar.','canary' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); return $sidebars; } // Customizer settings -----------> function canary_customize_partial_blogname() { bloginfo( 'name' ); } function canary_customize_partial_blogdescription() { bloginfo( 'description' ); } // checking for active sidebar -----------> function canary_active_sidebars(){ foreach(canary_sidebars() as $sidebar){ if ( is_active_sidebar($sidebar['id']) ) { return true ; }else{ continue; } } return false; } // Post entery metas ---------------> function canary_entry_meta() { echo ''; } function canary_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( LJ_THEME_SLUG.'_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, 'number' => 2, )); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( LJ_THEME_SLUG.'_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so canary_categorized_blog should return true. return true; } else { // This blog has only 1 category so canary_categorized_blog should return false. return false; } } // Post featured image ---------------> function canary_post_thumbnail( $size='',$id='') { if( !($size=trim($size)) ){ $size='medium'; } if( !($id=trim($id)) ){ $id=get_the_ID(); } if(has_post_thumbnail($id)){ echo '
'.get_the_post_thumbnail( $id, $size, array( 'alt' => get_the_title() ) ).'
'; } } // Home page validation ---------------> function canary_is_home_page(){ if ( is_home() && is_front_page()) { return true; }else{ return false; } } // Displays the optional custom logo ---------------> function canary_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) { echo '
'; the_custom_logo(); }else{ echo '
'; if(canary_is_home_page()){ echo '

'.esc_html(get_bloginfo( 'name' )).'

'; } else{ echo '

'.esc_html(get_bloginfo( 'name' )).'

'; } if ( $description = get_bloginfo( 'description', 'display' )){ echo '

'.esc_html($description).'

'; } } echo '
'; } // Author's meta ----------------> function canary_author_metas($author_id) { echo '
'; if($post_count=count_user_posts($author_id)) { echo ''.esc_html($post_count).''; } if($website=esc_url(get_the_author_meta('url',$author_id)) ){ echo ''; } echo ''; echo '
'; } ?>