Caroline on "[Plugin: The Events Calendar] Headline is empty"

ساخت وبلاگ

Friederun Goellner
Member
Posted 4 days ago #

Hi,
I've got a theme with a nice headline bar displaying the_title(); before content and article. Using Tribe Events Calendar this bar remains empty. Because no page is used for display but basic standard template.
I would be fine if I could just say something like "if (the_title() == '') display 'Events' as headline in general. Else display the_title();" It does work with tribe Events but it doesn't work with pages. In pages the_title(); in the title bar is displayed as 'Events' and the page's title appears somewhere else beyond any context and format.
It doesn't work with "if (the_title() === '') display 'Events'" either. Then I do have the_title(); of posts and pages in the title bar but also beyond context and unformatted somewhere else as well.
Probably there is some conditional query to decide, whether a template is used for displaying tribe events or not?
Help would be much appreciated - thank you very much

https://wordpress.org/plugins/the-events-calendar/

Caroline
Member
Plugin Contributor

Posted 3 days ago #

Hi there!

Thanks for stopping by! It sounds like what you're looking for is a conditional to determine whether or not you're on an events page--we have a list of conditionals for The Events Calendar on GitHub that should hopefully get you started setting this up!

https://gist.github.com/jo-snips/2415009#file-events-conditional-wrappers-php

I hope that helps! Let us know if you should have any other questions!

Friederun Goellner
Member
Posted 2 days ago #

Hi Caroline
thanks for your help. The link was helpful to test different variations. After all I suppose it is more of a problem with that particular theme (fifteen by inkhive). For some reason the standard template used for pages retus 'true' (i.e. retuing 'events') with that code:
if (get_post_type() == 'page' && null !== tribe_is_event()){echo 'events';} else { the_title(); }
Again, it works with posts (the_title()) and Events Calendar ('events') and the other page templates (the_title()). To avoid that problem I set up no page with standard template. But if anybody creates a new (standard) page - it will be a problem.

Caroline
Member
Plugin Contributor

Posted 12 minutes ago #

Thanks for following up with some more information on this issue--glad you were able to narrow down the problem. Have you tried to reach out to the folks behind the theme? Maybe they are already aware of this and have a workaround or are preparing a fix. We’d love to be able to support you directly, but the theme author will be your best bet since they are much more familiar with their code than we are.

Let us know if there's anything else we can do to assist!

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 226 تاريخ : سه شنبه 1 تير 1395 ساعت: 7:18