__( 'awanlangit Navigation Menu','awanlangit' ), 'awanlangit_footer' => __( 'awanlangit Footer Menu','awanlangit' ) ) ); /* Remove unnecessary stuffs from head */ remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'start_post_rel_link', 10, 0); remove_action('wp_head', 'parent_post_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); } /* Register widgetisize area */ function awanlangit_widgets_init() { register_sidebar(array( 'id' => 'sidebar-1', 'name' => __('Left Sidebar', 'awanlangit'), 'description' => __('Left Sidebar in awanlangit themes', 'awanlangit'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar-2', 'name' => __('Middle Sidebar', 'awanlangit'), 'description' => __('Middle Sidebar in awanlangit themes', 'awanlangit'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebar-3', 'name' => __('Right Sidebar', 'awanlangit'), 'description' => __('Right Sidebar in awanlangit themes', 'awanlangit'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } /* Add theme language */ function awanlangit_translate(){ load_theme_textdomain( 'awanlangit', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); } /* Custom Excerpt function */ function awanlangit_excerpt_length( $length ) { return 40; } function awanlangit_continue_reading_link() { return ' ' . __( 'Continue reading →', 'awanlangit' ) . ''; } function awanlangit_auto_excerpt_more( $more ) { return ' …' . awanlangit_continue_reading_link(); } function awanlangit_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= ' …' . awanlangit_continue_reading_link(); } return $output; } /* Default menu fallback function */ function awanlangit_default_menu() { echo ''; } /* Content navigation */ function blackzebra_content_nav() { global $wp_query; $paged = ( get_query_var( 'paged' ) ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = get_pagenum_link(); $url_parts = parse_url( $pagenum_link ); $format = ( get_option('permalink_structure') ) ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%'; if ( isset($url_parts['query']) ) { $pagenum_link = "{$url_parts['scheme']}://{$url_parts['host']}{$url_parts['path']}%_%?{$url_parts['query']}"; } else { $pagenum_link .= '%_%'; } $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 2, 'type' => 'list' ) ); if (!is_single() && $links ) { echo "
{$links}
"; } if (is_single()){ wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'awanlangit' ) . '', 'after' => '
' ) ); echo '
'; } } /* Title filter by wp_title() */ function awanlangit_filter_title( $filter_title ){ global $page, $paged; $filter_title = str_replace( '»', '', $filter_title ); $site_description = get_bloginfo( 'description', 'display' ); $separator = '#124'; if ( is_singular() ) { if ( $paged >= 2 || $page >= 2 )$filter_title .= ', ' . __( 'Page', 'awanlangit' ) . ' ' . max( $paged, $page ); } else { if( ! is_home() )$filter_title .= ' &' . $separator . '; '; $filter_title .= get_bloginfo( 'name' ); if ( $paged >= 2 || $page >= 2 ) $filter_title .= ', ' . __( 'Page', 'awanlangit' ) . ' ' . max( $paged, $page ); } if ( is_home() && $site_description ) $filter_title .= ' &' . $separator . '; ' . $site_description; return $filter_title; } /* Filter content with empty post title */ function awanlangit_untitled($title) { if ($title == '') { return __('Untitled', 'awanlangit'); } else { return $title; } } /* Comment and trackback layout */ function blackzebra_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    '."\n"; } /* Output Custom CSS from theme options */ function awanlangit_custom_css() { $custom_css = of_get_option('awanlangit_custom_css'); if ($custom_css != '') { echo "\n\n"; } } /* Output Google meta verification from theme options */ function awanlangit_meta_google(){ $output = of_get_option('awanlangit_meta_google'); if ( $output ) echo ' ' . "\n"; } /* Output Alexa meta verification from theme options */ function awanlangit_meta_alexa(){ $output = of_get_option('awanlangit_meta_alexa'); if ( $output ) echo ' ' . "\n"; } /* Output Bing meta verification from theme options */ function awanlangit_meta_bing(){ $output = of_get_option('awanlangit_meta_bing'); if ( $output ) echo ' ' . "\n"; } /* Output analytics code in footer from theme options */ function awanlangit_analytics(){ $output = of_get_option('awanlangit_analytic_code'); if ( $output ) echo "
    \n" . stripslashes($output) . "\n
    "; } /* textarea sanitization and $allowedposttags + embed and script * based on theme options framework */ function awanlangit_change_santiziation() { remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' ); add_filter( 'of_sanitize_textarea', 'awanlangit_sanitize_textarea' ); } function awanlangit_sanitize_textarea($input) { global $allowedposttags; $custom_allowedtags["embed"] = array( "src" => array(), "type" => array(), "allowfullscreen" => array(), "allowscriptaccess" => array(), "height" => array(), "width" => array() ); $custom_allowedtags["script"] = array(); $custom_allowedtags = array_merge($custom_allowedtags, $allowedposttags); $output = wp_kses( $input, $custom_allowedtags); return $output; } ?>