Page title on all past events says: "Upcoming Event"

Home Forums Calendar Products Events Calendar PRO Page title on all past events says: "Upcoming Event"

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1084505
    Johan
    Participant

    Hello, all my old past events have a page title that begins with “Upcoming Event”.
    That might be very confusing fot the visitor and when sharing it and so on.
    Is there a way to change this?

    “Kommande evenemang” = “Upcoming events” in swedish
    link to an old event below

    #1084895
    Hunter
    Moderator

    Hey Johan,

    Welcome back to the forums.

    Does the issue still occur when reverting back to the default theme as outlined in our Testing for conflicts article? If you’re using Yoast SEO, this is another article worth reading.

    Thanks for the post and I look forward to hearing back. Have a good one!

    #1084899
    Johan
    Participant

    Hello Hunter!

    Yes, I changed to Twenty Fifteen Theme and the problem was the same.
    Here is a link to an event that has passed that says Upcoming Event in Swedish = Kommande evenemang

    http://hectornado.se/sv/evenemang/hertha-hillfon-skalen-mitt-mantra/

    #1085283
    Hunter
    Moderator

    Hello and thanks for the response,

    I visited the link and did see the title issue as described. Would you mind sharing your System Information as a private reply?

    Unfortunately, this type of support extend beyond the scope we’re able to provide through our support forum as we don’t have any logged bugs of users experiencing the same issue. I’m also unable to reproduce the issue on my test environment using the latest versions of our plugins and the default WP theme.

    With that said, I’d be happy to take a quick look at your System Information and see if anything looks out of the ordinary. Thanks again for keeping me updated and have a good weekend!

    #1085285
    Johan
    Participant

    This reply is private.

    #1085300
    Johan
    Participant

    Just want to add…
    I tested to inactivate ALL plugins except for The Events Calendar (not even PRO) and switching to defaut WP theme. And the problem remains I’m afraid. My client are bugging me about the importance of this so hope we can come up with some ideas. Thank you!

    #1085305
    Hunter
    Moderator

    Hey Johan,

    Check out this Knowledgebase article – it should help you out. Apologies for not finding it sooner. Let me know how it goes 🙂

    #1086308
    Johan
    Participant

    Hi Hunter.
    Hmm, will this really solve my issue? Isn’t it just for changing the wording?
    My past single events is labeled “Upcoming events” and if I change that to “Past events” it will change the titels of real upcoming events too – will it not? And in that case the Upcoming events will be titled Past events.

    My client is really on me on this so I must solve this problem I afraid…
    Hope to hear from you soon.

    #1086964
    Hunter
    Moderator

    Hello,

    Just to be clear – you are referring to SEO titles when you say titles, correct? With the information provided, you should be able to specify what you want for both past and upcoming events. Take a look at the snippet provided in the article and you’ll see what I mean.

    Best of luck 🙂

    #1087026
    Johan
    Participant

    Ah, okey,
    I will give it another shot and tell you how it goes.
    Thank you for your patience, Hunter.

    Have a nice day.
    ~ Johan

    #1087032
    Johan
    Participant

    Hi again, so i added this code below to functions.php.
    I can change the SEO titles but the problem remains the same. That past events is foe some reason using the same “code label” as upcoming events: $title_upcoming
    So you will have to help me alter the code below, so that the past single events pages are not labeled Upcoming events (Aktuella evenemang in Swedish) and at the same time remain the titles of upcoming singe events pages?

    
    <?php
    /*
     * Alters event's archive titles
     */
    function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) {
    	// Modify the titles here
    	// Some of these include %1$s and %2$s, these will be replaced with relevant dates
    	$title_upcoming =   'Upcoming Events'; // List View: Upcoming events
    	$title_past =       'Past Events'; // List view: Past events
    	$title_range =      'Events for %1$s - %2$s'; // List view: range of dates being viewed
    	$title_month =      'Events for %1$s'; // Month View, %1$s = the name of the month
    	$title_day =        'Events for %1$s'; // Day View, %1$s = the day
    	$title_all =        'All events for %s'; // showing all recurrences of an event, %s = event title
    	$title_week =       'Events for week of %s'; // Week view
    	// Don't modify anything below this unless you know what it does
    	global $wp_query;
    	$tribe_ecp = Tribe__Events__Main::instance();
    	$date_format = apply_filters( 'tribe_events_pro_page_title_date_format', tribe_get_date_format( true ) );
    	// Default Title
    	$title = $title_upcoming;
    	// If there's a date selected in the tribe bar, show the date range of the currently showing events
    	if ( isset( $_REQUEST['tribe-bar-date'] ) && $wp_query->have_posts() ) {
    		if ( $wp_query->get( 'paged' ) > 1 ) {
    			// if we're on page 1, show the selected tribe-bar-date as the first date in the range
    			$first_event_date = tribe_get_start_date( $wp_query->posts[0], false );
    		} else {
    			//otherwise show the start date of the first event in the results
    			$first_event_date = tribe_event_format_date( $_REQUEST['tribe-bar-date'], false );
    		}
    		$last_event_date = tribe_get_end_date( $wp_query->posts[ count( $wp_query->posts ) - 1 ], false );
    		$title = sprintf( $title_range, $first_event_date, $last_event_date );
    	} elseif ( tribe_is_past() ) {
    		$title = $title_past;
    	}
    	// Month view title
    	if ( tribe_is_month() ) {
    		$title = sprintf(
    			$title_month,
    			date_i18n( tribe_get_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) )
    		);
    	}
    	// Day view title
    	if ( tribe_is_day() ) {
    		$title = sprintf(
    			$title_day,
    			date_i18n( tribe_get_date_format( true ), strtotime( $wp_query->get( 'start_date' ) ) )
    		);
    	}
    	// All recurrences of an event
    	if ( function_exists('tribe_is_showing_all') && tribe_is_showing_all() ) {
    		$title = sprintf( $title_all, get_the_title() );
    	}
    	// Week view title
    	if ( function_exists('tribe_is_week') && tribe_is_week() ) {
    		$title = sprintf(
    			$title_week,
    			date_i18n( $date_format, strtotime( tribe_get_first_week_day( $wp_query->get( 'start_date' ) ) ) )
    		);
    	}
    	if ( is_tax( $tribe_ecp->get_event_taxonomy() ) && $depth ) {
    		$cat = get_queried_object();
    		$title = '<a href="' . esc_url( tribe_get_events_link() ) . '">' . $title . '</a>';
    		$title .= ' › ' . $cat->name;
    	}
    	return $title;
    }
    add_filter( 'tribe_get_events_title', 'tribe_alter_event_archive_titles', 11, 2 );
    • This reply was modified 10 years, 2 months ago by Johan.
    #1087172
    Hunter
    Moderator

    Hi and welcome back,

    Try altering the following line:

    $title_past = 'Past Events'; // List view: Past events

    Additionally, try reverting back to the default WP theme to see if the changes work (you’ll also need to add the code the the default WP theme’s functions.php file).

    I tested against the Twenty Sixteen theme and was able to get the past events title to change based on what I entered in the provided snippet.

    I do want to emphasize that this is as much support as I’ll be able to provide as you are in need of custom theme support which we’re unable to provide. With that said, best of luck getting everything set up properly and for choosing PRO 🙂

    #1087187
    Johan
    Participant

    Hello, your code makes no difference on past single events pages.
    But however if I change THIS line instead:
    $title_upcoming = 'XXXXX'; // List View: Upcoming events

    …THEN the SEO titles on past single events pages change to XXXXX AND the Upcoming events change to XXXXX also. There you have the problem and this is what I have been trying to explain the last three four posts or so. Please read on…

    And I just found out that you have the same problem on your own demo??
    Please look at the link of your own past single event page below (it’s the same on all of them). The SEO title says Upcoming event.
    So, my conclusion is that this has been a bug in TEC all along and not just an issue on my site? Is this correct?

    Or how do you explain the problem in the demo?
    LINK:
    http://wpshindig.com/event/writespeakcode-work-night/2016-03-03/

    Respectfully,
    ~ Johan

    #1087285
    Hunter
    Moderator

    Hi and thanks for the response,

    I’m not involved with the demo site (admittedly, it appears it could use some updating) – and as I said, I’m unable to reproduce the issue on my local environment. One recommendation would be to install an SEO plugin so you have better control over your event titles (I use Yoast’s WordPress SEO, see screenshot of past event on my local environment below).

    I’ll bring up this conversation to the other team members and the product developers for insight on how we can improve how our plugin handles SEO titles. We are always looking to enhance the performance and experience for everyone involved.

    Thank you again for the patience and detailed responses throughout our interaction. Best of luck and enjoy your day.

    #1087293
    Johan
    Participant

    Thank you for understanding.
    Your Yoast idea did the trick. Now there are no addition of Upcoming events or Past events text on ANY single event page. Just the title of the event – and that is just fine.

    So to sum i up. The core problem was not that the SEO title wrongly said Upcoming events on past single events pages – the problem was that it should not be there at all.
    This text should only be shown in list view pages and not on singel event pages over all?
    Isn’t that right?

    • This reply was modified 10 years, 2 months ago by Johan.
Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Page title on all past events says: "Upcoming Event"’ is closed to new replies.