Home › Forums › Calendar Products › Events Calendar PRO › Changing location of custom fields within Single Event Page
- This topic has 10 replies, 3 voices, and was last updated 9 years, 4 months ago by
Shaun.
-
AuthorPosts
-
December 7, 2016 at 11:25 am #1202820
Shaun
ParticipantCurrently 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,
MikeDecember 8, 2016 at 9:30 am #1203313Andras
KeymasterHi 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,
AndrasDecember 8, 2016 at 11:24 am #1203372Shaun
ParticipantThis reply is private.
December 9, 2016 at 2:58 pm #1204224Andras
KeymasterHi 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,
AndrasDecember 12, 2016 at 9:10 am #1204750Shaun
ParticipantGood 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,
MikeDecember 13, 2016 at 2:56 pm #1205561Andras
KeymasterHi 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
December 14, 2016 at 3:01 pm #1206182Shaun
ParticipantWe 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,
MikeDecember 15, 2016 at 2:18 am #1206313Andras
KeymasterHey 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.
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,
AndrasDecember 16, 2016 at 9:13 am #1207118Shaun
ParticipantGOT 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.
December 16, 2016 at 2:17 pm #1207208Andras
KeymasterMike, 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,
AndrasPS: 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-calendarPS2: 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!
-
AuthorPosts
- The topic ‘Changing location of custom fields within Single Event Page’ is closed to new replies.
