Martin Taylor
Forum Replies Created
-
Thanks for confirming, @mikedaul . I’ve also seen that @stevehanlon has the same issue, and that the “Default Events Template” was the suggested solution.
https://wordpress.org/support/topic/event-blocks-not-showing/
Unfortunately, that’s not a good solution for me – that default events template is full width, for a start, and I’m not prepared to get into all the changes I’d need to do in order to make it work with my site. I need to use the default page template.
As I mentioned, this was not a problem in TEC 5.0.2.1, so something’s been broken in 5.0.3.1. I can only hope that someone at Modern Tribe is aware of the issue and can sort it out.
Following up on this – I have a test site with TEC 5.0.2.1 installed, so I tried enabling the Block Editor and updated an event. No problem – the event displays correctly on the front end.
I then updated TEC to 5.0.3.1, refreshed the front-end page, and now the event is displayed only with its title and a description paragraph 🙁 There’s no venue info, no organiser info, no date info. It’s presumably using that “silence” template, but I’ve not delved into the detail.
Looks like a bug has been introduced between 5.0.2.1 and 5.0.3.1.
For now I shall revert to 5.0.2.1 on my live site.
Forum: Plugins
In reply to: [The Events Calendar] “Archive” title on events pageOne other suggestion, if you are willing to change the file in the theme.
Open up themes/spacious/inc/header-functions.php. Find the line that reads:
return $spacious_header_title;Change that line so that it reads:
return apply_filters('filter_spacious_title', $spacious_header_title);Now in your own functions.php file, add this code:
add_filter ('filter_spacious_title', 'my_spacious_header_title'); function my_spacious_header_title ($title) { if (is_post_type_archive('tribe_events')) { return 'Our calendar'; } return $title; }This is probably easier than the other methods, but it does mean that you would need to change the theme file again after any theme updates.
Perhaps one day, Spacious will add a similar filter themselves. You might want to suggest that on their support forum, because it’s not really an Events Calendar issue.
Forum: Plugins
In reply to: [The Events Calendar] “Archive” title on events pageSorry, I didn’t make it clear. You need to add *all* of the spacious-header-title function to your own functions.php, and then add in the bit of code I mentioned.
Open up your themes/spacious/inc/header-functions.php file, and find the function “spacious-header-title”. It starts something like this:
function spacious_header_title() {
if ( is_archive() ) {
if ( is_category() ) :
$spacious_header_title = single_cat_title( ”, false );You *could* just add the code that I mentioned here, so that it would look like this. At least you would know whether the change works.
function spacious_header_title() {
if (is_post_type_archive(‘tribe_events’)) {
return ‘Our calendar’;
}
if ( is_archive() ) {
if ( is_category() ) :
$spacious_header_title = single_cat_title( ”, false );But if you ever get a theme update, your change will be lost.
So it’s better to copy *all* of the spacious_header_title function and paste it into your own functions.php, and *then* add in the custom code. You need to copy from the function statement right down to (and including) the “}”, just after where it says “return $spacious_header_title;”
As I say, I only have the free version of Spacious so it might be a little different in the Pro version.
It’s also disappointing to see that Spacious doesn’t have many filters that allow you to change things like the page title.
Forum: Plugins
In reply to: [The Events Calendar] “Archive” title on events pageI’ve installed the free version of the Spacious template, not Pro, but this should work.
You could use the theme customisation in your site admin, to turn off the header test altogether. But you might want to see it on some pages, so …
You could create a child theme for Spacious, and put a function named “spacious_header_title” in there. It will override the same function that the template uses.
Probably best to start by copying the function from spacious/inc/header-functions.php and then customising it to suit your purposes.
If you simply add this to the top of the function, before any other code, it might do what you want.
if (is_post_type_archive(‘tribe_events’)) {
return ‘Our calendar’;
}In other themes (e.g. twentytwenty), you can override the title using the get_the_archive_title() filter, but it seems that Spacious is different.
Forum: Plugins
In reply to: [The Events Calendar] Can’t edit single-event.phpIf you’re not using the block editor, then the single event template is at:
src/views/single-event.php
You override it by making a copy in:
[your-theme]/tribe-events/single-event.phpIf you are using the block editor, the template is at:
src/views/single-event-blocks.php
You override this by making a copy in:
[your-theme]/tribe/events/single-event-blocks.php
But you might only need to override one of the 7 or 8 sub-templates, which are in:
src/views/single-event/
You can override any or all of these by making copies in:
[your-theme]/tribe/events/single-event/Forum: Plugins
In reply to: [The Events Calendar] Venue description and featured imageA suggestion – you might need to copy the template for a venue to your theme, and add some code of this sort at the appropriate point:
$vobj = tribe_get_venue_object(tribe_get_venue_id());
$vimg = get_the_post_thumbnail(tribe_get_venue_id());
echo $vobj->post_content;
echo $vimg;I’m not aware of any built-in way to do this.
Forum: Plugins
In reply to: [Block Lab] Can priority of “init” actions be reduced (for taxonomies)?Just to report that while the change you’ve made is very welcome, it turns out that I still can’t reply on other plugins to register their taxonomies ahead of the block_lab_add_blocks hook.
I came across another today (The Events Calendar). I tried to use get_terms() to grab the list of event categories for a block field, but it didn’t return anything. The Events Calendar presumably registers its taxonomies too late.
No worries – I can use a WP Term Query to grab the values, which is probably what happens in get_terms() anyway.
Thanks, though 🙂
- This reply was modified 6 years, 3 months ago by Martin Taylor.
Forum: Plugins
In reply to: [The Events Calendar] Datepicker only works once (V5.1.0)Just to say that I’ve now been able to install WordPress on a test site at the root level rather than in a subdirectory. And at the root level, the datepicker does work OK. The URLs it generates are nice and neat, such as:
Default — http://mysite/events/
Navigate to March — http://mysite/events/month/2020-03/
Navigate to April — http://mysite/events/month/2020-04/When WP is installed in a subdirectory (as all of mine are), then the URL quickly becomes untidy and the datepicker stops working:
Default — http://mysite/myfolder/events/
Navigate to March — http://mysite/myfolder/?post_type=tribe_events&eventDisplay=month&eventDate=2020-03&page&name=myfolder
Navigate to April — no change, same URL, still shows March calendarForum: Plugins
In reply to: [Block Lab] Suggestion – publish list of Block Lab iconsThanks, @ryankienstra
Forum: Plugins
In reply to: [The Events Calendar] Datepicker only works once (V5.1.0)Still not working at version 5.0.2 🙁
Forum: Plugins
In reply to: [Block Lab] Can priority of “init” actions be reduced (for taxonomies)?Thanks, @ryankienstra
Forum: Plugins
In reply to: [The Events Calendar] Datepicker only works once (V5.1.0)I have discovered that it is caused by having WordPress installed in a subdirectory of your website. This seems to cause problems with the calendar rewriting rules.
Thanks for confirming (and @tegid too). I’d not connected it with the use of a subdirectory, so that’s useful info. Sadly, the live site where I have this plugin installed has WP in a subdirectory. My test sites are on my own PC on XAMPP, where I also use subdirectories, and the example via my link is (guess what) on a subdirectory.
The legacy views still work OK, so that’s my escape route for now. I’m looking forward to this being fixed, though.
By the way, I notice my typo in the subject line on this post. Should have said V5.0.1.
Forum: Plugins
In reply to: [Block Lab] Suggestion – Overriding template locationsOK, thanks @ryankienstra
Forum: Plugins
In reply to: [Block Lab] Suggestion – Overriding template locationsYes, I did mean a UI setting when I first posted this, but on reflection I think the filter is better. I’d not seen it until you mentioned it. Maybe I should learn to search this forum.
A follow-up question or two. Is the filter called each time a template is needed? And is the filter supplied with the name of the block whose templates are required? That second parameter looks like it should be the one, but it’s hard to tell.