Home › Forums › Ticket Products › Event Tickets Plus › How to add # of available tickets to event title?
- This topic has 2 replies, 3 voices, and was last updated 8 years, 2 months ago by Support Droid.
-
AuthorPosts
-
January 2, 2016 at 2:35 pm #1049144BrianParticipant
I’m trying to put the number of available event tickets into the title of my list & single event theme though I’m a bit uncertain as to what line of code I should place to show the available ticket #’s.
Any help is appreciated.
January 2, 2016 at 4:04 pm #1049153GeorgeParticipantHey Brian,
Custom coding is unfortunately not something we can help with 🙁
However, I would recommend simply diving into the plugin code for Event Ticket Plus itself and look for where the plugin itself shows the ticket count for a given event. If you then basically just “steal” this code, and copy and paste it into your own theme or a custom plugin, it should work well.
To be a tad more specific, what you could do with that code is apply it to the “the_title” filter within WordPress, which you can read about here: https://codex.wordpress.org/Function_Reference/the_title
That filter will apply the code to the titles of all events. So, something like this for example:
if ( function_exists( 'tribe_get_events' ) ) {
add_filter( 'the_title', 'tribe_support_1049144' );
function tribe_support_1049144( $title ) {
// Just return the normal title if this is not an event.
if ( ! tribe_is_event() ) {
return $title;
}// Here would be the code for retrieving ticket count etc.
return $title;
}
}
Are you confident enough in your coding abilities to take things from here? Let me know. We cannot help with customizations but I will try to make the time to assist more specifically if possible and/or if needed.
Sincerely,
GeorgeFebruary 18, 2016 at 8:33 am #1076422Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘How to add # of available tickets to event title?’ is closed to new replies.