• Resolved amsgator

    (@amsgator)


    Since the plugin doesn’t create an actual page, my calendar is displaying the “page” title as ” | My Site”

    How can I change this to “Calendar | My Site”?

    Everything I’m finding on the forums is about changing the calendar “title” which is actually a heading. I need to change the actual title, i.e. what is displayed in the <head> between the <title> and </title> tags.

    I’ve tried everything I can find in the documentation pertaining to editing functions.php and nothing is working.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @amsgator,

    Thanks for reaching out! This Knowledgebase article should provide the code you need to modify the browser title for your calendar views–did this snippet fail to address the issue for you? Let us know, and we’ll be glad to investigate further.

    Thank you!

    Best,
    Caroline

    Thread Starter amsgator

    (@amsgator)

    I copied and pasted the snippet into my functions.php file, changed the titles in quotes to what I wanted and nothing changed. I tried clearing cached, etc and still no change.

    The URL in question is https://dev07.gnvwebdesign.com/calendar/ and the snippet I used in the functions file is (already has php tags in file)

    /**
     * Defines alternative titles for various event views.
     *
     * @param  string $title
     * @return string
     */
    
    function filter_events_title( $title ) {
    	// Single events
    	if ( tribe_is_event() && is_single() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Single venues
    	elseif ( tribe_is_venue() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Single organizers
    	elseif ( tribe_is_organizer() && is_single() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Month view Page
    	elseif ( tribe_is_month() && !is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Month view category page
    	elseif ( tribe_is_month() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// List view page: upcoming events
    	elseif ( tribe_is_upcoming() && ! is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// List view category page: upcoming events
    	elseif ( tribe_is_upcoming() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// List view page: past events
    	elseif ( tribe_is_past() && !is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// List view category page: past events
    	elseif ( tribe_is_past() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Week view page
    	elseif ( tribe_is_week() && ! is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Week view category page
    	elseif ( tribe_is_week() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Day view page
    	elseif ( tribe_is_day() && ! is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Day view category page
    	elseif ( tribe_is_day() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Map view page
    	elseif ( tribe_is_map() && ! is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Map view category page
    	elseif ( tribe_is_map() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Photo view page
    	elseif ( tribe_is_photo() && ! is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	// Photo view category page
    	elseif ( tribe_is_photo() && is_tax() ) {
    		$title = 'North Central Florida Safety Council | Calendar';
    	}
    	return $title;
    }
    /**
     * Modifes the event <title> element.
     *
     * Users of Yoast's SEO plugin may wish to try replacing the below line with:
     *
     *     add_filter('wpseo_title', 'filter_events_title' );
     */
    
    add_filter( 'tribe_events_title_tag', 'filter_events_title' );

    Hey there!

    I tried using the snippet you provided in your last reply and it seemed to do the trick on my test site:

    Screen Shot 2017 01 10 at 9 48 25 AM

    Os there perhaps a conflict with your theme? My test site uses the default WordPress Twenty Sixteen theme, so let’s try that and see if it works. ??

    Cheers!
    Geoff

    Hi there,

    Looks like it’s been a few weeks or more since we’ve seen activity on this thread! I’m going to go ahead and mark this resolved, but should you still need assistance, please don’t hesitate to open a new thread!

    You may also find the following documentation helpful to search in the future:

    TEC Knowledgebase
    TEC Technical Documentation

    Cheers,

    Shelby ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Updating Title In Head’ is closed to new replies.