<?php	 
///////--------start shortcode contact ------//
add_shortcode( 'webhosty_contact', 'webhosty_contact_post_func' ); 
function webhosty_contact_post_func( $atts ) { // New function parameter $content is added!
   extract( shortcode_atts( array(
      'title' => 'something', 
	  'desc' => '',
	  'name'=>'',
	  'email_c'=>'',
	  'subject'=>'',
	  'cate'=>'',
	  'c_email'=>'',
	  'mes'=>''
	   ), $atts ) ); 
global $webh_data; 
$result = $fields= $require ='';
$fields = $webh_data['webhosty_fieldsenable_disable'];
$require = $webh_data['webhosty_fieldsrequire'];
$validate = '';  
if(isset($webh_data['webhosty_category']))
$cat=$webh_data['webhosty_category']; 
$cn=count($cat);
            $result.='<article class="module-a"> 
            <div class="contact-form-container">';
            $result.='<h2 class="scheme-c center-text">'.esc_attr($title).'</h2>';
			$result.='<p class="center-text">'.esc_attr($desc).'</p> ';
            $result.=  '<form  method="post"  class="form-a" name="homefrm1" id="webhosty_contactform">
            <input type="hidden" value="'. WEBHOSTY_AJAX_URL .'"  id="webhosty_ajaxurl">';
			foreach($fields['ENABLE'] as $key=>$val){ 
			switch($key){ 
				case 'NAME':
					  if(isset($require['REQUIRE']['NAME'])){
					  $validate = 'data-validation="required"';
					}
			$result.= '<div class="form-group form-name">';
            $result.= '<label for="InputName">'.esc_attr($name).'</label>'; 
            $result.= '<input type="text" name="name" '.$validate.' class="form-control subscribe-email" id="InputName" placeholder="'.__('Enter name','webhosty').'"></div>';
             break;  
				case 'EMAIL' :
					  if(isset($require['REQUIRE']['EMAIL'])){
					  $validate = 'data-validation ="email"';
					}
		   $result.='<div class="form-group form-email">';
           $result.='<label for="InputEmail">'.esc_attr($email_c).'</label>
                     <input type="email" name="email" '. $validate.' class="form-control"          id="InputEmail" placeholder="'.__('Enter Email','webhosty').'"></div>';
             break;
				case 'SUBJECT' :
					  if(isset($require['REQUIRE']['SUBJECT'])){ 
					  $validate = 'data-validation="required"';
					} 
			$result.='<div class="form-group form-sub">
                            <label for="inputSub">'.esc_attr($subject).'</label>
                            <input type="text" name="sub" '.$validate.' class="form-control" id="inputSub" placeholder="'.__('Enter Subject','webhosty').'"></div>'; 
             break;   
				case 'CATEGORY' :
					  if(isset($require['REQUIRE']['CATEGORY'])){
					  $validate = 'data-validation="required"';
					}
		$result.='<label for="gfb">'.esc_attr($cate).'</label>
                  <div class="form-group select-container">
                  <select id="gfb" name="category" '.$validate.'>
				  <option selected disabled>'.__('Select categories','webhosty').'</option>';
						for($j=0;$j<$cn;$j++){
						$result.='<option value="'.$cat[$j].'" >'.esc_attr($cat[$j]).'</option>';
                        }
				 $result.='</select>';		
             $result.='</div>';        
             break;
				case 'MESSAGE' :
					if(isset($require['REQUIRE']['MESSAGE'])){
						$validate = 'data-validation="required"';
					} 
			  $result.='<div class="form-group">';
              $result.='<label for="inputSub">'.esc_attr($mes).'</label><textarea name="message" '.$validate.' class="form-control" rows="3"></textarea></div>';  
             break;	  
			} 
			$validate = '';  
		}
            $result.=' <div class="form-group">
                       <div class="checkbox">
                       <label><input name="copyemail_check" type="checkbox">'.esc_attr($c_email).'
                       </label></div></div>
                       <input type="submit" class="btn-subscribe btn-submit"  value="Submit">
					   </form>
					   </div>
					   <div id="alert"><div class="message"></div></div>'; 
            $result.=  '</article>';
	                   return $result;
  }
///////--------End shortcode contact ------//
///////--------start shortcode advertise ------//
add_shortcode('webhosty_advertise','webhosty_advertise_func');
function webhosty_advertise_func($atts)
{	extract( shortcode_atts( array( 
        'image'=>'',
		'title' => '', 
		'desc' => '',
		'btext'=>'',
		'blink'=>''
	    ), $atts ) ); 
        $result="";	
		$image1= wp_get_attachment_url($image);
		$image = aq_resize($image1, 225, 225, true);	
		$result.='<article class="module-e">
		          <figure><img src="'.esc_url($image1).'" alt="Placeholder">
				  </figure>
				  <h2><span>'.esc_attr($title).'</span></h2>
				  <p>'.esc_attr($desc).'</p> 
				  <p class="link-b"><a href="'.esc_url($blink).'">'.esc_attr($btext).' <i class="fa fa-chevron-right"></i></a></p>
				  </article>';
                  return $result; 
}
///////--------End shortcode advertise ------//
///////--------start shortcode domain ------//
add_shortcode('webhosty_domain','domain_funnc');
 function domain_funnc($atts) 
 { extract( shortcode_atts( array(  
		'title' => '',
		'no_of_post'=>''
	    ), $atts ) );
		$args = array( 'post_type' => 'domain','posts_per_page' =>$no_of_post);	
		global $post;
		$result = '';
		$result.='<article><ul class="list-f clear">';  
		$query = new WP_Query( $args );
		         if($query->have_posts()):	
			    while($query->have_posts()) : $query->the_post(); 
		$link = get_post_meta( get_the_ID(), 'webhosty_link', true );
		$subtitle=get_post_meta( get_the_ID(), 'webhosty_sub_title',true );
		$icon=get_post_meta( get_the_ID(), 'webhosty_awesome_icon',true );
        $result.='<li><i class="'.esc_attr($icon).'"></i>
                  <span class="title">'.esc_attr(get_the_title()).'
			      </span>
				  <span class="scheme-e">'.esc_attr($subtitle).'
			      </span>'. esc_attr(get_the_content()).'
			      <a class="link" href="'.esc_url($link).'"><i class="fa fa-angle-right"></i></a></li>';
		          endwhile; 
                  endif;
				  wp_reset_postdata();
		$result.='</ul></article>';
		          return $result;
 }
///////--------End shortcode advertise ------//
///////--------start shortcode image content------//
function contentimage_func( $atts )
 {   
extract( shortcode_atts( array(  
		'title' => '',
		'description' => '',
		 'image_url' => '',
		 'stitle'=>''
	     ), $atts ) ); 
		$result= $src=  $imgSrc="";
		$src  = wp_get_attachment_image_src($image_url ,'full');
		$imgSrc = $src[0]; 
		$imgSrc = aq_resize($imgSrc, 470, 240, true);	
		$result.='<article><figure class="float-left">
		          <img src="'.esc_url($imgSrc).'" alt="Placeholder">
				  </figure><h2><span>'.esc_attr($title).'
				  </span>'.esc_attr($stitle).'</h2>
				  <p>'.esc_attr($description).'</p></article>';
			      return $result; 
}
add_shortcode( 'webhosty_cimage', 'contentimage_func');  
///////--------End shortcode image content------//
///////--------start shortcode left right container------//
add_shortcode( 'webhosty_lft', 'webhosty_lft_func');
function webhosty_lft_func($atts,$content = null)
{
extract( shortcode_atts( array(   
		'title' => '',
		), $atts ) ); 
	    $result="";
	    $result.='<div class="module-h">'.
	    do_shortcode($content).'</div>';
	    return $result;
	   }
//----------------------start shortcode for left right shortcode content----///
add_shortcode( 'webhosty_rgt', 'webhosty_rgt_func');
function webhosty_rgt_func($atts,$content=null) 
{extract( shortcode_atts( array(   
		'title' => '',
		'image_url'=>'', 
		'desc'=>'',
	    ), $atts ) );
		   $result = $src = $imgsrc = '';
		   $src  = wp_get_attachment_image_src($image_url ,'full');
		   $imgSrc = $src[0]; 
		   $imgSrc = aq_resize($imgSrc, 470, 240, true); 
		   $result.='<article><figure>
					 <img src="'.esc_url($imgSrc).'" alt="Placeholder">
					 </figure><h3>'.esc_attr($title).'</h3>
					 <p>'.esc_attr($desc).'</p>
					 </article>';
					 return $result;
						 }	 
 if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
    class WPBakeryShortCode_webhosty_lft extends WPBakeryShortCodesContainer {
    }
}
if ( class_exists( 'WPBakeryShortCode' ) ) {
    class WPBakeryShortCode_webhosty_rgt extends WPBakeryShortCode {
    }
}
//----------start shortcode price table-----------////
add_shortcode( 'webhosty_price', 'webhosty_price_func');
function webhosty_price_func($atts) 
{
extract( shortcode_atts( array(   
		'title' => '',
		'ptitle' => '',
		'space_field'=>'',
		'b_title'=>'',
		'b_link'=>'',
	   ), $atts ) ); 
	    $srt = $result = $cnt='';
	    $str=explode("|", $space_field);
	    $cnt=count($str);
        $result.='<article ><div class="module-f">
				  <div><h3>'.esc_attr($title).'</h3>
				  <p class="scheme-k">'.esc_attr($ptitle).'</p>
				  <ul>';
				  for($i=0;$i<$cnt;$i++)  
				  { 
				  if($i==$cnt-1) 
				  {
				  $str1=explode(",", $str[$i]);
				  if(!empty($str1[0])){
				 $result.='<li><span class="scheme-e">'.$str1[0]
				 .'</span>';
				 }
				 if(!empty($str1[1])){
				 $result.= esc_attr($str1[1]);   
				 $result.='</li>'; 
				  } }
				  else{ 
                  $str1=explode(",", $str[$i]);    
				  if(!empty($str1[0])){				  
                  $result.='<li><span>'.$str1[0]
				 .'</span>';
				 }
				 if(!empty($str1[1])){
				 $result.= esc_attr($str1[1]);
				 $result.='</li>';  
				  }
				  }}
	    $result.='</ul>
				  <p class="link-a">
				  <a href="'.esc_url($b_link).'">'.esc_attr($b_title).'
				  <span class="link-span"><i class="fa fa-angle-right"></i></span></a></p>
				  </div></div></article>';
	              return $result;
						}
//----------End shortcode price table-----------////
//----------start shortcode question ----------////
add_shortcode( 'webhosty_question', 'webhosty_question_func');  
function webhosty_question_func($atts)
{
extract( shortcode_atts( array(    
	 'title' => '',
	 'description' => '',
     'stitle'=>'',
	 'blink'=>'',
	 'btitle'=>''
	  ), $atts ) ); 
	  $result="";  
      $result='<article class="module-b">
			   <h2><span>'.esc_attr($title).'</span></h2> 
			   <p class="scheme-b a">'.esc_attr($description).'</p>
			   <p class="link-b">
			   <a href="'.esc_url($blink).'">'.esc_attr($btitle).'
			   <i class="fa fa-chevron-right"></i>
			   </a></p></article>';
	           return $result;
					}
//----------End shortcode question table-----------////
//----------start shortcode service-----------////
add_shortcode( 'webhosty_service', 'webhosty_service_func' );
function webhosty_service_func( $atts ) {
extract( shortcode_atts( array(  
		'title' => '',
		'no_of_post'=>''
	), $atts ) ); 
	global $post; 
	$result = $original_image = $image ="";
    $result.='<article>
	          <ul class="list-c">';
	           $args = array( 'post_type' => 'Services','posts_per_page' =>$no_of_post);
			   $query = new WP_Query( $args );
			   if($query->have_posts()):	
			   while($query->have_posts()) : $query->the_post(); 
			   if (has_post_thumbnail($post->ID)){	
			   $original_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) , 'full' );
			   $image = aq_resize($original_image, 135, 135, true);
			   }	
			   $result.='<li><img src="'.esc_url($image).'" alt="Placeholder"> <span class="title">'.esc_attr(get_the_title($post->ID)).'</span>'.esc_attr(get_the_content($post->ID)).'</li>'; 
			   endwhile; 
               endif;
               wp_reset_postdata();			   
			   $result.='</ul></article>';   
			   return $result;
			   }
//----------End shortcode service-----------////
//----------start shortcode support-----------////
add_shortcode( 'webhosty_support', 'webhosty_support_func' );
function webhosty_support_func( $atts ) {
extract( shortcode_atts( array(  
		'title' => '',
		'no_of_post'=>''
	), $atts ) ); 
	global $post;  
	$result = $original_image = $image = '';
	$result.='<article><ul class="list-a">';
	          $args = array( 'post_type' => 'support','posts_per_page' =>$no_of_post);
	          $query = new WP_Query( $args ); 
	          if($query->have_posts()):	
	          while($query->have_posts()) : $query->the_post();
	          if (has_post_thumbnail($post->ID)){	
	          $original_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) , 'full' );
	          $image = aq_resize($original_image,128, 128, true); 
	          }	
	$result.='<li><img src="'.esc_url($image).'" alt="Placeholder"> <span class="title">'.esc_attr(get_the_title($post->ID)).' </span> '.esc_attr(get_the_content($post->ID)).'</li>';
			  endwhile; 
              endif;
			  wp_reset_postdata();
			  $result.='</ul></article>'; 
			  return $result;
}
//----------End shortcode support-----------//
////----------start shortcode support reply -----------////
add_shortcode( 'support_reply', 'webhosty_support_reply_WITHVS_func' );
function webhosty_support_reply_WITHVS_func($atts)
{
extract( shortcode_atts( array(   
		'title' => '', 
		'subtitle'=>'', 
		's_ubtitle'=>'', 
		'icon'=>'',
		's_subtitle'=>'',
		'image_reply'=>''
	     ), $atts ) ); 
	    $result='';
		$src  = wp_get_attachment_image_src($image_reply ,'full');
		   $imgSrc = $src[0]
		   ?>
		 <style scoped type="text/css">
		 .scheme-d > .fit-a { display: block; position:   absolute; left: 0; bottom: 0; width: 242px; height: 253px; background-image: url(<?php echo esc_url($src[0]) ;  ?>) }
		</style>
       <?php $result.='<article class="act"> 
			     <p class="scheme-d">'.esc_attr($title).'
				 <span class="strong">'.esc_attr($subtitle).'
				 </span> '.esc_attr($s_ubtitle).' 
				 <span class="strong">'.esc_attr($s_subtitle).'
				 </span>'.esc_attr($icon).'
				 </p>
			     </article>'; 
                 return $result;
                }
////----------End shortcode support reply -----------////
////----------start shortcode welcome content -----------////
add_shortcode( 'webhosty_welcome', 'webhosty_features_func');  
function webhosty_features_func($atts)
{
extract( shortcode_atts( array(    
		'title' => '',
		'description' => '',  
	       'stitle'=>'' 
	      ), $atts ) );
        $result="";	
        $result='<article class="act">
				 <h2 class="scheme-b"><span>'.esc_attr($title).'</span> '.esc_attr($stitle).'</h2>
				 <p class="scheme-b a">'.esc_attr($description).'
				 </p>
				 </article >
					'; 
        return $result;
					}
////----------End shortcode welcome content -----------////
////----------start shortcode testimonial -----------////
add_shortcode( 'testimonial_testi', 'webhosty_testimonial_func' );
function webhosty_testimonial_func($atts) { 
extract( shortcode_atts( array(  
		'title' => '',
		'no_of_post'=>'',
		'desc'=>''
	     ), $atts ) ); 
	    global $post; 
        $result = $original_image = $image = $memname = $designation ='';
        $result.='<article class="module-g">';
        $result.='<h2 class="scheme-b">'.esc_attr($title).'</h2>
		          <p class="scheme-b a">'.esc_attr($desc).'</p>';
	    $result.='<div class="slider-a">';
		$args = array( 'post_type' => 'testimonials','posts_per_page' =>$no_of_post);
		$query = new WP_Query( $args );
		if($query->have_posts()):	
		while($query->have_posts()) : $query->the_post(); 
		$result.='<p class="quote-a"><span>';
		if (has_post_thumbnail($post->ID)){	
		$original_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) , 'full' );	  
		$image = aq_resize($original_image, 70, 70, true);
		}	
		$memname=get_post_meta( get_the_ID(), 'webhosty_mem_name', true );
        $designation=get_post_meta( get_the_ID(), 'webhosty_mem_designation', true );		
	    $result.='<img src="'.esc_url($image).'" alt="Placeholder" >
		          <span>'.esc_attr($memname).'
			      </span> '.esc_attr($designation).'</span> 
			      <q>'.esc_attr(get_the_content($post->ID)).'</q>  
			      </p>';
		endwhile; 
		endif;
		wp_reset_postdata();
		$result.='</div>
		          </article>'; 
		return $result;
				}
////----------End shortcode testimonial -----------////
 ////----------start shortcode for why choose us--/////
add_shortcode( 'webhosty_choose_us', 'webhosty_chooseus_func');
function webhosty_chooseus_func($atts)
{extract( shortcode_atts( array(   
		'title' => '',
		'desc' => '',
		'image_ul'=>'',
	      ), $atts ) ); 
	    global $webh_data;
	    $result=$text="";
		$src  = wp_get_attachment_image_src($image_ul ,'full');
        if(!empty($src)){
		$imgSrc  = aq_resize($src[0],'1400','600');
	    }
	    $text=$webh_data['webhosty_multi_text']; 
	    $result.='<article class="module-d" style="padding: 80px 0px;">
				  <h2 class="scheme-b"><span>'.esc_attr($title).'</span></h2>
				  <p class="scheme-b a">'.esc_attr($desc).'</p>
				  <ul class="list-g">';
			      foreach($text as $value){
				$ex= explode(',',$value);	  
	    $result.='<li><div class="ico-cont"><i class="fa fa-check"></i></div>';
		if(!empty($ex[0])){
		$result.='<span>'.esc_attr($ex[0]).'</span>';
		}
		if(!empty($ex[1])){
		 $result.=esc_attr($ex[1]); 
		}
		$result.='</li>';
		}  
		$result.='</ul>';  
		$result.='<figure><img src="'.esc_url($imgSrc) .'" alt="Placeholder"></figure>';
		$result.='</article>'; 
		return $result; 
	             }
////----------End shortcode for why choose us--/////
////---------start short code client image---------///
add_shortcode( 'webhosty_clientimage', 'webhosty_clientimages');  
function webhosty_clientimages($atts) 
{extract( shortcode_atts( array(   
		'image_url' => '',
	    ), $atts ) ); 
	    global $webh_data;
	   $result=$i= $gal = $cnt =""; 
	   if(isset($webh_data['webhosty_gallery']))
	   {
	   $gal=$webh_data['webhosty_gallery'];
	   }
	   $src  = wp_get_attachment_image_src($image_url ,'full');
        if(!empty($src)){
		$imgSrc  = aq_resize($src[0],'1400','600');
	    }
	   $gallery = explode(',',$gal);
	   $cnt=count($gallery);
	   $result.='<article class="module-d"> 
			     <ul class="gallery-a">';
			     for($i=0;$i<$cnt;$i++){ 
		$gaal=wp_get_attachment_url( $gallery[$i]); 
		$im  = aq_resize($gaal,'120','40');
	   $result.='<li><img src="'.$im.'" alt="Placeholder"></li>';
	   }
	   $result.='</ul>';
       $result.='<figure><img src="'.esc_url($imgSrc) .'" alt="Placeholder"></figure>';
	   $result.='</article>';
	   return $result;  
	  }
	///------------Blog category------------////
add_shortcode('blog_category','bog_cat_func');
function bog_cat_func($atts) 
{
extract( shortcode_atts( array(   
		'blog_title' => 'Blog Categories',
	     ), $atts ) );
	   global $post;
	   $result="";
	   $result.='<div><h2>'.esc_attr($blog_title).'</h2>';
	   $args = array('orderby' => 'name','parent' => 0);
	   $result.='<ul class="list-k">';
	   $categories = get_categories( $args );
	   foreach ( $categories as $category ) {
	   $result .= '<li><a href="' .esc_attr(get_category_link( $category->term_id )) . '"><span>' . esc_attr( ($category->category_count ) ) . '</span>' . esc_attr($category->name). '</a><li>' ;     
			}
       $result.='</ul></div>';
       return $result;
} 
///------------END Blog category------------////
///------------Start social widget------------////
add_shortcode('social_widget','social_widget_func');
function social_widget_func($atts,$content=null) 
{
extract( shortcode_atts( array(   
       ), $atts ) );
	   $result="";
       $result=$content;
	   $result.='<ul class="social-b">'.social_url($atts).'
	            </ul>';
	   return $result;
}
///------------End social widget------------////
///------------Start slider widget------------////
add_shortcode('slider','slider_func');
function slider_func($atts,$content=null)
{extract( shortcode_atts( array(
	  'desc'=>'desc',
   ), $atts ) );
	   global $webh_data; 
	   $result = $image ="";
	   $gallery=$webh_data['webhosty_gallery_widget']; 
	   $cnt=explode(',',$gallery); 
       $t= count($cnt); 
       $result.=$content;
	   $result.='<figure class="slider-b">';
	              for($i=0;$i<$t;$i++) 
                   {
	   $ori_image= wp_get_attachment_url($cnt[$i]);
	   $image = aq_resize($ori_image, 270, 152, true);
	   $result.='<img src="'.esc_url($image).'" alt="Placeholder">';
				   }
	   $result.='</figure>
				 <p class="scheme-n">'.esc_attr($desc).'</p>';  
	   return $result;
} 
///------------End slider widget------------////
///------------start content tag widget------------////
add_shortcode('content_tag','contenttag_func'); 
function contenttag_func($atts,$content=null)
{
extract( shortcode_atts( array(   
		'title' => '',
	      ), $atts ) ); 
	   $result=$tags="";
	   $result=$content;
	   $result.='<ul class="list-m">';
	   $tags = get_tags();
	           foreach ( $tags as $tag ) {
	   $tag_link = get_tag_link( $tag->term_id );
	   $result.='<li><a href="'.esc_url($tag_link).'">'.esc_attr($tag->name).'</a></li>';
				}
	   $result.='</ul>'; 
	   return $result;
}
/////-------------testimonial widget--------------/////////////
add_shortcode( 'testimonial_wid', 'webhosty_testimonial_wid_func' );
function webhosty_testimonial_wid_func( $atts,$content=null ) {
extract( shortcode_atts( array(  
		'no_of_post'=>''
		), $atts ) ); 
	    global $post; 
        $result = $original_image = $image = $memname =''; 
		$result=$content; 
		$result.='<div class="slider-c">';
		$args = array( 'post_type' => 'testimonials','posts_per_page' =>$no_of_post);
		$query = new WP_Query( $args );
				 if($query->have_posts()):	
				 while($query->have_posts()) : $query->the_post(); 
				 if(has_post_thumbnail($post->ID)){	
		$original_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) , 'full' );
		$image = aq_resize($original_image, 70, 70, true);
				}	
		$memname=get_post_meta( get_the_ID(), 'webhosty_mem_name', true );
		$designation=get_post_meta( get_the_ID(), 'webhosty_mem_designation', true );		
        $result.='<p class="quote-b">
				  <q>'.esc_attr(get_the_content($post->ID)).'</q>
				  <span><img src="'.esc_url($image).'" alt="Placeholder"> <span>'.esc_attr($memname).'</span> '.esc_attr($designation).'</span>
				  </p>';
				  endwhile; 
				  endif;
				  wp_reset_postdata();
        $result.='</div>';  
        return $result;
}
/////------------- End testimonial  widget--------------/////////////
/////------------- dropdown widget  widget--------------/////////////
add_shortcode('dropdown_widget','dropdown_func');
function dropdown_func($atts,$content=null)
{ 
extract( shortcode_atts( array(
        ), $atts ) );
       $result='';
	   global $webh_data;
	   $cat=$webh_data['webhosty_category'];
       $result.=$content;
	   $result.='<form action="./" method="post">
	             <fieldset>
				 <p><select id="gfb" name="gfb">
                 <option selected disabled>Select categories 
                 </option>';
                 foreach($cat as $val){
      $result.='<option value="'.esc_attr($val).'">'.esc_attr($val).'</option>';
                 }
      $result.='</select></p></fieldset>
                </form> ';
      return $result;
}				
/////-------------End dropdown widget  widget--------------/////////
/////////-------------meta widget --------------/////////////
add_shortcode('meta_widget','meta_func'); 
function meta_func($atts,$content=null)
{
extract( shortcode_atts( array(
      'title' => 'something', 
       ), $atts ) );
       $args = array('type' => 'post','taxonomy' => 'category',
	                'pad_counts' => false); 
       $result="";
       $result=$content;
       $args = array('orderby' => 'name','parent' => 0);
	   $result.='<ul class="list-l">';
	   $categories = get_categories( $args );
					foreach ( $categories as $category ) {
	   $result.='<li><a href="' . esc_url(get_category_link( $category->term_id )). '">' . esc_attr($category->name). '</a></li>';
	   } 
	   $result.='</ul> ';
	   return $result; 
}
/////////-------------End meta widget --------------/////////////

