Home › Forums › Calendar Products › Events Calendar PRO › New Template (not override)
- This topic has 4 replies, 3 voices, and was last updated 7 years, 1 month ago by Chad.
-
AuthorPosts
-
March 28, 2017 at 8:19 am #1260814ChadParticipant
Hello,
I am attempting to create a template to contain a print-friendly version of a list view of my calendar. My list view also contains a few custom fields using (ACF) and I want it to only display a specific week.
Note: I do not want to override an existing template. I want to create a new one.
My approach was:
1) copy src/views/list/* to my-child-theme/tribe-events/list-print/ directory.
2) create a new standard WordPress template, moving the content from src/views/list/content.php into WordPress template, and changing all instances of tribe_get_template_part so thattribe_get_template_part( 'list/nav', 'header' )
becomes
tribe_get_template_part( 'list-print/nav', 'header' )
The page is displaying the basic event information, but the venue information doesn’t seem to be populating.
I’m wondering:
1) what is the correct way to create a WordPress template (not page or post) that contains a list view which I can style for print and
2) if there is a better way of accomplishing this?BTW – I first attempted shortcodes but they don’t use my ACF fields and are limited in filtering options.
Thanks for your help!
March 29, 2017 at 10:35 am #1261594VictorKeymasterHiĀ Chad!
Thanks for reaching out to us! š
While our āTerms of ServiceāĀ doesnāt allow us to do customizations, we do like helping out and at least point users into the right direction. That said, let me try to help you with this.
what is the correct way to create a WordPress template (not page or post) that contains a list view which I can style for print and
You could start by creating a new template page for your themeĀ and thenĀ construct a custom query of events in it, either usingĀ tribe_get_events() as the basis of the query, or the default WordPress get_posts() function in which you would make a calle for theĀ tribe_events post type
Additionally, there is a good article on creating print styles for WordPress here >Ā https://codex.wordpress.org/Styling_for_Print
I hope that helps. Let me know if any other questions.
Best!
Victor
March 29, 2017 at 12:38 pm #1261675ChadParticipantThanks Victor. tribe_get_events() is definitely the easy way to go. Looks like it hooks into the WP post data as well – I was able to pull my ACF in the loop.
Thanks!
March 29, 2017 at 1:49 pm #1261723VictorKeymasterHey Chad!
That’s great! I’m super happy you could work it out š Thanks for coming back and lettingĀ us know about it.
I’ll close this thread now but please feel free to open a new one if any other questions.
Good luck with your project!
Victor
-
AuthorPosts
- The topic ‘New Template (not override)’ is closed to new replies.