Help Desk

Move Custom Field Results Above Description in List and Single Event Displays

  • Posts: 28 Topics: 21
    | Permalink

    Hi, thanks for the continued wonderful support and the inspiration to push your plugins further.

    I have a community form that includes a single additional custom field. By adding a copy of the edit-event.php file to themes/my-child-theme/tribe-events/community/ I was able to successfully move the custom field just above the description field in the community events form.

    Now, in the archive events list view and single event view, I need the custom field results to display just above the description field results. Can you please let me know which files to edit and add to my child theme tribes-event folder to make this happen? Also, if you could give me the required PHP line of code to do so, that would be helpful too. 🙂

    Thank you!

    🙂 Eric

    Posts: 144
    | Permalink

    Hi Eric.

    Thanks for reach out. We have a guide in our docs, that might be helpful in the future that gives you more details about each file as well as descriptions.

    But if you want to override the archive it depends on which one is your default view for example if is map you need to change is:

    src/views/pro/map/content.php

    On the guide above provides a description of each file as well.

    For the single view you have:

    src/views/single-event.php

    Or depends on the view that you want to change. In the single view you can do this by adding your code, you can add your code above

    <!-- Event content -->
    

    Or as you see fit better for your needs.

                <!-- Event content -->
                <?php do_action( 'tribe_events_single_event_before_the_content' ) ?>
                <div class="tribe-events-single-event-description tribe-events-content">
                    <?php the_content(); ?>
                </div>
                <!-- .tribe-events-single-event-description -->
                <?php do_action( 'tribe_events_single_event_after_the_content' ) ?>
    

    On the other hand if you don’t want to overwrite your templates you can use of actions which allows you to execute code on some areas of the templates for example:

    // functions.php file
    function tribe_events_single_event_before_the_content_message() {
      echo "This is a custom message before the content";
    }
    
    add_action( 'tribe_events_single_event_before_the_content', 'tribe_events_single_event_before_the_content_message' );
    

    Let me know if you have more questions about this, if so I will happy answer your follow up questions.

    Best.
    Crisoforo

    Posts: 4
    | Permalink

    Hey 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

    | Permalink

The topic ‘Move Custom Field Results Above Description in List and Single Event Displays’ is closed to new replies.