Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Custom Fields Reply To: Custom Fields

#13306
sparkle
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;
}
  • This reply was modified 9 months, 2 weeks ago by sparkle.