Skip to:
Content
Pages
Categories
Search
Top
Bottom

Title “Archives: Forum” – change to read “Forums”?


  • timmy321
    Participant

    @timmy321

    I’ve come across another sticking point.

    Why does my Forum title read “Archives: Forums”?

    I would like it to just read “Forums”, but am unsure of how to achieve this.

    http://findgyms.co.uk/forums/

    Could anyone please signpost me or help me solve this?

    Many thanks in advance,

    Tim

Viewing 20 replies - 1 through 20 (of 20 total)

  • Robin W
    Moderator

    @robin-w

    the theme is puting the header on


    Robin W
    Moderator

    @robin-w

    actually probably more theme/elementor combination related.

    since free Elementor is basic, and aims to encourage you to ‘go pro’ and buy additional elements and has a paid bbpress pack add-on, I kinda suspect it needs that to work properly – you wouldn’t write a paid add-on that is not required 🙂


    timmy321
    Participant

    @timmy321

    Ah I see!

    It’s likely the Astra theme I imagine then as this page was not built with elementor.

    I’ll ask in their forum,

    Thanks again Robin!

    Tim


    Robin W
    Moderator

    @robin-w

    so is this

    [bbp-forum-index]

    within a WordPress page ?


    timmy321
    Participant

    @timmy321

    Yep it is indeed


    timmy321
    Participant

    @timmy321

    Does this mean you there’s a glimmer of hope that you could provide a solution? 🙂


    Robin W
    Moderator

    @robin-w

    so what is that pages title ?


    timmy321
    Participant

    @timmy321

    I’ve put the title as just ‘Forums’


    Robin W
    Moderator

    @robin-w

    ok, that doesn’t get us any further


    timmy321
    Participant

    @timmy321

    Hi Robin, so the guys at Astra Forum suggested putting this into the Astra Child theme’s functions.php bit in Appearance – Theme Editor:

    add_filter( ‘get_the_archive_title’, ‘to_archive_title_remove_prefix’ );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( ”, false );
    }
    return $title;
    }

    I have no idea how or why it worked, but it did!!

    Thank you for troubleshooting this with me 🙂

    Maybe if anyone has a similar issue in the future they could also try this fix?

    Kind Regards,

    Tim


    Robin W
    Moderator

    @robin-w

    great – thanks for posting the answer


    torimc125
    Participant

    @torimc125

    Thank you @robin-w and @timmy321 for providing your solution. I have the exact issue. This is my first time working with a child’s theme. I actually had to read how to install one, so I learned another lesson working through this issue. Since this is all new to me, can someone tell me where within the functions.php content I should add the “fix verbiage”? Can I add it anywhere above my last line, or does it need to go before or after some other functions definition? I will continue to search for an answer in other areas, but I figured it wouldn’t hurt to ask. Thank you in advance. Victoria


    Robin W
    Moderator

    @robin-w

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    torimc125
    Participant

    @torimc125

    Thank you, Robin, for your reply. I downloaded Code Snippets and I added the above line, you provided, wp-content/themes/%your-theme-name%/functions.php. I changed %your-theme-name% to my theme, but I receive this fatal error.

    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 1:
    syntax error, unexpected end of file

    Was I supposed to add the below to code snippet?

    add_filter( ‘get_the_archive_title’, ‘to_archive_title_remove_prefix’ );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( ”, false );
    }
    return $title;
    }


    Robin W
    Moderator

    @robin-w

    if you are using code snippets, then JUST the code below (not the “wp-content/theme” etc – do NOT add that) , and use this code as it has the correct apostrophies in it

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

    torimc125
    Participant

    @torimc125

    Hi Robin: Thank you again for your reply.  I copied the code you provided and pasted it into Code Snippets. Now I get this error message: 

    “The snippet has been deactivated due to an error on line 3:
    Cannot redeclare function to_archive_title_remove_prefix.

    Any other suggestions?
    Victoria


    Robin W
    Moderator

    @robin-w

    so have you got this is your functions files as well ?


    Robin W
    Moderator

    @robin-w

    that is a question – you should only have it once, either in your theme function file or in code snippets not in both !


    torimc125
    Participant

    @torimc125

    I did!  I have corrected the error and now I am up and running. Thank you so much!  


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed !!

Viewing 20 replies - 1 through 20 (of 20 total)
  • You must be logged in to reply to this topic.
Skip to toolbar