• Resolved kepa37

    (@kepa37)


    Hi. Sorry for my english, polish native here.
    In my callendar I have month view setting used as default. On every month there is a topic, for examplpe “Events to March 2015”. Of course there is a localisation for my language (for wp and for events calendar), but the month page title shows month name with capital letter (March). This is a mistake in polish, also we have fked up grammar and whole sentence is wrong, whitch I won’t explain, it would take a few lines to describe it.

    To the point: I would like to remove “Events to” from the title. If I’ll leave only month and year, everything would be ok.

    Thanks in advance

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kepa37

    (@kepa37)

    EDIT: I investigated for half an hour and think I have to change following code in plugin dir/src/functions/template-tags/loop.php

    /**
    	 * Event Title
    	 *
    	 * Return an event's title with pseudo-breadcrumb if on a category
    	 *
    	 * @param bool $depth include linked title
    	 *
    	 * @return string title
    	 * @todo move logic to template classes
    	 */
    	function tribe_get_events_title( $depth = true ) {
    		$events_label_plural = tribe_get_event_label_plural();
    
    		global $wp_query;
    
    		$tribe_ecp = Tribe__Events__Main::instance();
    
    		$title = sprintf( __( 'Upcoming %s', 'the-events-calendar' ), $events_label_plural );
    
    		// 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() ) {
    			$first_returned_date = tribe_get_start_date( $wp_query->posts[0], false, Tribe__Events__Date_Utils::DBDATEFORMAT );
    			$first_event_date    = tribe_get_start_date( $wp_query->posts[0], false );
    			$last_event_date     = tribe_get_end_date( $wp_query->posts[ count( $wp_query->posts ) - 1 ], false );
    
    			// If we are on page 1 then we may wish to use the *selected* start date in place of the
    			// first returned event date
    			if ( 1 == $wp_query->get( 'paged' ) && $_REQUEST['tribe-bar-date'] < $first_returned_date ) {
    				$first_event_date = tribe_event_format_date( $_REQUEST['tribe-bar-date'], false );
    			}
    
    			$title = sprintf( __( '%1$s for %2$s - %3$s', 'the-events-calendar' ), $events_label_plural, $first_event_date, $last_event_date );
    		} elseif ( tribe_is_past() ) {
    			$title = sprintf( __( 'Past %s', 'the-events-calendar' ), $events_label_plural );
    		}
    
    		if ( tribe_is_month() ) {
    			$title = sprintf(
    				__( '%1$s for %2$s', 'the-events-calendar' ),
    				$events_label_plural,
    				date_i18n( tribe_get_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) )
    			);
    		}

    any ideas?

    Thread Starter kepa37

    (@kepa37)

    Ok. I found a good way to push myself to deal with such problems. I have to write it on the forum, then I’m somehow able to think clearly and find a solution.

    just needed to remove

    %1$s for

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong title in month view’ is closed to new replies.