• Resolved psenechal

    (@psenechal)


    Hello…I previously had some issues with my theme and page titles for The Events Calendar. I have successfully been able to modify my theme’s page titles using the examples here: https://theeventscalendar.com/knowledgebase/changing-the-browser-title-for-calendar-views/

    This works for a lot of the views, however, I’m finding that the logic for Single Events/Venues/Organizers does not seem to work and I’m getting an empty page title still. Can you let me know if the logic to identify these pages has changed?

    	// Single events
    	if ( tribe_is_event() && is_single() ) {
    		$title = 'Single event page';
    	}
    	// Single venues
    	elseif ( tribe_is_venue() ) {
    		$title = 'Single venue page';
    	}
    	// Single organizers
    	elseif ( tribe_is_organizer() && is_single() ) {
    		$title = 'Single organizer page';
    	}

    Thank you!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey there @psenechal!

    Thanks for reaching out!

    We don’t normally support theme customization here in the free forum, but I’ll be happy to point you in the right direction. ??

    I’d recommend making a copy of src/views/single-event.php. This file will need to be copied over to your theme directory (see Themer’s Guide). Once copied over, you can customize every aspect of your single event template.

    Hope that helps!

    Thread Starter psenechal

    (@psenechal)

    I was able to figure some of it out. You actually have to pass a post ID when using tribe_is_event(), tribe_is_venue(), and tribe_is_organizer().

    To do this, I added the following at the top of my function:

    global $wp;
    $url = home_url( $wp->request );

    then made the call like this:

    if ( tribe_is_event(url_to_postid( $url )) && is_single() )

    I can now send back a static page title…just need to see if I can get the post name instead and send that back.
    Thanks.

    • This reply was modified 6 years, 11 months ago by psenechal.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Title for Single Events/Venues/Organizers’ is closed to new replies.