name . ' ' . wp_get_theme()->version ) . '" />' . "\n";
}
add_action( 'wp_head', 'tijaji_generator' );
function tijaji_theme_support() {
add_theme_support( 'title-tag' );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
add_theme_support( 'post-formats', array( 'aside', 'video' ) );
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu', 'tijaji' ),
'footer-menu' => __( 'Footer Menu', 'tijaji' ),
)
);
}
add_theme_support( 'menus' );
$tijaji_args = array(
'default' => get_template_directory_uri() . '/images/default-1.jpg',
'width' => 1920,
'height' => 600,
'uploads' => true,
'header-text' => false,
'default-text-color' => '000000',
'video' => true,
);
add_theme_support( 'custom-header', $tijaji_args );
register_default_headers( array(
'default-image' => array(
'url' => get_template_directory_uri() . '/images/default-1.jpg',
'thumbnail_url' => get_template_directory_uri() . '/images/default-1.jpg',
),
'default-image_2' => array(
'url' => get_template_directory_uri() . '/images/default-2.jpg',
'thumbnail_url' => get_template_directory_uri() . '/images/default-2.jpg',
),
'default-image_3' => array(
'url' => get_template_directory_uri() . '/images/default-3.jpg',
'thumbnail_url' => get_template_directory_uri() . '/images/default-3.jpg',
),
) );
add_theme_support( 'custom-logo', array(
'height' => 100,
'width' => 100,
'flex-width' => true,
) );
$tijaji_background_param = array(
'default-color' => 'f9f9f9'
);
add_theme_support( 'custom-background', $tijaji_background_param );
}
add_action( 'after_setup_theme', 'tijaji_theme_support' );
function tijaji_remove_tagline($tijaji_title) {
if ( isset($tijaji_title['tagline']) ) {
unset( $tijaji_title['tagline'] );
}
return $tijaji_title;
}
add_filter( 'document_title_parts', 'tijaji_remove_tagline' );
function tijaji_title_separator($tijaji_sep) {
$tijaji_sep = '|';
return $tijaji_sep;
}
add_filter( 'document_title_separator', 'tijaji_title_separator' );
function tijaji_widgets_init() {
register_sidebar(array(
'name' => __( 'Sidebar', 'tijaji' ),
'id' => 'sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Footer', 'tijaji' ),
'id' => 'footer',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Content top', 'tijaji' ),
'id' => 'content_top',
'description' => __( 'Ideal for displaying bread crumbs.', 'tijaji' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Article Content bottom', 'tijaji' ),
'id' => 'content_bottom',
'description' => __( 'It is displayed directly under the article.', 'tijaji' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
}
add_action( 'widgets_init','tijaji_widgets_init' );
if ( !function_exists( 'tijaji_excerpt_length' ) ) {
function tijaji_excerpt_length( ) {
if ( is_admin() ) {
return;
}
return 140;
}
}
add_filter( 'excerpt_length', 'tijaji_excerpt_length', 999 );
function tijaji_page_navi() {
$pagination = get_the_posts_pagination( array( 'mid_size' => 2 ) );
$pagination = str_replace(' role="navigation"', '', $pagination);
$allowed_html = array(
'a' => array( 'href' => array (), 'class' => array (), 'target' => array() ),
'div' => array( 'style' => array (), 'class' => array (), 'align' => array () ),
'span' => array( 'style' => array (), 'class' => array (), 'aria-current' => array () ),
'h2' => array( 'style' => array (), 'class' => array () ),
'nav' => array( 'style' => array (), 'class' => array (), 'align' => array () ),
);
echo wp_kses( $pagination, $allowed_html );
}
require get_template_directory() . '/inc/header-images.php';
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/customizer-sidebar.php';
require get_template_directory() . '/inc/theme-info.php';
$width = str_replace( array('width','full'),array('','1400'),tijaji_max_content_width());
if( tijaji_layout() == 'one' ) { $content_width = $width * 0.92; }
else{ $content_width = ( $width - 315 ) * 0.92; }
function tijaji_admin_notice(){
if ( isset( $_GET['admin_notice'] ) ) {
if( $_GET['admin_notice'] == '1' ) update_option( 'tijaji_admin_notice','1');
}
if( get_option('tijaji_admin_notice') ){
return;
}
$html = '';
echo wp_kses_post($html);
}
add_action( 'admin_notices', 'tijaji_admin_notice' );
function tijaji_category_id_class($tijaji_classes) {
global $post;
if( $post && !is_search() && !is_404() ) {
foreach((get_the_category($post->ID)) as $category)
$tijaji_classes [] = 'cat-' . $category->cat_ID . '-id';
}
return $tijaji_classes;
}
add_filter('post_class', 'tijaji_category_id_class');
add_filter('body_class', 'tijaji_category_id_class');
function tijaji_has_thumb_class($tijaji_classes) {
global $post;
if( has_post_thumbnail($post->ID) ) { $tijaji_classes[] = 'has_thumb'; }
return $tijaji_classes;
}
add_filter('post_class', 'tijaji_has_thumb_class');
function tijaji_custom_comments_list($tijaji_comment, $tijaji_args, $tijaji_depth){
?>
id="li-comment-">
id="li-comment-">
' . esc_html_e('Your comment is awaiting approval.','tijaji') . '
';?>