Hiding Cost on Events Pages

Home Forums Ticket Products Event Tickets Plus Hiding Cost on Events Pages

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1254147
    Michele
    Participant

    Hello there,

    I am attempting to hide the cost on events pages for my site. The site is http://mca-omaha.org/?post_type=tribe_events

    I successfully hid the price at the top of the page in individual events (.single-tribe_events .tribe-events-schedule .tribe-events-cost), but for the details section below, I can’t get rid of it without hiding the whole column (I have it hidden now, but you can see how it would otherwise look in my attached screenshot – it’s the top box, “Details” column).

    The weird thing is that it shows up as I’d like it, without the price, when I view the preview the page before updating. However, as soon as I update it, it reappears.

    We don’t have anyone that knows php on hand – is there another way for me to hide the cost in this area without hiding the whole column?

    Thank you!

    #1254444
    Geoff
    Member

    Hey Michele,

    Absolutely, that’s totally possible! I would suggest overriding the details.php template to make that happen. You can learn more about overriding calendar templates in our Themer’s Guide, but it basically boils down to this:

    • Make a copy of the details.php template. It is located at /wp-content/plugins/the-events-calendar/src/views/modules/details.php
    • Make a new folder in your theme called tribe-events
    • Make a new folder in that one called modules
    • Drop your copied details.php file in that last folder

    Now that the template is in your theme, you can modify it to suit your needs. In this case, remove the following code from the template:

    <?php
    // Event Cost
    if ( ! empty( $cost ) ) : ?>
    
    <dt> <?php esc_html_e( 'Cost:', 'the-events-calendar' ) ?> </dt>
    <dd class="tribe-events-event-cost"> <?php esc_html_e( $cost ); ?> </dd>
    <?php endif ?>

    Will this work for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1254481
    Michele
    Participant

    Hi Geoff!

    Thank you for your answer! We actually decided not to have that section there at all, like we have it now, so I think we’re ok on this one.

    Thank you!

    #1254773
    Geoff
    Member

    Awesome, glad to hear it! At least you have a way to go about it if you ever decide to bring the column back. 🙂

    I’ll go ahead and close this thread but let us know if any other questions come up and we’d be happy to help.

    Cheers!
    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hiding Cost on Events Pages’ is closed to new replies.