• Resolved Anonymous User 4309634

    (@anonymized-4309634)


    I’m using this plugin here – https://www.regimentfitness.co.uk/eventspage/ (the page isn’t live yet so I’m still playing around with it).

    The plugin is great but the one issue I can’t solve is that the page title in the list view isn’t “Events” or “Events Page” as I have specified in the page I’ve created, but instead the page takes the title of the first event. I’m presuming that this is because the plugin doesn’t actually use an existing page but rather creates one so there is actually no page title specified. There must be a way to change this but I can’t find anywhere in the template files!

    Would appreciate some help.

    Thanks

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

Viewing 15 replies - 1 through 15 (of 33 total)
  • I′m having the same problem.
    https://flamencobrasil.com.br/agenda/

    Unfortunately there’s no easy way to do this. Depending on what theme you’re using you’ll need to figure out how to filter the page title and then conditionally change the title using:

    tribe_is_month() – to detect when you’re viewing the calendar grid

    and

    tribe_is_event() && !tribe_is_day() && !is_single() – to detect when you’re viewing the events list.

    Hopefully that helps.

    Thread Starter Anonymous User 4309634

    (@anonymized-4309634)

    That all seems a bit longwinded for a php novice!

    In the end I just modified the page title code in my main page template to check for the events page id so that I could hard code the “Events” title into just that page. Unfortunately that means that the page title for each individual event is still “Our Events” as on the main page.

    <?php if (is_page('472')) { ?>
    <h1>Our Events</h1>
    <? } else { ?>
    <h1><?php the_title(); ?></h1>
    <?php } ?>

    Is there really not a better, easier way to do this?! Got to say it’s a glaring hole in an otherwise great plugin.

    Thanks for the feedback, chloej. We’ve had a number of requests similar to yours since launching 2.0, so it’s quite likely this will be changing for a future release (2.1 or later). Apologies for the inconvenience in the interim.

    <?php if(tribe_is_upcoming()){ ?>
    <h1 class="home">Upcoming events</h1>
    <?php }elseif(tribe_is_past()){ ?>
    <h1 class="home">Past events</h1>
    <?php } ?>

    This will work nicely on list.php

    Here’s the stack of conditional blocks for most all the event based pages that should help:

    if(tribe_is_month()) {
        echo 'Calendar Grid';
    } else if(tribe_is_event() && !tribe_is_day() && !is_single()) {
        echo 'Event List';
    } else if(tribe_is_event() && !tribe_is_day() && is_single()) {
    	echo 'Single Event';
    } else if(tribe_is_day()) {
        echo 'Single Day';
    } else {
    	the_title();
    }

    Thanks for the above code, worked like a charm!

    Excellent to hear that did the trick, metalmusicman. If you need anything else down the road please let us know and we’ll do what we can to help. Thanks for your support & using the plugin!

    Hi @roblagatta I don’t think i get it yet ??

    In U-Design, the header file is controlling how the title is set. The code for page-title looks like:

    <div id="page-content-title">
    		<div id="page-content-header" class="container_24">
    		    <div id="page-title">
    <?php 			$post = $posts[0]; // Hack. Set $post so that the_date() works.
    			if (is_page()) : ?>
    			    <h1><?php the_title(); ?></h1>
    <?php			elseif ( is_single() ) : ?>
    			    <h1><?php the_title(); ?></h1>
    <?php			elseif (is_tax()) : /* If this is a taxonomy archive */
    			    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );  ?>
    			    <h1 class="pagetitle"><?php echo ucwords( $term->taxonomy ) . ': ' . $term->name; ?></h1>
    <?php			elseif (is_category()) : /* If this is a category archive */ ?>
    <?php                       if ($udesign_options['show_archive_for_string'] == 'yes') : ?>
                                    <h1 class="pagetitle"><?php single_cat_title("", true); ?></h1>
    <?php                       else : ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for the ‘%s’ Category', 'udesign' ), single_cat_title("", false) ); ?></h1>
    <?php                       endif; ?>
    <?php			elseif (is_search()) : /* If this is a search results page */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Search Results for ‘<em>%s</em>’', 'udesign' ), get_search_query() ); ?></h1>
    <?php			elseif (is_404()) : /* If this is a 404 page */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Page Not Found (Error 404)', 'udesign'); ?></h1>
    <?php			elseif( is_tag() ) : /* If this is a tag archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Posts Tagged ‘%s’', 'udesign' ), single_tag_title("", false) ); ?></h1>
    <?php			elseif (is_day()) : /* If this is a daily archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_date() ); ?></h1>
    <?php			elseif (is_month()) : /* If this is a monthly archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('F Y') ); ?></h1>
    <?php			elseif (is_year()) : /* If this is a yearly archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('Y') ); ?></h1>
    <?php			elseif (is_author()) : /* If this is an author archive */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Author Archive', 'udesign'); ?></h1>
    <?php			elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : /* If this is a paged archive */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Blog Archives', 'udesign'); ?></h1>
    <?php			else : // the case when a Title is NOT present the height should be maintained ?>
    			    <div class="no-title-present"></div>
    <?php			endif; ?>
    		    </div>

    Where do add the check to be able to set the Events Page Title? I don’t think I can use the tribe() functions because the variables for tribe are not set in an order where they can be parsed? Am I thinking about this incorrectly?

    Same problem here. The Events Calendar doesn’t seem to like U-Design. ??

    Tried to get the code into the above mentioned header.php but it doesn’t work.

    Hi all, you could do something like this:

    [89 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Hi, I love the plug in and managed to edit a lot of it without needing help, but there is one thing I am stumped on:
    on the main list page, I need the default “Upcoming Events” title to not show as I am using the plug in for Special Offers (on a accommodation website), so wanted to rename everything with the term “Event” to “Offer” – I used the above thread to add my own title but the default one is still showing – is there an easy way to remove it?
    You can see what I mean on my site here:
    https://britishholidaysdirect.com/special-offers/

    PS I am not all that great with coding, slightly better than a novice so any answers – please make it easy for a newbie to understand!!!

    I have searched the code for “Upcoming Events” and can’t find it. I’d love to know where it lives!

    Nick Froome

    Hi britishholidaysdirect,
    I was able to change the page title for the main list view by editing line 637 in the-events-calendar.class.php which is located in the /lib directory.

    Bradley, you are an absolute diamond, thank you!!!!!!

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘[Plugin: The Events Calendar] Events Page Title’ is closed to new replies.