tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'klasik' ), max( $paged, $page ) );
}// end ts_get_title()
}
// New get website title
function klasik_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name', 'display' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
$title = "$title $sep " . sprintf( __( 'Page %s', 'klasik' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'klasik_title', 10, 2 );
// head action hook
if(!function_exists("klasik_head")){
function klasik_head(){
do_action("klasik_head");
}
add_action('wp_head', 'klasik_head', 20);
}
if(!function_exists("klasik_print_headtag")){
function klasik_print_headtag(){
$favicon = klasik_get_option( 'klasik_favicon');
if($favicon !="" ){
?>
'.get_the_title().'';
echo $titleoutput;
}elseif(is_single()){
$titleoutput=''.get_the_title().'
';
echo $titleoutput;
}elseif(function_exists('is_woocommerce') && is_woocommerce()){
echo '';
woocommerce_page_title();
echo '
';
}elseif(is_archive()){
echo '';
if ( is_day() ) :
printf( __( 'Daily Archives %s', 'klasik' ), get_the_date() );
elseif ( is_month() ) :
printf( __( 'Monthly Archives %s', 'klasik' ), get_the_date('F Y') );
elseif ( is_year() ) :
printf( __( 'Yearly Archives %s', 'klasik' ), get_the_date('Y') );
elseif ( is_author()) :
printf( __( 'Author Archives %s', 'klasik' ), "" . get_the_author() . "" );
else :
printf( __( '%s', 'klasik' ), '' . single_cat_title( '', false ) . '' );
endif;
echo '
';
if(category_description( get_cat_ID( single_cat_title( '', false ) ) )){
echo ''.category_description( get_cat_ID( single_cat_title( '', false ) ) ).'';
}
}elseif(is_search()){
echo '';
printf( __( 'Search Results for %s', 'klasik' ), '' . get_search_query() . '' );
echo '
';
}elseif(is_404()){
echo ' ';
_e( '404 Page', 'klasik' );
echo '
';
}elseif( is_home() ){
$homeid = get_option('page_for_posts');
echo '';
echo ($homeid)? get_the_title( $homeid ) : __('Latest Posts', 'klasik');
echo '
';
}else{
if (have_posts()) : while (have_posts()) : the_post();
//if(!is_front_page()){
$titleoutput='';
if($cf_pagetitle == ""){
$titleoutput.=''.get_the_title().'
';
}else{
$titleoutput.=''.$cf_pagetitle.'
';
}
echo $titleoutput;
if($cf_pagedesc){
echo ''.$cf_pagedesc.'';
}
//}
endwhile; endif; wp_reset_query();
}
}
}
if( !function_exists('klasik_page_image')){
function klasik_page_image(){
$custom = klasik_get_customdata();
$cf_pageimg = (isset($custom["page-image"][0]) && $custom["page-image"][0]!="")? $custom["page-image"][0] : "";
$bg_pagetitle = "";
if($cf_pageimg!=""){
$bg_pagetitle .='style="background-image:url(';
$bg_pagetitle .= $cf_pageimg;
$bg_pagetitle .=')"';
};
return $bg_pagetitle;
}
}
?>