Home › Forums › Calendar Products › Events Calendar PRO › Silly newbie question about themer’s guide
- This topic has 5 replies, 2 voices, and was last updated 8 years, 11 months ago by
cyrilsack.
-
AuthorPosts
-
April 10, 2017 at 6:56 pm #1268006
cyrilsack
ParticipantHi folks,
I’m dipping my toe into making adjustments to my Events Calendar templates, but I’m already struggling. I’m trying to implement the simple example given in the themer’s guide of inserting the event organizer under each event’s title. Here’s the code I put into a copy of single-event.php:
<!– Event content –>
<?php do_action( ‘tribe_events_single_event_before_the_content’ ) ?>
<div class=”tribe-events-single-event-description tribe-events-content”>
<?php the_content(); ?>
</div>
<!– .tribe-events-single-event-description –>
<?php do_action( ‘tribe_events_single_event_after_the_content’ ) ?>Organized by: <?php echo tribe_get_organizer(); ?>
<!– Event meta –>
<?php do_action( ‘tribe_events_single_event_before_the_meta’ ) ?>
<?php tribe_get_template_part( ‘modules/meta’ ); ?>
<?php do_action( ‘tribe_events_single_event_after_the_meta’ ) ?>
Does the location of the code seem correct?Secondly, once the code is correct, what tells the Events Calendar to check the new folder in my child theme instead of just defaulting to the plugin template? What makes it go to themes/make-child/events-calendar/single-event.php instead of plugins/events-calendar/src/views/single-event.php?
Thanks for any help provided!
April 11, 2017 at 6:50 am #1268196Geoff
MemberHi @cyrilsack,
Thanks for getting in touch!
The code you provided looks good. What I did notice, however, is that the template you are overriding should be here:
[your-theme]/tribe-events/single-event.php…instead of:
[your-theme]/events-calendar/single-event.phpThe Events Calendar is always looking for a folder called “tribe-events” in the active theme and knows to use the templates in that folder before the ones included in the plugin by default.
Cheers!
GeoffApril 11, 2017 at 7:19 pm #1268630cyrilsack
Participantthanks Geoff! I’ve got the single-event.php file in the tribe-events subfolder, but it still doesn’t seem to change the display on site.
April 12, 2017 at 6:25 am #1268772Geoff
MemberHey there, @cyrilsack!
Hmm, that’s pretty odd. The override seems to work when I try it out on my test site.
Here’s the full code for the single-event.php file I used in my test:
https://gist.github.com/geoffgraham/7a82b0d75b7edbaae410083a76dc2446
Try copying and pasting that into your template and making sure that the template is located in the correct folder: [your-theme]/tribe-events/single-event.php
That code should add the name of the event organizer below the title of the event when viewing the event post. Here’s a screenshot of how that looks on my test site.
Hopefully that does the trick. 🙂
Cheers!
GeoffMay 4, 2017 at 9:35 am #1278602Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Silly newbie question about themer’s guide’ is closed to new replies.
