Home › Forums › Backend Issues (wp-admin) › adding date to admin columns › Reply To: adding date to admin columns
Hi @rudtek
That’s because you were using the get_post_meta() function instead of the get_field() function. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/. So, you should be able to do it like this:
function forum_custom_column ( $column, $post_id ) {
switch ( $column ) {
case 'event_date':
echo get_field( 'event_date', $post_id );
break;
case 'event_location':
echo get_field( 'event_location', $post_id );
break;
}
}
add_action ( 'manage_cr3ativconference_posts_custom_column', 'forum_custom_column', 10, 2 );
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.