Home › Forums › Pro Support › Custom Fields › Reply To: Custom Fields
February 10, 2020 at 5:40 am
#13306
Participant
hi tom, is there a step by step somewhere for getting custom field content to display in a list (or ultimately in a carousel)? i have three custom fields in my cpt (cptui/acfpro) and i put this into my functions file, but am unsure how to ‘just hook them’ to get them into my list and ultimately to display as the carousel. [edited for clarity and to add when i put the below code in my functions file, i get a database error, too.]
add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
function wpsp_add_custom_meta()
{
$meta = get_post_meta( get_the_ID(), 'st-headline', true );
if ( isset( $meta ) && '' !== $meta )
echo $meta;
}
add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
function wpsp_add_custom_meta()
{
$meta = get_post_meta( get_the_ID(), 'short_testimonial', true );
if ( isset( $meta ) && '' !== $meta )
echo $meta;
}
add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
function wpsp_add_custom_meta()
{
$meta = get_post_meta( get_the_ID(), 'st-attribution', true );
if ( isset( $meta ) && '' !== $meta )
echo $meta;
}