We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Help me achieve something similar Reply To: Help me achieve something similar

#908
Tom
Keymaster

Exactly like that – you’d just add more variables:

add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
function wpsp_add_custom_meta()
{
    $first_meta = get_post_meta( get_the_ID(), '_your_custom_meta_key', true );
    $second_meta = get_post_meta( get_the_ID(), '_your_second_custom_meta_key', true );
    $third_meta = get_post_meta( get_the_ID(), '_your_second_custom_meta_key', true );

    if ( isset( $first_meta ) && '' !== $first_meta )
        echo $first_meta;

    if ( isset( $second_meta ) && '' !== $second_meta  )
        echo $second_meta;

    if ( isset( $third_meta ) && '' !== $third_meta )
        echo $third_meta;
}