Home › Forums › Calendar Products › Events Calendar PRO › Calendar page title shows title of an event (continued)
- This topic has 16 replies, 3 voices, and was last updated 8 years, 9 months ago by Support Droid.
-
AuthorPosts
-
August 26, 2012 at 9:18 pm #24137GeraldParticipant
My Calendar page title shows title of the next upcoming event instead of “Calendar of Events” – as reported by other uses, e.g. in this closed thread: https://theeventscalendar.com/support/forums/topic/calendar-page-title-shows-title-of-an-event-and-wont-change/#post-19270
I’ve read Jonah’s reply, but am not exactly sure how to fix it in my specific situation:
(1) My ECP Template Settings: default page template (WordPress). (I have to use that setting because the default Events template would not display my events calendar in a reasonble way)
(2) the_title() is executed in page.php of my Theme:
?php $page_title = ss_framework_get_custom_field(‘ss_page_title’) ? ss_framework_get_custom_field(‘ss_page_title’) : get_the_title(); ?Now, I’ve also seen Jonah’s conditional wrappers code. I tried to add that to the page.php file, but it didn’t make any difference. It’s the first time I am hard coding with my site, so chances are good there is a mistake on my side. Would you be so kind and specify what exactly I need to do?
I guess, my first step is to make a copy of original page.php file of my theme and place it under my “childtheme” folder. What’s next?
Thanks in advance!
August 28, 2012 at 11:52 am #24235JonahParticipantHi Philipp,
The instructions are different from theme to theme but yes if you have a child theme, you’ll want to first make a copy of page.php and then use the conditional code to override the display of the title in the template. So as an example if this is what you have:
$page_title = ss_framework_get_custom_field(‘ss_page_title’) ? ss_framework_get_custom_field(‘ss_page_title’) : get_the_title(); ?
You would want to replace it with something like this:
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
echo 'Events Calendar';
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
echo 'Events Calendar';
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
echo 'Events List';
} else {
$page_title = ss_framework_get_custom_field(‘ss_page_title’);
ss_framework_get_custom_field(‘ss_page_title’) : get_the_title();
}
Looks like the code you pasted got a little chopped up but hopefully that gives you the right idea…Cheers,
JonahAugust 29, 2012 at 12:48 pm #24304GeraldParticipantHi Jonah,
Thank you for the reply. I proceeded as suggested. My code in the page.php file now looks as follows: http://d.pr/i/m1cE
Unfortunately, that wasn’t succesful. The whole site returns an erroe due to wrongly configured coding. Can you kindly advise further, Jonah? Anything wrgong in my code?
Thank you,
PhilippAugust 29, 2012 at 1:00 pm #24305GeraldParticipantJonah,
My next question is probable related to the same (at least similar) issue. When I click on the details of a specific event in the frontend, I two navigation links show up at the bottom screen which list again the titles of the prvevious event (left side) and next event (right side). Here’s the screenshot: http://d.pr/i/WKJv
Instead of the event titles, I guess the right behavior would be to show “previous event” and “next event” – am I right? If yes, can you advise on where I need to adapt this kind of code?
Thanks you very much.
Philipp
August 29, 2012 at 1:21 pm #24308JonahParticipantHi Philipp,
Can you please post the stock contents of your page.php file without any changes?
To answer your other question about the links at the bottom of single events, you can easily change this by making a copy of /wp-content/plugins/the-events-calendar/views/single.php and placing in an ‘events’ folder in your theme and then modifying the template tags on lines 109 & 111 so it looks like so:
tribe_previous_event_link('Prev');
tribe_next_event_link('Next');
I hope that helps but let me know if you need anything else.– Jonah
August 31, 2012 at 8:40 am #24398GeraldParticipantHi Jonah,
I greatly appreciate your reply. My second question was indeed very easy to solve. It worked! Thank you so much.
Back to my main question: What is really the best way to share larger code snippets? I would love hear how you create these yellow boxed with code.
Alternatively, please let me know if you would be interested in receiving my page.php files (old and new one) via mail.
Thank you much.
PhilippAugust 31, 2012 at 9:49 am #24409GeraldParticipantUpdate: Here is my code on gist:
https://gist.github.com/3555712August 31, 2012 at 12:30 pm #24430JonahParticipantHi Philipp, I posted a comment on the Gist, please take a look, try it out and let me know if that works.
You can post code here in the forums but it’s temperamental and only recommended for short snippets. To do so just wrap whatever you want to highlight in < code > < / code > tags.
– Jonah
August 31, 2012 at 1:31 pm #24440GeraldParticipantHi Jonah,
We almost made it. “Events Calendar” now shows up. (It’s in English, so I’m sure I will yet find a way how to translate that into German, but that’s not the main problem). The new problem is, that the this title shows up in the wrong area. Not where the page headers 1 would normally show up. See this screenshot: http://d.pr/i/6U1W.
Do you know how we can solve that?
August 31, 2012 at 1:51 pm #24441JonahParticipantHi Philipp,
Just posted another update to the Gist that should work.
Cheers,
JonahAugust 31, 2012 at 2:34 pm #24443GeraldParticipantJonah, You’re the Man! It works perfectly now. I even found out how easy it is to adapt/translate the ‘Events Calendar’ and ‘Events List’ (I’ve almost overseen that in the code snippet itself). Great.
Now, I deeply apologize, but there is one more refinement we need. The ‘Events List’ tite now shows up for every category (instead of the category title itself). If we fix that, I think we’re done.
Really, this not urgent, Jonah. So enjoy your weekend and come back to me next week. Greatly appreciate your great help.
September 3, 2012 at 4:18 pm #24497JonahParticipantHi Philipp,
I just posted another update to account for categories in both the grid and list views. Please try it out and let me know whether or not it works for you.
Cheers,
JonahSeptember 3, 2012 at 9:25 pm #24502GeraldParticipantHi Jonah. Thanks for another post. Someting must be wrong with the code (color codings in my tool tell me so and the site would not not work). I did try your “correction” code.
Cheers,
PhilippSeptember 4, 2012 at 9:24 am #24525JonahParticipantHi Philipp, the correction code had issues. Try my latest correction.
Cheers,
JonahSeptember 5, 2012 at 9:26 pm #24608GeraldParticipantJonah, awesome. This works brilliantly! Thank you so very much!!!
-
AuthorPosts
- The topic ‘Calendar page title shows title of an event (continued)’ is closed to new replies.