[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 - 1 through 15 (of 31 total)
  • Author
    Posts
  • #184871
    celito

    Hello, I am using GeneratePress Premium and have a page listing LearnDash courses. The list is automatically generated by LearnDash using WordPress archives template. I just need to change “Archives” to “Course List.” Is there a simple way to do this? I don’t know how I’d do this.I thought I could just open archives.php and edit the heading there directly. Please pardon this total newbie. Thanks.

    #185085
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can overwrite the archive title function with this PHP: https://gist.github.com/generatepress/b4b6642ac3b447c87a0440a59e1fdefb

    You want to change the word on line 59.

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    Let me know if you need more info πŸ™‚

    #185165
    celito

    Thank you so much. This was very helpful and educational.

    #185204
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome πŸ™‚

    #224003
    n52

    Hi!
    After installing Toolset plugin for custom taxonomies I see “Archive” title on my custom categories.
    I ve created archive-My_Posttype by editing archive.php and cuting “<?php do_action( ‘generate_archive_title’ ); ?>”. As I understand it cuts not only H1 ARCHIVE πŸ™‚ and for My_posttype it doesn’t matter.
    BUT!
    It s matter for MY_TAXONOMIES archives.
    What I have done yet to change “Archive” title:
    1. read plugin info “Two solutions are possible. One may be an admin theme option to turn off titles on these kind of pages. Second, would require editing the theme archive.php file and remove the code that prints that title.
    Just be sure that you include your new title from Views inside an H1 tag, to get the best SEO results.”
    but I have not found this “switcher”
    than I have sought answer here to remove this part of code here.
    2. https://generatepress.com/forums/topic/custom-page-titles-for-categories/
    I ve installed Pluginception (https://generatepress.com/knowledgebase/adding-php-functions/) and puted Tom’s code to my new plugin. no changes.
    than I ve pasted code from https://gist.github.com/generatepress/b4b6642ac3b447c87a0440a59e1fdefb – no changes. from https://gist.github.com/generatepress/fe5309693719d138dbcf84381eb9a6b3 – no changes.
    3. Hide it in css by ((post-type-archive-testimonial page-header ( display: none;))) – no changes.
    —-
    I need to cut “Archive” h1 and replace it with my H1 from editor.
    —-
    As I understand… I may create taxonomy.php and rewrite code but i don’t know php πŸ™‚
    What I need to do?

    #224127
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    So removing the generate_archive_title hook doesn’t remove the H1?

    #224139
    n52

    It removes H1 and it removes all of the code from editor.

    #224276
    Tom
    Lead Developer
    Lead Developer

    Removes all of which code? It should only remove the H1, as that’s the only thing hooked into that hook.

    #224297
    n52

    I don’t know how to explain it.
    All code from description.
    http://dropmefiles.com/SEEcR
    1. In my custom taxonomy it is “Archive”
    2. The description code
    There are no more changes

    #224548
    Tom
    Lead Developer
    Lead Developer

    You’ll either have to:

    a) Remove the hook from your specific custom post type archive.php file, and add your own title.

    or

    b) Overwrite the archive title function to include a conditional check for your custom post type: https://gist.github.com/generatepress/fe5309693719d138dbcf84381eb9a6b3

    #224558
    n52

    As I wrote – No changes.

    2. https://generatepress.com/forums/topic/custom-page-titles-for-categories/
    I ve installed Pluginception (https://generatepress.com/knowledgebase/adding-php-functions/) and puted Tom’s code to my new plugin. no changes.
    than I ve pasted code from https://gist.github.com/generatepress/b4b6642ac3b447c87a0440a59e1fdefb – no changes. from https://gist.github.com/generatepress/fe5309693719d138dbcf84381eb9a6b3 – no changes.

    #224680
    Tom
    Lead Developer
    Lead Developer

    Adding just this code won’t change anything: https://gist.github.com/generatepress/b4b6642ac3b447c87a0440a59e1fdefb

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

    #224701
    n52

    Please write how to do it. 😩

    #224705
    Tom
    Lead Developer
    Lead Developer

    That’s a bit out of the scope of support here, but if I find a minute today to do it I will πŸ™‚

    #224712
    n52

    Would be very nice of you. 😔

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