Support

Account

Home Forums General Issues Display fields based on parameters in URL Reply To: Display fields based on parameters in URL

  • For those who want my final code

    http://somesite.com/page/?agent=1

    
    $post_id = false;
    if ( isset( $_GET[ 'agent' ] ) ) {
      $post_id = intval( $_GET[ 'agent' ] );
    
      $value = get_field( "phone", $post_id );
    
      if ( $value ) {
        echo $value;
      } else {
        echo 'empty';
      }
    }
    }