mfn_page_title function using "The Events Calendar" title in headers

Within mfn_page_title() in theme-functions.php (line 1202) a check if the page is a "tribe" page is made.

This is causing an issue when an Events Calendar widget is in place on the page, as the conditions are met.

Can you please put this if statement further down?

From the attached spreadsheet, you can see the header within a Memberpress page showing a tribe heading.

You will see the events widget in the footer too.

Moving the tribe conditions to the last "elseif" before the regular "get_the_title" works.

function mfn_page_title($echo = false)
	{
		if (is_home()) {


			// blog
			$title = get_the_title(mfn_ID());

//Move from here
		}  elseif ( is_category() ) {


			$title = single_cat_title( '', false );


		} elseif ( is_tag() ) {


			$title = single_tag_title( '', false );


		} elseif ( is_author() ) {


			$title = get_the_author();


		} elseif ( is_year() ) {


			$title = get_the_time( 'Y' );


		} elseif ( is_month() ) {


			$title = get_the_time( 'F Y' );


		} elseif ( is_day() ) {


			$title = get_the_time( 'F j, Y' );


		} elseif ( is_post_type_archive() ) {


			$title = post_type_archive_title( '', false );


		} elseif ( is_single() || is_page() ) {


			$title = get_the_title(mfn_ID());


		} elseif (get_post_taxonomies()) {


			$title = single_cat_title('', false);

//TO HERE
		}elseif (function_exists('tribe_is_month') && (tribe_is_event_query() || tribe_is_month() || tribe_is_event() || tribe_is_day() || tribe_is_venue())) {


			// The Events Calendar
			$title = tribe_get_events_title();


		} else {


			$title = get_the_title(mfn_ID());


		}


		if ($echo) {
			echo wp_kses($title, mfn_allowed_html());
		}


		return $title;
	}



Comments

Sign In or Register to comment.