__('Right Sidebar', 'b4'),
'id' => 'right-sidebar',
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
]);
}
//
function setup()
{
add_theme_support('custom-background', ['default-color' => 'ffffff']);
add_theme_support('automatic-feed-links' );
add_theme_support('title-tag' );
add_theme_support('html5', ['search-form', 'comment-form', 'comment-list', 'gallery', 'caption']);
register_nav_menus(['main_menu' => __( 'Main Menu', 'b4')]);
add_editor_style( 'css/bootstrap.min.css' );
}
//
function enqueue_scripts()
{
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', [], '4.4.0' );
wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', [], self::VERSION );
wp_enqueue_style('styles', get_stylesheet_uri(), ['bootstrap'], '1' );
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.js', ['jquery'], self::VERSION, true );
}
//
function nav_li_class($classes, $item)
{
$classes[] .= ' nav-item';
return $classes;
}
//
function nav_anchor_class( $atts, $item, $args )
{
$atts['class'] .= ' nav-link';
return $atts;
}
//
function comment_form_before()
{
echo '';
}
//
function comment_form( $fields )
{
$fields['fields']['author'] = '
';
$fields['fields']['email'] ='
';
$fields['fields']['url'] = '
';
$fields['comment_field'] = '
';
$fields['comment_notes_before'] = '';
$fields['class_submit'] = 'btn btn-primary';
return $fields;
}
//
function comment_form_after()
{
echo ' ';
}
//
function get_posts_pagination( $args = '' )
{
global $wp_query;
$pagination = '';
if ( $GLOBALS['wp_query']->max_num_pages > 1 )
{
$defaults = [
'total' => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1,
'current' => get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1,
'type' => 'array',
'prev_text' => '«',
'next_text' => '»',
];
$params = wp_parse_args($args, $defaults);
$paginate = paginate_links($params);
if( $paginate )
{
$pagination .= "";
}
}
return $pagination;
}
//
function the_posts_pagination($args = '')
{
echo $this->get_posts_pagination( $args );
}
//
}
$b4 = new B4_Theme;
?>