Title “Archives: Forum” – change to read “Forums”?
-
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.
Could anyone please signpost me or help me solve this?
Many thanks in advance,
Tim
-
the theme is puting the header on
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 🙂
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
so is this
[bbp-forum-index]
within a WordPress page ?
Yep it is indeed
Does this mean you there’s a glimmer of hope that you could provide a solution? 🙂
so what is that pages title ?
I’ve put the title as just ‘Forums’
ok, that doesn’t get us any further
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
great – thanks for posting the answer
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
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
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 fileWas 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;
}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; }
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?
Victoriaso have you got this is your functions files as well ?
that is a question – you should only have it once, either in your theme function file or in code snippets not in both !
I did! I have corrected the error and now I am up and running. Thank you so much!
great – glad you are fixed !!
- You must be logged in to reply to this topic.