Changing location of custom fields within Single Event Page

Home Forums Calendar Products Events Calendar PRO Changing location of custom fields within Single Event Page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1202820
    Shaun
    Participant

    Currently my 2 additional fields show up on the bottom of the single event page, below the fold and out of sight. I would like to move them right below one of the other fields such as “course category” or “phone.” How would I go about making this change? I’ve read the Themer’s guide but cannot find what I need to move the additional details meta field and where to move it. Please see my attachment for a visual guide to what I’d like to do.

    Thanks,
    Mike

    #1203313
    Andras
    Keymaster

    Hi Shaun,

    Thanks for reaching out with your question. Let me try to help you with that.

    Most likely you will need to do a template override for the single-event.php file and restructure the contents of that file.

    If you give me some more details on how that event is set up, I might be able to help you a bit more. Please send me a screenshot of the event admin page so I can see the details.

    Also what will help is if you share your system information with me.

    Looking forward to helping you solve this.

    Cheers,
    Andras

    #1203372
    Shaun
    Participant

    This reply is private.

    #1204224
    Andras
    Keymaster

    Hi Shaun,

    Thanks for hanging in there.

    I managed to get some help on this. You can use this snippet to move the Additional fields section to the front of the box.
    /* Tribe, re-arrange event additional fields */
    function tribe_re_arrange_additional_fields ( ) {
    $meta = Tribe__Events__Pro__Main::instance()->single_event_meta;
    remove_action( 'tribe_events_single_event_meta_primary_section_end', array( $meta, 'additional_fields' ) );
    add_action( 'tribe_events_single_event_meta_primary_section_start', array( $meta, 'additional_fields' ) );
    }
    add_action ( 'init', 'tribe_re_arrange_additional_fields');

     

    Another option you have is making a template override for this file:

    wp-content\plugins\the-events-calendar\src\views\modules\meta.php

    and add this line to where you want the section to appear.

    tribe_get_template_part( 'pro/modules/meta/additional-fields', null, array( 'fields' => tribe_get_custom_fields(), ) );
    (If your theme has already an override, then you will need to override that in a child theme.

    And you will then need to remove it from the original position. You can do that with the first snippet, just remove this line from it:
    add_action( 'tribe_events_single_event_meta_primary_section_start', array( $meta, 'additional_fields' ) );
     

    Let me know if this solves it for you.

    Cheers,
    Andras

     

    #1204750
    Shaun
    Participant

    Good Afternoon Andras,

    I tried to use the second snip but I can’t get it formatted nicely (Unfortunately, this is my first website and I have extremely rudimentary coding knowledge). I can get the section moved to the top as per the attached screenshot, but I don’t know how to give it a header such as ‘Details’ and ‘Venue’, or integrate it with the Details or Venue section so that they are merged together. Either would be acceptable.

    Any recommendations?

    Thanks,
    Mike

    #1205561
    Andras
    Keymaster

    Hi Mike,

    You should be able to add html tags with classes and whatever content you want, and then format it with css afterwards.

    Like this for example:


    Other

    tribe_get_custom_fields(), ) );
    .......... ?>

    Does this help?

    Andras

    #1206182
    Shaun
    Participant

    We are getting closer, and I do understand if this is outside the scope of what you guys can cover, but if you can check out my screenshot and let me know any tricks to getting this thing right, that would be great!

    Thanks,
    Mike

    #1206313
    Andras
    Keymaster

    Hey Mike,

    I believe what would help in styling if you would add a <div></div> container around that whole block (the heading and the link). Then you can format that div block with css, add margin, padding, whatever is needed to align it with the rest.

    These 2 articles should help you in that as well. You can find out the settings for the other 2 blocks and try use the same.

    Using Google Chrome Developer Tools

    https://theeventscalendar.com/wordpress-web-developer-extensions/

    Hope this gets you into the finish line. 🙂

    Let me know if you need any more guidance.

    Cheers,
    Andras

    #1207118
    Shaun
    Participant

    GOT IT!

    For those who also want to place additional fields up top and format it correctly: Be aware that the div tags you have to enter to format the title are placed in “additional-fields.php”. I recommend copying what you see for the title in “venue.php” to get it exact.

    #1207208
    Andras
    Keymaster

    Mike, I’m super stoked to hear and see that you got it working! Great job man!!!

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic in the forum and we will be glad to help you out.

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Changing location of custom fields within Single Event Page’ is closed to new replies.