'',
'default-repeat' => 'no-repeat',
'default-text-color' => '2C2C2C',
'url' => '',
'width' => 1920,
'height' => 89,
'header-text' => false
);
add_theme_support( 'custom-background', $args );
add_theme_support( 'custom-header', $header_args );
add_theme_support('post-thumbnails');
add_editor_style("editor-style.css");
if ( ! isset( $content_width ) ) $content_width = 900;
//require_once( $template_directory . '/includes/theme-setup.php' );
function awork_custom_scripts()
{
global $is_IE;
$theme_info = wp_get_theme();
//css
//wp_enqueue_style('font-awesome', get_template_directory_uri() .'/css/font-awesome.min.css', false, '4.5.0', false);
//wp_enqueue_style('bootstrap', get_template_directory_uri() .'/css/bootstrap.min.css', false, '3.3.5', false);
wp_enqueue_style('awork-main', get_stylesheet_uri(), array(), $theme_info->get( 'Version' ) );
//js
wp_enqueue_script('awork-main', get_template_directory_uri().'/js/ss.js', array( 'jquery' ), '3.3.5', false );
}
if (!is_admin())
{
add_action( 'wp_enqueue_scripts', 'awork_custom_scripts' );
}
//register menus
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu', 'awork' )
)
);
/*
add widgets to wp-admin
*/
function awork_widgets_init() {
register_sidebar( array(
'name' => 'Sidebar',
'id' => 'sidebar-1',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'awork_widgets_init' );
function awork_breadcrumbs() {
$delimiter = '»';
$name = __( 'Home', 'awork' ); //text for the 'Home' link
$currentBefore = '';
$currentAfter = '';
if ( !is_home() && !is_front_page() ) {
echo '';
global $post;
$home = esc_url(home_url('/'));
echo ' '.$name. ' ' . $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) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
echo $currentBefore;
esc_html( single_cat_title());
echo $currentAfter;
} elseif ( is_day() ) {
echo '' . get_the_time('Y') . ' ' . $delimiter . '';
echo '' . esc_html(get_the_time('F')) . '' . $delimiter . ' ';
echo $currentBefore . esc_html(get_the_time('d') ). $currentAfter;
} elseif ( is_month() ) {
echo '' . esc_html(get_the_time('Y') ). ' ' . $delimiter . '';
echo $currentBefore . esc_html(get_the_time('F')) . $currentAfter;
} elseif ( is_year() ) {
echo $currentBefore . esc_html(get_the_time('Y')) . $currentAfter;
} elseif ( is_single() ) {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_page() && !$post->post_parent ) {
echo $currentBefore;
the_title();
echo $currentAfter;
} 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 $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_search() ) {
echo $currentBefore . __('Search results for '','awork') . get_search_query() . ''' . $currentAfter;
} elseif ( is_tag() ) {
echo $currentBefore . __('Posts tagged '','awork') ;
single_tag_title();
echo ''' . $currentAfter;
} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $currentBefore . __('Articles posted by ','awork') . esc_html($userdata->display_name) . $currentAfter;
} elseif ( is_404() ) {
echo $currentBefore . __('Error 404','awork') . $currentAfter;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
echo __('Page', 'awork') . ' ' . get_query_var('paged');
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
echo '
';
}
}
//add page number
function awork_paging_nav(){
global $wp_query;
$pages = $wp_query->max_num_pages;
if ( $pages >= 2 ):
$big = 999999999;
$paginate = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'end_size' => 5,
'type' => 'array'
));
echo '';
endif;
}
//post_meta
function awork_show_post_meta()
{
?>
', '', get_the_ID() ); ?>