chloej
Member
Posted 4 months ago #
I'm using this plugin here - http://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
http://wordpress.org/extend/plugins/the-events-calendar/
luizamcf
Member
Posted 4 months ago #
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.
chloej
Member
Posted 4 months ago #
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.
roblagatta
Member
Posted 4 months ago #
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();
}
metalmusicman
Member
Posted 2 months ago #
Thanks for the above code, worked like a charm!
roblagatta
Member
Posted 2 months ago #
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!