Shortcode or way to add "tribe-events-meta-group-other" to a page

Home Forums Calendar Products Events Calendar PRO Shortcode or way to add "tribe-events-meta-group-other" to a page

  • This topic has 0 replies, 2 voices, and was last updated 6 years ago by hannujaatinen.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1484783
    hannujaatinen
    Participant

    I’m creating a new single event template and I’d like to know how I can add the tribe-events-meta-group tribe-events-meta-group-other section in it?

    #1486654
    Cliff
    Member

    Hi, Hannu.

    That comes from including /wp-content/plugins/events-calendar-pro/src/views/pro/modules/meta/additional-fields.php

    add_action( 'tribe_events_single_event_meta_primary_section_end', array( $this, 'additional_fields' ) ); from /wp-content/plugins/events-calendar-pro/src/Tribe/Single_Event_Meta.php is how this gets included (see addiitonal_fields() method within this file)

    Please let me know how this goes for you.

    #1486751
    hannujaatinen
    Participant

    If I want to create a shortcode what should I include in that?

    I’ve tried using

    // Add Shortcode
    function tapahtuman_metatiedot() {

    tribe_get_template_part( ‘pro/modules/meta/additional-fields’, null, array(
    ‘fields’ => tribe_get_custom_fields(),
    ) );

    }
    add_shortcode( ‘tapahtuman-metatiedot’, ‘tapahtuman_metatiedot’ );

    It actually worked when I saved the shortcode in Beaver Themer but then the meta details jumped to top left corner of the page 🙁

    #1486752
    hannujaatinen
    Participant

    Is it doing the action too early or am I missing something?

    #1487193
    Cliff
    Member

    Shortcodes need to return, not echo, which is what tribe_get_template_part() does: https://github.com/moderntribe/the-events-calendar/blob/4.6.12/src/functions/template-tags/general.php#L154

    #1507386
    Support Droid
    Keymaster

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Shortcode or way to add "tribe-events-meta-group-other" to a page’ is closed to new replies.