Skip to content

Instantly share code, notes, and snippets.

@nayeemch
Created September 21, 2017 13:20
Show Gist options
  • Save nayeemch/7b05d1d5f4fdbf4d70d5f7c9f70c14fd to your computer and use it in GitHub Desktop.
Save nayeemch/7b05d1d5f4fdbf4d70d5f7c9f70c14fd to your computer and use it in GitHub Desktop.
ক্লাশ – ৬ – সেকশন টাইটেল, সার্ভিস বক্স শর্টকোড ডেভেলপমেন্ট, স্টাইল গাইডলাইন
<?php
/*
Plugin Name: amaderlab-toolkit
Plugin URI: http://kidzever.com/wp_prac/
Description: This is a test plugin
Author: nym
Version: 1.0
Author URI: http://kidzever.com/
*/
function amaderlab_toolkit_include_files(){
wp_enqueue_style('amaderlab-toolkit',plugins_url('/assets/css/amaderlab-toolkit.css',__FILE__));
}
add_action('wp_enqueue_scripts','amaderlab_toolkit_include_files');
function amaderlab_section_title_shortcode($atts){
extract(shortcode_atts(array(
'sub_title'=>'',
'title'=>'',
'description'=>''
), $atts));
$amaderlab_section_title_markup = '<div class="amaderlab_section_title">';
if(!empty($sub_title)){
$amaderlab_section_title_markup .= '<h4>'.esc_html($sub_title).'</h4>';
}
if(!empty($title)){
$amaderlab_section_title_markup .= '<h2>'.esc_html($title).'</h2>';
}
if(!empty($description)){
$amaderlab_section_title_markup .= ''.wpautop(esc_html($description)).'';
}
$amaderlab_section_title_markup .= '</div>';
return $amaderlab_section_title_markup;
}
add_shortcode('amaderlab_section_title','amaderlab_section_title_shortcode');
function amaderlab_service_box_shortcode($atts){
extract(shortcode_atts(array(
'icon_type'=>1,
'fa_icon'=>'fa fa-star',
'img_icon'=>'',
'title'=>'',
'description'=>''
), $atts));
$amaderlab_service_box_markup = '<div class="amaderlab_service_box">';
if($icon_type==1){
$amaderlab_service_box_markup .='<div class="service-icon">
<i class=" '.esc_attr($fa_icon).' "></i>
</div>';
}
else{
$service_icon_img_array = wp_get_attachment_image_src($img_icon,'thumbnail');
$amaderlab_service_box_markup .= '<div class="service-img-icon">
<img src=" '.esc_url($service_icon_img_array[0]).' " alt=" '.esc_html($title).' ">
</div>';
}
if(!empty($title)){
$amaderlab_service_box_markup .= '<h2>'.esc_html($title).'</h2>';
}
if(!empty($description)){
$amaderlab_service_box_markup .= ''.wpautop(esc_html($description)).'';
}
$amaderlab_service_box_markup .= '</div>';
return $amaderlab_service_box_markup;
}
add_shortcode('amaderlab_service_box','amaderlab_service_box_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment