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 Meta fields as buttons in hook Reply To: Meta fields as buttons in hook


Well i think this one is solved, please take a look if you can and let me know if there is a simpler or better way to do it

//Wpsp show meta instead of content
add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
function wpsp_add_custom_meta()
    $meta = get_post_meta( get_the_ID(), 'kundcase_site_url', true );

    if ( isset( $meta ) && '' !== $meta )
        echo '<a class="button" href="'.$meta.'">Besök sidan</a>';

    echo '<a class="button alignright" href="'.get_permalink( $id ).'">Läs Mer</a>';