Support » Plugin: The Events Calendar » “Archive” title on events page

  • Like so many others I have run into this annoying problem with the page title being “Archives” on my events page, instead of blank or anything I set it to.

    Have tried a bunch of suggestions in the forums, but none has worked so far. My theme is Spacious Pro.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’ve installed the free version of the Spacious template, not Pro, but this should work.

    You could use the theme customisation in your site admin, to turn off the header test altogether. But you might want to see it on some pages, so …

    You could create a child theme for Spacious, and put a function named “spacious_header_title” in there. It will override the same function that the template uses.

    Probably best to start by copying the function from spacious/inc/header-functions.php and then customising it to suit your purposes.

    If you simply add this to the top of the function, before any other code, it might do what you want.

    if (is_post_type_archive(‘tribe_events’)) {
    return ‘Our calendar’;
    }

    In other themes (e.g. twentytwenty), you can override the title using the get_the_archive_title() filter, but it seems that Spacious is different.

    Thread Starter goettel

    (@goettel)

    I tried adding below to functions.php, but it did not take away the title.

    if (is_post_type_archive(‘tribe_events’)) {
    return ‘Our calendar’;
    }

    As an alternative I am using the shortcode [tribe_events} on another page, but there the theme somehow inserts a big white gap before the listing, creating an estetic downside. Found a suggestion in adding custom css like below, but this only fixes the events page, which has the title “Archives”, so kind of got stuck in a catch 22.

    .post-type-archive-tribe_events #main {
    padding-top: 0px !important;
    }

    Appreciate any suggestion, since I am not all too techy.

    Sorry, I didn’t make it clear. You need to add *all* of the spacious-header-title function to your own functions.php, and then add in the bit of code I mentioned.

    Open up your themes/spacious/inc/header-functions.php file, and find the function “spacious-header-title”. It starts something like this:

    function spacious_header_title() {
    if ( is_archive() ) {
    if ( is_category() ) :
    $spacious_header_title = single_cat_title( ”, false );

    You *could* just add the code that I mentioned here, so that it would look like this. At least you would know whether the change works.

    function spacious_header_title() {
    if (is_post_type_archive(‘tribe_events’)) {
    return ‘Our calendar’;
    }
    if ( is_archive() ) {
    if ( is_category() ) :
    $spacious_header_title = single_cat_title( ”, false );

    But if you ever get a theme update, your change will be lost.

    So it’s better to copy *all* of the spacious_header_title function and paste it into your own functions.php, and *then* add in the custom code. You need to copy from the function statement right down to (and including) the “}”, just after where it says “return $spacious_header_title;”

    As I say, I only have the free version of Spacious so it might be a little different in the Pro version.

    It’s also disappointing to see that Spacious doesn’t have many filters that allow you to change things like the page title.

    One other suggestion, if you are willing to change the file in the theme.

    Open up themes/spacious/inc/header-functions.php. Find the line that reads:
    return $spacious_header_title;

    Change that line so that it reads:
    return apply_filters('filter_spacious_title', $spacious_header_title);

    Now in your own functions.php file, add this code:

    add_filter ('filter_spacious_title', 'my_spacious_header_title');
    function my_spacious_header_title ($title) {
        if (is_post_type_archive('tribe_events')) {
            return 'Our calendar';            
        }
        return $title;
    }

    This is probably easier than the other methods, but it does mean that you would need to change the theme file again after any theme updates.

    Perhaps one day, Spacious will add a similar filter themselves. You might want to suggest that on their support forum, because it’s not really an Events Calendar issue.

    https://wordpress.org/support/theme/spacious/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Archive” title on events page’ is closed to new replies.