__('Primary Menu'),
'footer' => __('Footer Menu'),
));
// Add featured image support
add_theme_support('post-thumbnails');
add_image_size('post_thumbnail_image', 150, 130, true);
//Add post format support
add_theme_support('post-formats', array('aside', 'link', 'gallery'));
}
add_action('after_setup_theme', 'featured_image_box');
// Add Widget Locations
function widgetlocation() {
register_sidebar( array(
'name' => 'Sidebar',
'id' => 'sidebar1',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => ''
));
register_sidebar( array(
'name' => 'Footer Column 1',
'id' => 'footer1',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
register_sidebar( array(
'name' => 'Footer Column 2',
'id' => 'footer2',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
register_sidebar( array(
'name' => 'Footer Column 3',
'id' => 'footer3',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
}
add_action('widgets_init', 'widgetlocation');
add_theme_support('custom-background');
add_theme_support( 'html5', array( 'comment-list', 'comment-form'));
// Pagination
function pagination_bar() {
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '/page/%#%',
'current' => $current_page,
'total' => $total_pages,
));
}
}
// Customize Options
// Output Customize CSS
function blogginglovetheme_customize_css() { ?>
1 ){
$comments = $comments_num . __(' Comments');
}else{
$comments = __('Leave a comment');
}
$comments = '';
}else{
$comments = __( 'Comments are closed');
}
return $comments;
}
// Header Image
add_theme_support('custom-header');
// Remove WordPress Version
function blogginglove_wordpress_version(){
return '';
}
add_filter('the_generator','blogginglove_wordpress_version');
// Remove Password Link
function remove_password_link( $text ) {
if($text == 'Lost your password?') {$text ='';}
return $text;
}
add_filter( 'gettext', 'remove_password_link');
// Edit Login Error Message
function login_error_message() {
return 'Wrong Login Details.';
}
add_filter('login_errors', 'login_error_message');
// Comment Minimum Length
add_filter( 'preprocess_comment', 'blogginglove_comment_limit');
function blogginglove_comment_limit($comment) {
if ( strlen( $comment['comment_content']) < 60 ) {
wp_die('Your comment is too short. Try to say something valuable');
}
return $comment;
}
add_theme_support( 'automatic-feed-links' );
function wpdocs_theme_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'admin_init', 'wpdocs_theme_add_editor_styles' );
add_theme_support( 'title-tag' );
if ( ! isset( $content_width ) ) $content_width = 1200;
function blogginglove_enqueue_comments_reply() {
if( get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'comment_form_before', 'blogginglove_enqueue_comments_reply' );