Display a Custom Post Type with Advanced Custom Fields on Homepage

I’m pretty new to WordPress coding. I currently use Themler for my WordPress theme which allows you to put a CMS Code container right into the page and display any WordPress code.

I am using the “Custom Post Type UI” plugin, and the “Advanced Custom Fields” plugin. I have created a custom post type “events”. I included three native WordPress fields for the custom post type, and added three more custom fields via the ACF plugin. The fields are as follows:

Native WordPress Fields:

  • Title
  • Editor
  • Featured Image

Custom fields from ACF plugin:

  • event_date (date picker field)
  • event_theme (text field)
  • event_registration (file field)
  • event_additional_info (Wysiwyg Editor field)

What I’m struggling with is how to display these fields on my homepage via the CMS Code container in Themler. The code container accepts any WordPress code, so it doesn’t have to be anything special to comply. I’m just not knowledgeable enough on WordPress code to come up with it. I plan to display three events on my homepage and include the fields above in that display. I’ve tried a bunch of different pieces of code I’ve found, but some only show the native fields, and some only show the custom fields. I think its just my lack of understanding on how to make it all work. Would anyone be able to throw me the code to display this? I’m a quick learner and great with HTML/CSS, so I should be able to take it and run from there.

Thanks in advance!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I’m not using your theme. But if you want to call ACF field to frontend.
just using below code.

<?php echo get_field('slug_acf_field'); ?>


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x