This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Change “Author Archives” headline text

Resolved 3 replies premiumthemetheme-vantage
11 years ago · Last reply by Andrew Misplon 11 years ago

The look and feel of my website is coming on great thanks to all your help. But I just got another problem. I am trying to change the “Author Archives:” headline text to something else, without changing the template-tags.php file in the original theme. Copying it over to the root of the child-theme or indeed in an “inc” folder in the child does not work. Neither does including it in the functions.php or adding this line

require_once( get_stylesheet_directory() . '/inc/template-tags.php' );

I am at a loss here, and have searched and searched without finding a solution to the problem.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

3
  1. Andrew Misplon Staff 11 years, 6 months ago

    Hi Tor

    You’ll need to use a child theme to do this. Create a functions.php in your child theme and add the following:

    <?php
    if( !function_exists( 'vantage_get_archive_title' ) ) :
    /**
     * Return the archive title depending on which page is being displayed.
     * 
     * @since vantage 1.0
     */
    function vantage_get_archive_title(){
    	$title = '';
    	if ( is_category() ) {
    		$title = sprintf( __( 'My Category Archives: %s', 'vantage' ), '<span>‘ . single_cat_title( ”, false ) . ‘</span>‘ );
    	}
    	elseif ( is_tag() ) {
    		$title = sprintf( __( ‘Tag Archives: %s’, ‘vantage’ ), ‘<span>‘ . single_tag_title( ”, false ) . ‘</span>‘ );
    	}
    	elseif ( is_author() ) {
    		the_post();
    		$title = sprintf( __( ‘Author Archives: %s’, ‘vantage’ ), ‘<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me" rel="nofollow">‘ . get_the_author() . ‘</a></span>‘ );
    		rewind_posts();
    	}
    	elseif ( is_day() ) {
    		$title = sprintf( __( ‘Daily Archives: %s’, ‘vantage’ ), ‘<span>‘ . get_the_date() . ‘</span>‘ );
    	}
    	elseif ( is_month() ) {
    		$title = sprintf( __( ‘Monthly Archives: %s’, ‘vantage’ ), ‘<span>‘ . get_the_date( ‘F Y’ ) . ‘</span>‘ );
    	}
    	elseif ( is_year() ) {
    		$title = sprintf( __( ‘Yearly Archives: %s’, ‘vantage’ ), ‘<span>‘ . get_the_date( ‘Y’ ) . ‘</span>‘ );
    	}
    	else {
    		$title = __( ‘Archives’, ‘vantage’ );
    	}
    	return apply_filters(‘vantage_archive_title’, $title);
    }
    endif;

    And edit as required. If you already have a functions.php file with contents in it then you don’t need the opening

  2. Tor André Sandum 11 years, 6 months ago

    Thank you so much, that worked like a charm!

    Should probably be simple, but I could not find the answer anywhere! Well, now everything is good again!

  3. Andrew Misplon Staff 11 years, 6 months ago

    Awesome; glad to hear you were able to resolve.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread