'ffffff',
'border' => 'e9e9e9',
'text' => '9d9d9d',
'link' => '000000',
'url' => '000000',
);
}
// Tell WordPress to run blogum_setup() when the 'after_setup_theme' hook is run.
add_action( 'after_setup_theme', 'blogum_setup' );
if ( ! function_exists( 'blogum_setup' ) ):
function blogum_setup() {
load_theme_textdomain( 'blogum', get_template_directory() . '/languages' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
//Add support for the Aside, Gallery nad Image Post Formats
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image' ) );
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'primary', __( 'Primary Menu', 'blogum' ) );
// Add support for custom backgrounds
add_theme_support( 'custom-background' );
add_theme_support( 'custom-header', apply_filters( 'blogum_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000',
'header-text' => false,
'width' => 945,
'height' => 150,
'flex-height' => true,
'admin-head-callback' => 'blogum_admin_header_style',
) ) );
}
endif; // end blogum_setup
/**
* Enqueue scripts and styles
*/
function blogum_scripts() {
wp_enqueue_style( 'blogum', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'blogum_scripts' );
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*/
function blogum_admin_header_style() {
?>
*/
function blogum_add_menu_class ( $page_markup ) {
preg_match( '/^
/i', $page_markup, $matches );
$divclass = $matches[1];
$toreplace = array( '
', '
' );
$new_markup = str_replace( $toreplace, '', $page_markup );
$new_markup = preg_replace( '/^
/i', '', $new_markup );
return $new_markup;
}
add_filter( 'wp_page_menu', 'blogum_add_menu_class' );
if ( ! function_exists( 'blogum_comment' ) ) :
/**
* Template for comments and pingbacks.
* Used as a callback by wp_list_comments() for displaying the comments.
*/
function blogum_comment( $comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
id="li-comment-">
__( 'Sidebar Widget Area', 'blogum' ),
'id' => 'sidebar-1',
'description' => __( 'The Sidebar Widget Area.', 'blogum' ),
'before_widget' => '',
'before_title' => '',
'after_title' => ' ',
) );
}
add_action( 'init', 'blogum_widgets_init' );
// Display navigation to next/previous pages when applicable
function blogum_content_nav( $nav_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
← Older posts', 'blogum' ) ); ?>
→', 'blogum' ) ); ?>
%4$s
', 'blogum' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'blogum' ), get_the_author() ) ),
esc_html( get_the_author() ),
get_the_category_list( __( ', ', 'blogum' ) ),
esc_url( get_permalink() )
);
elseif ( is_sticky() ) :
printf( __ ( '%1$s
', 'blogum' ),
get_the_category_list( __( ', ', 'blogum' ) ),
esc_url( get_permalink() )
);
elseif ( is_multi_author() ) :
printf( __ ( '%5$s
', 'blogum' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'blogum' ), get_the_author() ) ),
esc_html( get_the_author() ),
esc_html( get_the_date() ),
get_the_category_list( __( ', ', 'blogum' ) ),
esc_url( get_permalink() )
);
else:
printf( __ ( '%2$s
', 'blogum' ),
esc_html( get_the_date() ),
get_the_category_list( __( ', ', 'blogum' ) ),
esc_url( get_permalink() )
);
endif; ?>
' . __( 'Read More', 'blogum' ) . ' ';
}
// Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and blogum_continue_reading_link().
function blogum_auto_excerpt_more( $more ) {
return ' …' . blogum_continue_reading_link();
}
add_filter( 'excerpt_more', 'blogum_auto_excerpt_more' );
// Adds a pretty "Continue Reading" link to custom post excerpts.
function blogum_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= blogum_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'blogum_custom_excerpt_more' );
function blogum_comments_popup_link() {
if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
tag based on what is being viewed.
*
* @since Blogum 1.0
*/
function blogum_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'blogum' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'blogum_wp_title', 10, 2 );