__( 'blackzebra Navigation Menu','blackzebra' ),
)
);
/* 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 blackzebra_widgets_init() {
register_sidebar(array(
'id' => 'sidebar-1',
'name' => __('Left Sidebar', 'blackzebra'),
'description' => __('Left Sidebar in blackzebra themes', 'blackzebra'),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'id' => 'sidebar-2',
'name' => __('Middle Sidebar', 'blackzebra'),
'description' => __('Middle Sidebar in blackzebra themes', 'blackzebra'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'id' => 'sidebar-3',
'name' => __('Right Sidebar', 'blackzebra'),
'description' => __('Right Sidebar in blackzebra themes', 'blackzebra'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
}
/* Add theme language */
function blackzebra_translate(){
load_theme_textdomain( 'blackzebra', 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 blackzebra_excerpt_length( $length ) {
return 40;
}
function blackzebra_continue_reading_link() {
return ' ' . __( 'Continue reading →', 'blackzebra' ) . '';
}
function blackzebra_auto_excerpt_more( $more ) {
return ' …' . blackzebra_continue_reading_link();
}
function blackzebra_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= ' …' . blackzebra_continue_reading_link();
}
return $output;
}
/* 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:', 'blackzebra' ) . '', 'after' => '
' ) );
echo '';
next_post_link('%link', '← %title');
previous_post_link('%link', '%title →');
echo '
';
}
}
/* Title filter by wp_title() */
function blackzebra_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', 'blackzebra' ) . ' ' . max( $paged, $page );
} else {
if( ! is_home() )$filter_title .= ' &' . $separator . '; ';
$filter_title .= get_bloginfo( 'name' );
if ( $paged >= 2 || $page >= 2 )
$filter_title .= ', ' . __( 'Page', 'blackzebra' ) . ' ' . max( $paged, $page );
}
if ( is_home() && $site_description )
$filter_title .= ' &' . $separator . '; ' . $site_description;
return $filter_title;
}
/* Filter content with empty post title */
function blackzebra_untitled($title) {
if ($title == '') {
return __('Untitled', 'blackzebra');
} 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-">
'."\n";
}
/* Output Custom CSS from theme options */
function blackzebra_custom_css() {
$custom_css = of_get_option('blackzebra_custom_css');
if ($custom_css != '') {
echo "\n\n";
}
}
/* Output Google meta verification from theme options */
function blackzebra_meta_google(){
$output = of_get_option('mahjonk_blusea_meta_google');
if ( $output )
echo ' ' . "\n";
}
/* Output Alexa meta verification from theme options */
function blackzebra_meta_alexa(){
$output = of_get_option('mahjonk_blusea_meta_alexa');
if ( $output )
echo ' ' . "\n";
}
/* Output Bing meta verification from theme options */
function blackzebra_meta_bing(){
$output = of_get_option('mahjonk_blusea_meta_bing');
if ( $output )
echo ' ' . "\n";
}
/* Output analytics code in footer from theme options */
function blackzebra_analytics(){
$output = of_get_option('blackzebra_analytic_code');
if ( $output )
echo "" . stripslashes($output) . "
" ."\n";
}
/* textarea sanitization and $allowedposttags + embed and script
* based on theme options framework */
function blackzebra_change_santiziation() {
remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
add_filter( 'of_sanitize_textarea', 'blackzebra_sanitize_textarea' );
}
function blackzebra_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;
}
?>