Support

Home Forums Event Espresso Premium Archive Event Page Title Change

Archive Event Page Title Change

Posted: March 24, 2023 at 6:06 am

Viewing 6 reply threads


sosfirstaid.ca

March 24, 2023 at 6:06 am

Hello,
We are trying to change the <title> for the page https://sosfirstaid.ca/events/ , but as we reviewed nothing is affecting there. We have tried the following hook to change it but it is also not working, please refer to the code below:
function my_custom_event_archive_title( $title ) {
if ( is_post_type_archive( ‘espresso_events’ ) ) {
$title = ‘Upcoming Events’;
}
return $title;
}
add_filter( ‘get_the_archive_title’, ‘my_custom_event_archive_title’ );

Also, we have tried to make changes through Yoast SEO, but it is not reflecting too. Could you please suggest why it is not reflecting?

Thanks


Tony

  • Support Staff

March 24, 2023 at 6:16 am

Hi there,

Could you please suggest why it is not reflecting?

Its most likely because your theme is setting the archive title itself.

First, try changing this:

add_filter( 'get_the_archive_title', 'my_custom_event_archive_title' );

To:

add_filter( 'get_the_archive_title', 'my_custom_event_archive_title', 999 );

Any difference?


sosfirstaid.ca

March 27, 2023 at 2:19 am

Hello,
We have replaced the code,please check below:
function my_custom_event_archive_title( $title ) {
if ( is_post_type_archive( ‘espresso_events’ ) ) {
$title = ‘Upcoming Events’;
}
return $title;
}
add_filter( ‘get_the_archive_title’, ‘my_custom_event_archive_title’, 999 );
But its also not working…. Could you please check and let us know.
Thanks


Tony

  • Support Staff

March 27, 2023 at 6:25 am

The above code only works if your theme is using functions that use is, such as the_archive_title() which it sounds like your theme is not.

It hooks in and changes the output, my change makes sure it hook ins ‘last’ incase your theme was doing the same a little earlier.

It looks like you have a custom theme so it depends on what your theme is doing as to wether or not the title can be easily changed.


sosfirstaid.ca

March 28, 2023 at 1:14 am

Hello
We have tried every possible way to change espresso_events meta title but its not changing. Could you please let us know from which plugin file it is coming so that we can change it?
Thanks


sosfirstaid.ca

March 28, 2023 at 1:17 am

Please refer to https://prnt.sc/wBTZMiHA_uxU


Tony

  • Support Staff

March 28, 2023 at 5:15 am

Could you please let us know from which plugin file it is coming so that we can change it?

As mentioned, this is not from Event Espresso it’s from your theme, we also don’t provide support for modifying core files (if indeed that would help here).

If you can send me a copy of your theme I’ll take a look and see if there is a filter available within it, however, our support does not cover modifications for other plugins/themes so if there isn’t a hook available you’ll need a custom template which is not something we provide within our standard support packages.

Viewing 6 reply threads

The support post ‘Archive Event Page Title Change’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso