Advertisement
Guest User

contact_information

a guest
Jan 5th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.99 KB | None | 0 0
  1. if(!function_exists('codeless_sc_contact_info')){
  2.  
  3.     function codeless_sc_contact_info($atts, $content = null, $shortcodename=""){
  4.  
  5.         extract(shortcode_atts(array("tel" => "", 'addr' => '', 'email' => '', 'bbm' => '', 'light' => ''), $atts));
  6.        
  7.  
  8.         $light_class = '';
  9.         if($light == 'yes')
  10.             $light_class = 'light';
  11.         $output = '<div class="contact_information '.$light_class.'">';
  12.  
  13.             if(!empty($addr)):
  14.                 $output .= '<dl class="item dl-horizontal addr">';
  15.                     $output .= '<dt><i class="icon-location-arrow"></i></dt>';
  16.                     $output .= '<dd><span class="title">'.__('Our Locations', 'codeless').'</span><p>'.$addr.'</p></dd>';
  17.                 $output .= '</dl>';
  18.             endif;
  19.  
  20.             if(!empty($tel)):
  21.                 $output .= '<dl class="item dl-horizontal">';
  22.                     $output .= '<dt><i class="moon-phone"></i></dt>';
  23.                     $output .= '<dd><span class="title">'.__('Telephone Number', 'codeless').'</span><p>'.$tel.'</p></dd>';
  24.                 $output .= '</dl>';
  25.             endif;
  26.            
  27.             if(!empty($email)):
  28.                 $output .= '<dl class="item dl-horizontal">';
  29.                     $output .= '<dt><i class="icon-envelope"></i></dt>';
  30.                     $output .= '<dd><span class="title">'.__('Email Address', 'codeless').'</span><p>'.$email.'</p></dd>';
  31.                 $output .= '</dl>';
  32.             endif;
  33.  
  34.             if(!empty($bbm)):
  35.                 $output .= '<dl class="item dl-horizontal">';
  36.                     $output .= '<dt><span class="bbm_channels"></span></dt>';
  37.                     $output .= '<dd><span class="title">'.__('BBM Channels', 'codeless').'</span><p>'.$bbm.'</p></dd>';
  38.                 $output .= '</dl>';
  39.             endif;
  40.  
  41.         $output .= '</div>';  
  42.        
  43.         return $output;
  44.          
  45.     }
  46.          
  47.     add_shortcode('contact_information', 'codeless_sc_contact_info');
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement