Join our webinar on how to grow your events business with WP Event Manager on 29th September at 11:00 am EST.Register Now!
How can we help?

How to show Ticket Price

WP Event Manager Add ons Tutorials explains you, How to show ticket price field to the frontend.

Show ticket price at events listing

  1. Open your theme function.php file
  2. Create a function to append a new field to the events section.
  3. Add the following code for getting event ticket price:
    function get_custom_event_ticket_price( ) {
        global $post;
        if ( $post->post_type !== 'event_listing' )
        return apply_filters( 'display_custom_event_ticket_price', $post->_event_ticket_price, $post );
  4. Add the following code for displaying event ticket price:
    function display_custom_event_ticket_price( $before = '', $after = '', $echo = true, $post = null ) {
        $event_ticket_price = get_custom_event_ticket_price( $post );
        if ( strlen( $event_ticket_price ) == 0 )
        $event_ticket_price = esc_attr( strip_tags( $event_ticket_price ) );
        $event_ticket_price = $before . $event_ticket_price . $after;
        if ( $echo )
            echo $event_ticket_price;
            return $event_ticket_price;
  5. Open your theme content-event_listing.php file and echo event ticket price.
    printf( __( 'Ticket Price: %s', 'wp-event-manager' ), get_custom_event_ticket_price() );

Fields added using the above code will be show to the event ticket price automatically. There is two layout available box layout and line layout so add your above code where you want to show ticket price or you can add in both layout.

Quick Links