//////---------End accordian style---------------//////////
//////web features-----------////////////
add_shortcode( 'web_features', 'web_features_func'); 
function web_features_func($atts,$content=null)
{
extract( shortcode_atts( array(   
		'title' => '',
		'image_url'=>'',
	     ), $atts ) );
	    $result = $src = $imgsrc ='';
	    $src  = wp_get_attachment_image_src($image_url ,'full');
        if(!empty($src)){
		$src  = aq_resize($src[0],'570','330'); 
	    }		
        $result.='<figure class="float-right"><img src="'.esc_url($src).'" alt="Placeholder">
		</figure>';	  		 
		$result.=$content;        
        return $result; 
	    }
//--------------------------------------------------//
add_shortcode('clg_genral_li_shortcode','webhosty_genral_li_func');
function webhosty_genral_li_func($atts,$content=null)
{
extract( shortcode_atts( array(     
		'title' => '',
		'font_awesome'=>""
		), $atts ) );  
		$result="";
		$result.='<div>
				 <h3 class="header-a"><i class="'.esc_attr($font_awesome).'"></i>
				 '.esc_attr($title).'</h3><ul class="list-b">
				 '.do_shortcode($content).'</ul></div>';
				 return $result; 
}				 
/////////---------------------------------------------/////  
add_shortcode('clg_do_li_shortcode','webhosty_li_func');
function webhosty_li_func($atts){	
extract( shortcode_atts( array(     
               'desc'=>''  
	          ), $atts ) );   	
              $result="";	
			  $result.='<li>'.esc_attr($desc).'</li>';    
			  return $result ;
}
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
    class WPBakeryShortCode_clg_genral_li_shortcode extends WPBakeryShortCodesContainer {
    }
}
if ( class_exists( 'WPBakeryShortCode' ) ) {
    class WPBakeryShortCode_clg_do_li_shortcode extends WPBakeryShortCode {
    }
}
///---------popualar post widget shortcode------/////
add_shortcode('popular','popularpost_func'); 
function popularpost_func($atts) 
{ 
	extract( shortcode_atts( array( 
	'title' => 'popular post',   
	'no_of_post'=>'',
	), $atts ) );
	$result="";   
	global $post;
	$args=array(
	'posts_per_page'=> $no_of_post, 
	'post_type'=>'post',
	'key' => 'post_views_count', 
	'orderby' => 'meta_value_num', 
	'order'    => 'DESC',
	'post_status' => 'publish'
	);
	$result.= '<h2>'.esc_attr($title).'</h2>'; 
	$result.='<div class="news-a">'; 
	query_posts($args);
	while ( have_posts() ) : the_post(); 
		if (has_post_thumbnail($post->ID)){	
		$original_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) , 'full' );
		$thumb_w = '270';
		$thumb_h = '152';	  
		$image = aq_resize($original_image, $thumb_w, $thumb_h, true);   
		}	
		$result.='<article>
		<figure><img src="'.esc_url($image).'" alt="Placeholder" width="270" height="152"></figure>
		<h4>'.__(get_excerpt(50),'webhosty').'</h4><ul class="list-n">';
		$result.= '<li class="a">'.get_the_time('j.m.y').
		' </li>';
		$result.='<li class="b">'.esc_attr(get_comments_number()).'</li>
		</ul>
		</article>';
	endwhile;
wp_reset_query();				
$result.='</div>';
return $result;
}  
?>