Support

Account

Home Forums General Issues Shortcode to include label and value Reply To: Shortcode to include label and value

  • Sorted this myself.

    For the record I have created a shortcode.php file and called it from functions.php

    It was quite easy once I understood. This is the type of code I used

    function cultivar_name() {
    if(get_field(‘cultivar’)){
    $field_name = “cultivar”;
    $field = get_field_object($field_name);
    echo ‘‘, $field[‘label’],’‘ . ‘: ‘ . ‘<div class=”headlinename”>’, $field[‘value’],'</div>’,'</br>’;}
    }
    add_shortcode( ‘cultivar’, ‘cultivar_name’ );