'',
'default-repeat' => 'no-repeat',
'default-text-color' => '00BAE1',
'url' => '',
'width' => 1920,
'height' => 89,
'flex-height' => true
);
$background_args = array(
'default-color' => 'f7f8f8',
);
add_theme_support( 'custom-background', $background_args );
add_theme_support( 'custom-header', $header_args );
add_theme_support( 'automatic-feed-links' );//
add_theme_support( 'custom-logo', array(
'height' => 50,
'width' => 50,
'flex-width' => true,
) );
//register menus
register_nav_menus(
array(
'header-menu' => __( 'Header Menu', 'awork' ) ,
'footer-menu' => __( 'Footer Menu', 'awork' )
)
);
add_theme_support( "title-tag" );//
add_editor_style("editor-style.css");
if ( !isset( $content_width ) ) $content_width = 1170;
}
add_action( 'after_setup_theme', 'awork_setup' );
function awork_custom_scripts()
{
$theme_info = wp_get_theme();
wp_enqueue_style('awork-base', get_template_directory_uri() .'/css/base.css', false, $theme_info->get( 'Version' ), false);
wp_enqueue_style('font-awesome', get_template_directory_uri() .'/css/font-awesome.min.css', false,"4.6.3", false);
wp_enqueue_style('bootstrap', get_template_directory_uri() .'/css/bootstrap.min.css', false,"3.3.7", false);
wp_enqueue_style('awork-style', get_stylesheet_uri(), false, $theme_info->get( 'Version' ) );
wp_enqueue_style(
'custom-style',
get_template_directory_uri() . '/css/custom_script.css'
);
$custom_css = '';
if ( has_custom_logo() ){
$custom_css .= "@media screen and (max-width:1025px){
.awork-logo-text{ display:none;}
.awork-logo{ margin-left:20px;}
}";
}else{
$custom_css .= "@media screen and (max-width:1025px){
.blog-description{ display:none;}
.awork-logo-text{ margin-top:10px;}
}";
}
wp_add_inline_style( 'custom-style', $custom_css );
wp_enqueue_script('bootstrap', get_template_directory_uri().'/js/bootstrap.min.js', array( 'jquery' ), '3.3.7', false );
wp_enqueue_script('awork-main', get_template_directory_uri().'/js/main.js', array( 'jquery' ),$theme_info->get( 'Version' ), false );
}
add_action( 'wp_enqueue_scripts', 'awork_custom_scripts' );
function awork_better_comments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
id="li-comment-">
__('Sidebar','awork'),
'id' => 'sidebar',
'before_widget' => ' ',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'awork_widgets_init' );
function awork_breadcrumbs() {
//$delimiter = 'ยป';
$delimiter = "»";
$before = '';
$after = '';
if ( !is_home() && !is_front_page() || is_paged() ) {
echo '';
global $post;
$homeLink = home_url();
echo '
' . __( 'Home' , 'awork' ) . ' ' . $delimiter . ' ';
if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0){
$cat_code = get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' ');
echo $cat_code = str_replace ('
' . get_the_time('Y') . ' ' . $delimiter . ' ';
echo '
' . get_the_time('F') . ' ' . $delimiter . ' ';
echo $before . get_the_time('d') . $after;
} elseif ( is_month() ) {
echo '
' . get_the_time('Y') . ' ' . $delimiter . ' ';
echo $before . get_the_time('F') . $after;
} elseif ( is_year() ) {
echo $before . get_the_time('Y') . $after;
} elseif ( is_single() && !is_attachment() ) {
if ( get_post_type() != 'post' ) {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo '
' . $post_type->labels->singular_name . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} else {
$cat = get_the_category(); $cat = $cat[0];
$cat_code = get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $cat_code = str_replace ('
labels->singular_name . $after;
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo '' . $parent->post_title . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_page() && !$post->post_parent ) {
echo $before . get_the_title() . $after;
} elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '
' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_search() ) {
echo $before ;
printf( __( 'Search Results for: %s', 'awork' ), get_search_query() );
echo $after;
} elseif ( is_tag() ) {
echo $before ;
printf( __( 'Tag Archives: %s', 'awork' ), single_tag_title( '', false ) );
echo $after;
} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $before ;
printf( __( 'Author Archives: %s', 'awork' ), $userdata->display_name );
echo $after;
} else if ( is_404() ) {
echo $before;
_e( 'Not Found', 'awork' );
echo $after;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() )
echo sprintf( __( '( Page %s )', 'awork' ), get_query_var('paged') );
}
echo '
';
}
}