Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
- function factorian_service_box_shortcode($atts, $content = null){
- extract( shortcode_atts( array(
- 'title' => '',
- 'desc' => '',
- 'link_type' => 1,
- 'select_page' => '',
- 'link_address' => '',
- 'icon_type' => '',
- 'upload_icon' => '',
- 'pick_icon' => '',
- 'upload_background' => '',
- 'link_text' => 'See more',
- ), $atts) );
- if($link_type == 1) {
- $link_source = get_page_link($select_page);
- } else {
- $link_source = $link_address;
- }
- $service_box_bg = wp_get_attachment_image_src($upload_background, 'medium');
- $factorian_service_box_markup ='
- <div class="factorian-service-box">
- <div class="factorian-service-box-icon-table" style="background-image: url('.$service_box_bg[0].');">
- <div class="factorian-service-box-icon-tablecell">';
- if($icon_type == 1) {
- $icon_source = wp_get_attachment_image_src($upload_icon, 'thumbnail');
- $factorian_service_box_markup .='<img src="'.$icon_source[0].'" />';
- } else {
- $factorian_service_box_markup .='<i class="'.$pick_icon.'"></i>';
- }
- $factorian_service_box_markup .='
- </div>
- </div>
- <div class="factorian-service-box-content">
- <h3 class="factorain-service-box-title">'.$title.'</h3>
- '.wpautop($desc).'
- <a class="factorain-service-box-btn" href="'.$link_source.'">'.$link_text.'</a>
- </div>
- </div>
- ';
- return $factorian_service_box_markup;
- }
- add_shortcode('factorian_service_box', 'factorian_service_box_shortcode');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement