Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Output Custom Field in Div Class Reply To: Output Custom Field in Div Class


Hello I have a custom field in some posts (prod1). Is an url link to an image (ej: If I use the code:

add_action( 'wpsp_after_content', 'tu_add_custom_meta' );
function tu_add_custom_meta() {
    $meta = get_post_meta( get_the_ID(), 'prod1', true );
    if ( isset( $meta ) && '' !== $meta ) {
        echo '<div class="my-class-here">' . $meta . '</div>';

or use echo esc_url( get_post_meta( get_the_ID(), 'prod1', true ) );

I just get the text ( below the title, not the image, I need that as the image. Is it possible?

Thank you