Support

Home Forums Event Espresso Premium Specifying the title for the Events List

Specifying the title for the Events List

Posted: August 26, 2022 at 10:33 am

Viewing 10 reply threads


markolson68

August 26, 2022 at 10:33 am

I found in an earlier discussion that adding the following CSS would take out the title “Archives” from the Events List page.

.post-type-archive-espresso_events .page-title {
display:none;
}

This works great to remove that. I’m wondering how I would modify it so that that page would have the title of that page (e.g. Events or Courses) rather than having nothing.


Garth

  • Support Staff

August 26, 2022 at 1:22 pm

Do you have an example for us to look at?

Does your theme display the title of the page on archives pages? If I understand correctly, that’d be the easiest way to do it. Also, are you using the Event List settings? https://monosnap.com/file/hirzqOyv9oAAaqAG4LXbcJCfZR8Zns


markolson68

August 26, 2022 at 1:28 pm

Here’s the url. https://www.affinitywellnesseducation.com/courses/

I changed /events/ to /courses/

I am using the event list settings.

I used CSS code given before to take out the word “Archives”. I would like for it to say “Courses” or whatever I specify that /xxx/ to be.


Tony

  • Support Staff

August 30, 2022 at 10:34 am

Hi there,

The ‘Archives: {post_type}’ output is generated by WordPress when a theme uses the_archive_title() to output that text.

That function has a hook available to change the output so you can do all of the above using a snippet like this:

https://gist.github.com/Pebblo/25705b6b4fd3ad3f706330304fca62fb

That function simply returns whatever have been set as the event slug (default is ‘events’) with the first letter capitalized. So rather than ‘Archives: Events’ it will (in your case) just return ‘Courses’.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


markolson68

August 31, 2022 at 8:44 am

Thank you for this.
When I add the code from GitHub that you included above, the page says “Archives: Events” at the top, not “Courses”

To get rid of this, I have to put:
.post-type-archive-espresso_events .page-title {
display: none;
}

What do I need to do so it says “Courses” rather than “Archives: Events”?


Tony

  • Support Staff

August 31, 2022 at 1:22 pm

“Archives: Events”

Is the default output from WordPress so it sounds like that code isn’t running (or running to late).

My snippet pulls in whatever has been set as the event slug in Event Espresso -> Events -> Templates -> Event Slug.

That by default is just ‘events’ (but I’m assuming yours is ‘courses’) and returns that string with the first letter capitalized with no ‘Archives: ‘ prefix, which is why I don’t think that code is actually running.

Where did you add my snippet on the site?


markolson68

August 31, 2022 at 1:26 pm

I added it to the Custom CSS for the Theme. Adding other snippets in there has an impact on the site.


Tony

  • Support Staff

August 31, 2022 at 1:34 pm

The above snippet I gave you is not CSS, its PHP and can not be loaded via the above option.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


markolson68

August 31, 2022 at 1:35 pm

ah, i see… oops.


Tony

  • Support Staff

August 31, 2022 at 2:37 pm

Easily done 🙂

Add the above into a custom functions plugin should get it fixed up.


markolson68

September 2, 2022 at 9:06 pm

Working like a charm. Thank you.

Viewing 10 reply threads

The support post ‘Specifying the title for the Events List’ 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