custom shortcode will not display the wrapped content

Because the shortcode must return a string. Avoid using the “echo” function in shortcode.

Instead of doing that:

function my_shortcode_function($content){

  echo '<div class="wrap">';
  echo '<div class="col">'.$content.'</div>';
  echo '</div>';

}

Do that:

function my_shortcode_function($content){

  $shortcode_return = '<div class="wrap">';
  $shortcode_return .= '<div class="col">'.$content.'</div>';
  $shortcode_return .= '</div>';

  return $shortcode_return;

}

Or use object buffering:

function my_shortcode_function($content){

  ob_start(); ?>

  <div class="wrap">
    <div class="col"><?php echo $content; ?> </div>
  </div>

  <?php
  $shortcode_return = ob_get_clean();

  return $shortcode_return;

}