Top Menu

Canvas theme – How to remove ‘Archive’ title in Category pages

Edit theme-functions.php and look for the code below.

/*———————————————————————————–*/
/* Archive Title */
/*———————————————————————————–*/
/**
* Archive Title
*
* The main page title, used on the various post archive templates.
*
* @since 4.0
*
* @param string $before Optional. Content to prepend to the title.
* @param string $after Optional. Content to append to the title.
* @param bool $echo Optional, default to true.Whether to display or return.
* @return null|string Null on no title. String if $echo parameter is false.
*
* @package WooFramework
* @subpackage Template
*/

if ( ! function_exists( ‘woo_archive_title’ ) ) {

function woo_archive_title ( $before = ”, $after = ”, $echo = true ) {

global $wp_query;

if ( is_category() || is_tag() || is_tax() ) {

$taxonomy_obj = $wp_query->get_queried_object();
$term_id = $taxonomy_obj->term_id;
$taxonomy_short_name = $taxonomy_obj->taxonomy;

$taxonomy_raw_obj = get_taxonomy( $taxonomy_short_name );

} // End IF Statement

$title = ”;
$delimiter = ”; /*Removed ‘|’ or change it to another character*/
$delimiter2 = ‘ | ‘; /*Added a new delimiters*/
$date_format = get_option( ‘date_format’ );

// Category Archive
if ( is_category() ) {

/* $title = ‘<span class=”fl cat”>’ . __( ‘Archive’, ‘woothemes’ ) . $delimiter . single_cat_title( ”, false ) . ‘</span> <span class=”fr catrss”>’; */
/* From the original code above, modify it as below*/

$title = ‘<span class=”fl cat”>’ . __( ”, ‘woothemes’ ) . $delimiter . single_cat_title( ”, false ) . ‘</span> <span class=”fr catrss”>’;

$cat_obj = $wp_query->get_queried_object();
$cat_id = $cat_obj->cat_ID;
$title .= ‘<a href=”‘ . get_term_feed_link( $term_id, $taxonomy_short_name, ” ) . ‘” class=”fa fa-rss fa-large” ></a></span>’;

$has_title = true;
}

// Day Archive
if ( is_day() ) {

$title = __( ‘Archive’, ‘woothemes’ ) . $delimiter2 . get_the_time( $date_format );
}

// Month Archive
if ( is_month() ) {

$date_format = apply_filters( ‘woo_archive_title_date_format’, ‘F, Y’ );
$title = __( ‘Archive’, ‘woothemes’ ) . $delimiter2 . get_the_time( $date_format );
}

// Year Archive
if ( is_year() ) {

$date_format = apply_filters( ‘woo_archive_title_date_format’, ‘Y’ );
$title = __( ‘Archive’, ‘woothemes’ ) . $delimiter2 . get_the_time( $date_format );
}

// Author Archive
if ( is_author() ) {

$title = __( ‘Author Archive’, ‘woothemes’ ) . $delimiter2 . get_the_author_meta( ‘display_name’, get_query_var( ‘author’ ) );
}

// Tag Archive
if ( is_tag() ) {

$title = __( ‘Tag Archives’, ‘woothemes’ ) . $delimiter2 . single_tag_title( ”, false );
}

// Post Type Archive
if ( function_exists( ‘is_post_type_archive’ ) && is_post_type_archive() ) {

/* Get the post type object. */
$post_type_object = get_post_type_object( get_query_var( ‘post_type’ ) );

$title = $post_type_object->labels->name . ‘ ‘ . __( ‘Archive’, ‘woothemes’ );
}

// Post Format Archive
if ( get_query_var( ‘taxonomy’ ) == ‘post_format’ ) {

$post_format = str_replace( ‘post-format-‘, ”, get_query_var( ‘post_format’ ) );

$title = get_post_format_string( $post_format ) . ‘ ‘ . __( ‘ Archives’, ‘woothemes’ );
}

// General Taxonomy Archive
if ( is_tax() ) {

$title = sprintf( __( ‘%1$s Archives: %2$s’, ‘woothemes’ ), $taxonomy_raw_obj->labels->name, $taxonomy_obj->name );

}

if ( strlen($title) == 0 )
return;

$title = $before . $title . $after;

// Allow for external filters to manipulate the title value.
$title = apply_filters( ‘woo_archive_title’, $title, $before, $after );

if ( $echo )
echo $title;
else
return $title;

} // End woo_archive_title()

} // End IF Statement

 

And in custom.css add the following line under the heading Global Styles

span.fl.cat {font:bold 28px/1.1em “Helvetica Neue”, Helvetica, sans-serif}

 

DON’T FORGET TO BACKUP BEFORE EDITING!!!

Related Post

, , , , , ,