Home › Forums › Ticket Products › Event Tickets Plus › how to use shortcode with php?
- This topic has 7 replies, 6 voices, and was last updated 9 years, 4 months ago by
Devon Morris.
-
AuthorPosts
-
November 11, 2016 at 4:59 am #1190829
Devon Morris
Participanthow to use this below shortcode with php?
[tribe_events view=”list” tribe-bar=”false” category=”DFW Metroplex]November 11, 2016 at 5:15 am #1190841Gergana
ParticipantHi Devon,
It can be done by using the wordpress function do_shortcode. I am providing you an example of how I’ve implemented a “Smart Countdown FX”s shortcode into the single_event.php.
<?php $start_event_date_event = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' ); if ( !empty($start_event_date_event = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' ) ) ) { echo do_shortcode( '[smartcountdown deadline="' .$start_event_date_event. '" fx_preset="Sliding_text_fade.xml" digits_style="font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;font-weight:bold;" labels_size="19" title_before_down="Време до Началото" widget_style="text-align:center;" mode="countdown" units="days,hours,minutes,seconds"]' ); } ?>It is working with me.
-
This reply was modified 9 years, 5 months ago by
Gergana. Reason: inputing it into code
November 11, 2016 at 6:02 am #1190860Devon Morris
ParticipantHi Gergana,
actually i want to use this code in my custom homepage and plz send me this code only.
November 11, 2016 at 6:36 am #1190866Devon Morris
Participantcan i use single-event.php all code to my custom homepage? i want to create page like attached file below.
November 13, 2016 at 9:21 am #1191613Cliff
MemberHi Devon. Thanks for your question. A few separate things to note here:
1)
Gergana offered a great snippet just as an example how to execute your shortcode within PHP. Her answer is correct that you would use do_shortcode(), just like she demonstrated. Thanks, Gergana!
However, it sounds like your initial question wasn’t exactly what you were after, which is okay. 🙂
2)
Our tribe_events shortcode does not currently support the “category” argument/parameter/option, which is why it’s not working for you as expected. This functionality is on our to-do list for the future.
I’ve marked this thread to receive a reply once this functionality is released. I cannot guarantee when it will be, as it’s in development.
I appreciate your understanding and patience on this issue.
3)
I appreciate your question and the desire to customize it for your use. However, we cannot provide such in-depth customization help, per our Scope of Support / Terms.
It sounds like you’re looking to make a customization of the archive/loop of events, for which you should use template overrides, documented in our Themer’s Guide, instead of a shortcode.
Once yoursite/events/list looks how you want it to look, then implement the shortcode on your homepage if that’s where you want to display your events.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
Thank you.
November 16, 2016 at 5:42 pm #1193608George
ParticipantHello!
I wanted to inform you that we’ve just published a series of updates to our products that fixes a number of issues.
Full category support for the [tribe_events] shortcode is included in these updates! 😀
Learn more about this release—version 4.3.3—in the official release notes here → https://theeventscalendar.com/maintenance-release-events-calendar-4-3-3-event-tickets-4-3-3-premium-plugins/
Thanks for your patience while we fixed this!
GeorgeDecember 8, 2016 at 8:35 am #1203206Support 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 -
This reply was modified 9 years, 5 months ago by
-
AuthorPosts
- The topic ‘how to use shortcode with php?’ is closed to new replies.
