I'm making shortcode and I'm stuck here. Here is code:
add_shortcode('service-shortcode', 'service_shortcode');
function service_shortcode($atts)
{
extract( shortcode_atts( array(
'title' => 'Service One',
'icon' => 'fa-briefcase'
), $atts ));
$return_string = '';
$return_string .= '<div class="service">';
$return_string .= '<div class="container">';
$return_string .= '<div class="row">';
$return_string .= '<div class="col-md-3 col-sm-6">';
$return_string .= '<div class="service-icon wow animated fadeInDown" data-wow-delay="300ms">';
$return_string .= '<i class="fa '.$icon.'"></i>';
$return_string .= '</div>';
$return_string .= '<div class="text wow animated fadeInUp" data-wow-delay="300ms">';
$return_string .= '<p>'.$title.'</p>';
$return_string .= '</div>';
$return_string .= '</div>';
$return_string .= '</div>';
$return_string .= '</div>';
$return_string .= '</div>';
return $return_string;
}
Now when ever I put the shortcode it outputs the complete shortcode. What I want is for the first time it outputs complete shortcode and then just output from (div class="col-md-3 col-sm-6") to its closing tag. So the all services will come in a row.. Is there any way to achieve it. Thanks in advance..
Note: I don't want to make custom post type that store each service and call with wp_query ...