-
AuthorPosts
-
August 23, 2018 at 6:55 pm #1000882
Im trying to override this template single-events.php in my child theme.
When i try using the enfold file structure and the events cal structure none seem to work in the child theme.
I have added login and FTP.
I have added one line of code under the php call for the_content()
August 24, 2018 at 2:36 pm #1001252Hey acscreativenew,
Try copying config-events-calendar folder to your child theme.
Then add this php code in your child theme’s functions.php:define( 'AVIA_CHILD_BASE', get_stylesheet_directory() .'/' ); define( 'AVIA_CHILD_EVENT_PATH', AVIA_CHILD_BASE . 'config-events-calendar/' ); add_action('tribe_events_template', 'avia_events_tempalte_paths', 10, 2); function avia_events_tempalte_paths($file, $template) { $redirect = array('default-template.php' , 'single-event.php' , 'pro/map.php' ); if(in_array($template, $redirect)) { $file = AVIA_CHILD_EVENT_PATH . "views/" . $template; if( class_exists( 'Tribe__Tickets_Plus__Main' ) ) { if( 'single-event.php' == $template ) { $file = AVIA_CHILD_EVENT_PATH . 'views/single-event-no-mobile.php'; } } } return $file; }
Then go modify default-template.php inside config-events-calendar > views folder.
Hope this helps :)Best regards,
NikkoAugust 27, 2018 at 6:04 pm #1002391Hi,
So that worked but now all my styles are gone?
- This reply was modified 6 years, 2 months ago by acscreativenew. Reason: Add Image Link
August 28, 2018 at 9:05 am #1002595Hi acscreativenew,
I checked the code you changed and the styles are gone because some of the html tags/structure are removed which contains classes which are required for the styles defined in the css files to work properly.
Can you tell us what you are trying to achieve? probably a screenshot or mockup would help us visualize it and try to help with the code.Best regards,
NikkoAugust 28, 2018 at 3:34 pm #1002725Hi,
Trying to do a couple things. I would just like to get access to add ACF to the page. I would like the single page that you guys have created but just want to add my own code to it. When I first started messing with this I was just trying to override your single-events page template that comes with enfold. If i could get that page working but add my own code within that page thats what I would be looking for.
I dont really have anything to show for it. I was just want your template to load but the ability to add my own code and queries within it.
Hope this helps. In short just looking for a basic template override using most of the same code that is already on the template that comes with enfold.
Thanks
-DanAugust 29, 2018 at 2:59 pm #1003171Hi Dan,
I think it’s possible, just copy the same code from default-template.php then integrate some acf codes and that should work.
You might also need the conditional tags: https://codex.wordpress.org/Conditional_TagsBest regards,
NikkoAugust 29, 2018 at 11:41 pm #1003311So I did this but still a no go it seems like.
This is what I currently have in my child theme. (link below)
When I put any extra code on any of those pages it does not show up. If i add the same code to the files within the parent enfold page it does show up. So it seems my child theme overrides are still not taking.August 31, 2018 at 9:50 am #1003982Hi,
If you want to edit the single-event template you need to edit the single-event-no-mobile.php. I tested it in your child theme folder by replacing:
<?php the_title( ' <h2 class="tribe-events-single-event-title summary entry-title">', '</h2> ' ); ?>
with
<?php echo ' <h2 class="tribe-events-single-event-title summary entry-title">Test</h2> '; ?>
and the output changed. The event title was replaced with “Test”.
Best regards,
DudeFebruary 27, 2020 at 6:17 pm #1188540Hi Nikko,
Is this a typo or should this stay spelled as is?
add_action(‘tribe_events_template’, ‘avia_events_tempalte_paths’, 10, 2);
Best regards,
Steven
February 28, 2020 at 6:01 am #1188724Hi Steven,
Just spell it as is for now.
It’s clearly a wrong spelling in english but that’s the correct spelling of the function.
Thanks for noticing it, We’ll report it to our dev team. :)Best regards,
Nikko- This reply was modified 4 years, 9 months ago by Nikko.
-
AuthorPosts
- You must be logged in to reply to this topic.