add_filter('navigation_markup_template',function(){
return $template = '
';
});
// Adding body class --------------->
add_filter( 'body_class', function ( $classes ) {
if ( get_background_image() ) { // Adds a class of custom-background-image to sites with a custom background image.
$classes[] = 'custom-background-image';
}
if ( is_multi_author() ) { // Adds a class of group-blog to sites with more than 1 published author.
$classes[] = 'group-blog';
}
if ( ! is_active_sidebar( 'sidebar-1' ) ) {// Adds a class of no-sidebar to sites without active sidebar.
$classes[] = 'no-sidebar';
}
if ( ! is_singular() ) {// Adds a class of hfeed to non-singular pages.
$classes[] = 'hfeed';
}
return $classes;
} );
// Add a `screen-reader-text` class to the search form's submit button. --------------->
add_filter( 'get_search_form', function ( $html ) {
return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
});
// Excerpt more --------------->
add_filter( 'excerpt_more', function( $more ) {
if(! is_admin()){
/* translators: %s: Name of current post */
$link = sprintf( '%2$s',esc_url( get_permalink( get_the_ID() ) ),sprintf( esc_html__( 'Continue Reading %s','canary' ), ''.get_the_title( get_the_ID() ).'' ));
return '… ' . $link;
}
});
// Archive title ----------------------->
add_filter('get_the_archive_title',function($title )
{
$rss='';
if (is_search()){
$title = ''. esc_html__( 'Searching for:','canary' ).'"'.get_search_query().'"' ;
}elseif ( is_category() ) {
$title = ''.single_cat_title( '', false ).''. esc_html__( 'Category','canary' ).'' ;
$rss=get_category_feed_link(get_query_var('cat'));
} elseif ( is_tag() ) {
$title = ''.single_tag_title( '', false ).''. esc_html__( 'Tag Archive','canary' ).'' ;
$rss=get_tag_feed_link(get_query_var('tag_id'));
} elseif ( is_author() ) {
$title = '' . get_the_author() . ''. esc_html__( 'Author','canary' ).'' ;
$rss= get_author_feed_link(get_the_author_meta('ID'));
} elseif ( is_year() ) {
$title = '' .get_the_date( __( 'Y','canary' ) ) . ''. esc_html__( 'Yearly Archives','canary' ).'' ;
} elseif ( is_month() ) {
$title = '' .get_the_date( __( 'F Y','canary' ) ) . ''. esc_html__( 'Monthly Archives ','canary' ).'' ;
} elseif ( is_day() ) {
$title = '' .get_the_date( __( 'F j, Y','canary' ) ) . ''. esc_html__( 'Daily Archives','canary' ).'' ;
} elseif ( is_post_type_archive() ) {
$title = '' .post_type_archive_title( '', false ) . '' ;
$rss=get_post_type_archive_feed_link(get_query_var('post_type'));
} elseif ( is_tax() ) {
$tax = get_taxonomy( get_queried_object()->taxonomy );
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$title = ''.single_term_title('', false ).''.$tax->labels->singular_name.'' ;
$rss=get_term_feed_link($term->term_id, get_query_var( 'taxonomy' ));
} else {
$title =''.esc_html__( 'All Posts','canary').' '.esc_html__( 'Blog Archives:','canary').'';
$rss=get_bloginfo('rss2_url');
}
if($title && $rss){
$title=$title.''.esc_html__('Subscribe','canary').' ';
}
return $title;
});
// add the filter for search widget title ....
add_filter( 'widget_title', function( $instance_title, $instance,$this_id_base ) {
if($this_id_base=='search'){
$instance_title = ! empty( $instance['title'] ) ? $instance['title'] :__('Search','canary');
}
return $instance_title;
} , 10, 3 );
?>