tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
// register_nav_menus( array(
// 'primary' => esc_html__( 'Primary', 'Anti-Flash-White' ),
// ) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'anti_flash_white_custom_background_args', array(
'default-color' => '#d2f2f2',
'default-image' => get_template_directory_uri() . '/inc/texture.png',
'default-repeat' => 'tile',
'default-position-x' => '',
'default-attachment' => 'fixed',
) ) );
}
endif;
add_action( 'after_setup_theme', 'anti_flash_white_setup' );
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}
// boostrap registraion menu
add_action( 'after_setup_theme', 'wpt_setup' );
// if ( ! function_exists( 'wpt_setup' ) ):
function wpt_setup() {
register_nav_menu( 'primary', __( 'Primary navigation', 'Anti-Flash-White' ) );
}
// endif;
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function anti_flash_white_content_width() {
$GLOBALS['content_width'] = apply_filters( 'anti_flash_white_content_width', 640 );
}
add_action( 'after_setup_theme', 'anti_flash_white_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function anti_flash_white_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'Anti-Flash-White' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'Anti-Flash-White' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Left Sidebar', 'Anti-Flash-White' ),
'id' => 'sidebar_2',
'description' => esc_html__( 'Add widgets here.', 'Anti-Flash-White' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Woo Sidebar', 'Anti-Flash-White' ),
'id' => 'woo-sidebar',
'description' => esc_html__( 'Add widgets here.', 'Anti-Flash-White' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'anti_flash_white_widgets_init' );
/**
* Enqueue scripts and styles placed in head.
*/
function anti_flash_white_styles() {
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' , array(), '3.3.6');
wp_enqueue_style( 'fontawesome-style', get_template_directory_uri() . '/inc/font-awesome/css/font-awesome.min.css', array(), '4.6.3');
wp_enqueue_style( 'jssocial-style', get_template_directory_uri() . '/css/theme.css', array(), '4.6.3');
wp_enqueue_style( 'jssocials-style-flat', get_template_directory_uri() . '/inc/jssocials/jssocials.css', array(), '1.2.1');
wp_enqueue_style( 'custom-bootstrap-style', get_template_directory_uri() . '/inc/jssocials/jssocials-theme-flat.css', array(), '1.2.1');
}
add_action( 'wp_enqueue_scripts', 'anti_flash_white_styles' );
/**
* Enqueue scripts placed in footer.
*/
function anti_flash_white_scripts() {
wp_enqueue_script( 'js-jquery', get_template_directory_uri() . '/js/jquery.min.js', array(), '1.12.4', true );
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.3.6', true );
wp_enqueue_style( 'Anti-Flash-White-style', get_stylesheet_uri() );
wp_enqueue_script( 'Anti-Flash-White-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
wp_enqueue_script( 'Anti-Flash-White-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
wp_enqueue_script( 'JS-socialss', get_template_directory_uri() . '/inc/jssocials/jssocials.min.js', array(), '1.2.1', true );
wp_enqueue_script( 'theme-customs', get_template_directory_uri() . '/js/theme.js', array(), '1.0', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'anti_flash_white_scripts' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
require_once('wp_bootstrap_navwalker.php');
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
add_editor_style( get_stylesheet_uri() );
}
function mytheme_comment($comment, $args, $depth) {
if ( 'div' === $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
< id="comment-">
'',
'email' => '',
'url' => ''
);
return $fields;
}
add_filter( 'comment_form_defaults', 'bootstrap3_comment_form' );
function bootstrap3_comment_form( $args ) {
$args['comment_field'] = '';
$args['class_submit'] = 'btn btn-success'; // since WP 4.1
return $args;
}
//Read More
function new_excerpt_more( $more ) {
return ' ' . __('
Read More...', 'Anti-Flash-White') . '';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
/**
* Display navigation to next/previous post when applicable.
*
* @return void
*/
function custom_post_navigation() {
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
';
}
function my_theme_wrapper_end() {
echo '';
}
?>