3,
'no_of_item' =>3,
'pricing_button_title' => '',
),$atts
)
);
$args=array(
'post_type' => 'pricing-plans',
'posts_per_page' => $no_of_record,
'orderby' => 'date',
'order' => 'ASC'
);
$loop= new WP_Query($args);
$pricing_item = '
';
$fst_bottom_post_contents = "";
if ($loop->have_posts()) {
$delay=0.3;
$i=0;
while ($loop->have_posts()) {
$i++;
$loop->the_post();
//CONTENT
$string_desc = strip_tags(get_the_content());
if (strlen($string_desc) > 145) {
$stringCut_desc = substr($string_desc, 0, 145);
$endPoint_desc = strrpos($stringCut_desc, ' ');
$string_desc = $endPoint_desc? substr($stringCut_desc, 0, $endPoint_desc) : substr($stringCut_desc, 0);
$string_desc .= '...
';
}
//FOR TITLE
$string_title = strip_tags(get_the_title());
if (strlen($string_title) > 50){
$stringCut_title = substr($string_title, 0, 50);
$endPoint_title = strrpos($stringCut_title, ' ');
$string_title = $endPoint_title? substr($stringCut_title, 0, $endPoint_title) : substr($stringCut_title, 0);
$string_title .= '...';
}
$delay = $delay+0.2;
$img = get_the_post_thumbnail_url('','medium');
$img = ($img=="") ? get_template_directory_uri().
'/fst-framework/fst-customizer/assets/images/default-img.png' : $img;
$fst_column_class = 'col-xl-4 col-lg-4 col-md-4';
if($no_of_item == 4) {
$fst_column_class = 'col-xl-3 col-lg-3 col-md-3';
} elseif($no_of_item == 2) {
$fst_column_class = 'col-xl-6 col-lg-6 col-md-6';
} elseif($no_of_item == 1) {
$fst_column_class = 'col-xl-12 col-lg-12 col-md-12';
}
//FOR PRICE
$price = get_post_meta(get_the_ID(),'_fst_pricing_price',true);
$fst_pricing_icons = get_post_meta(get_the_ID(),'_fst_pricing_icons',true);
ob_start();
get_template_part('template-parts/addons/pricing/pricing');
$fst_bottom_post_contents = ob_get_clean();
$replace = array('{{image}}','{{heading}}','{{content}}','{{permalink}}','{{column_class}}',
'{{price}}','{{delay}}', '{{pricing_button_title}}','{{fst_pricing_icons}}');
$to = array(esc_url($img),$string_title,$string_desc,get_post_permalink(),$fst_column_class,
$price,$delay,$pricing_button_title, $fst_pricing_icons);
$pricing_item .= str_replace($replace,$to, $fst_bottom_post_contents);
}
} else {
if (is_user_logged_in()) {
echo "
Click Here to Manage Pricing Plans or Import demo data of theme.
";
}
}
/*FOR ACTIONS*/
$enq_fullname_action = "remove_errorMsg('pricing_enquiry_fullname','enq_err_name')";
$enq_email_action = "remove_errorMsg('pricing_enquiry_email','enq_err_email')";
$enq_phoneno_action = "remove_errorMsg('pricing_enquiry_phonenumber','enq_err_phone')";
$enq_servicetype_action = "remove_errorMsg('pricing_enquiry_servicetype','enq_err_servicetype')";
$enq_weburl_action = "remove_errorMsg('pricing_enquiry_weburl','enq_err_weburl')";
$enq_msg_action = "remove_errorMsg('pricing_enquiry_msg','enq_err_msg')";
$pricing_item.='