Site logo

Archived topic

Change "Archives" to other title

30 replies · Started by celito on April 7, 2016

Viewing posts 16–30 of 31

Hi, I'm sorry to bother you again. I had Word Press re-installed and re-installed the GP theme, GP premium and all other plugins. I again retraced the steps in this previous thread to change the Archives title. While I got it in the first attempt the last time, I can't get it to work this time. When I update the plugin created with Pluginception attaching the php script from github, this error message pops up:

Oops! That page can’t be found.
It looks like nothing was found at this location. Maybe try searching?

The script can't be saved. I tried Simple PHP but same result. What am I doing wrong? Thanks.

Celito

Thought that I would jump in to say that another way to change any string in a theme, plugin or even WordPress core is to use the Loco Translate plugin. If you save the generated .po, .mo and .pot files to the /languages folder and not the /loco folder, you can deactivate and delete the plugin when you are finished and your changes will remain intact. I have used this on a couple sites and it is really quite slick and does not require getting one's "hands dirty" with PHP :)

https://wordpress.org/plugins/loco-translate/

Cheers!
Lyle

Another option is this plugin: https://en-ca.wordpress.org/plugins/say-what/

It sounds like you have something weird going on with your installation, as saving a file shouldn't cause a 404 error. Have you checked with your hosting support?

Thanks. I'll check out this plugin and also refer this issue to the hosting site.

Celito

Thanks Lyle. I'll also try this out.

Hi
Tom, may you write what I have to do step by step to change Title?. please...

You need to alter the function to include the conditional for your custom post type and your custom title.

Hurah... I solved it :)
page-header and page-title are different things ;)

Awesome! Great job :)

This served me well. For the case above you can use this:

elseif ( is_post_type_archive( 'your_custom_post_type_slug' ) ) :
_e( 'your_new_archive_title', 'generatepress' );

Thanks for sharing! :)

Hello,

And for displaying only the title fron a CPT, no change "archives" but without "archives" ?

Thx

I'm not too sure what you mean? You don't want "Archives" to show in the title while viewing CPT archives? Can you link me to the page?

You could try this:

add_filter( 'get_the_archive_title', 'tu_adjust_cpt_archives_title' );
function tu_adjust_cpt_archives_title( $title ) {
    if ( is_post_type_archive() ) {
        $title = post_type_archive_title( '', false );
    }

    return $title;
}

Great Tom, thx

This archived topic is closed to new replies.