[Resolved] Change "Archives" to other title

Home Forums Support [Resolved] Change "Archives" to other title

Home Forums Support Change "Archives" to other title

  • This topic has 30 replies, 6 voices, and was last updated 6 years ago by Tom.
Viewing 15 posts - 16 through 30 (of 31 total)
  • Author
    Posts
  • #225783
    celito

    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

    #225809
    Lyle

    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

    #225843
    Tom
    Lead Developer
    Lead Developer

    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?

    #225855
    celito

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

    Celito

    #225857
    celito

    Thanks Lyle. I’ll also try this out.

    #226030
    n52

    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.

    #226468
    n52

    Hurah… I solved it πŸ™‚
    page-header and page-title are different things πŸ˜‰

    #226473
    Tom
    Lead Developer
    Lead Developer

    Awesome! Great job πŸ™‚

    #290385
    njwrigley

    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' );
    #290397
    Tom
    Lead Developer
    Lead Developer

    Thanks for sharing! πŸ™‚

    #542044
    Thierry

    Hello,

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

    Thx

    #542610
    Tom
    Lead Developer
    Lead Developer

    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?

    #542707
    Thierry

    That’s right : hide “archives”, i haven’t a link, its just on local

    https://ibb.co/fvcTHH

    #543101
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #543519
    Thierry

    Great Tom, thx

Viewing 15 posts - 16 through 30 (of 31 total)
  • You must be logged in to reply to this topic.