| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Team carsouel", 'taskereasy'),
- "base" => "taskereasy_team",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy Team members", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- /* array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Background overlay', 'taskereasy' ),
- 'param_name' => 'bg_color'
- ),*/
- array(
- 'type' => 'param_group',
- 'heading' => esc_html__( 'Team Members', 'taskereasy' ),
- 'param_name' => 'team_members',
- 'params' => array(
- array(
- "type" => "textfield",
- "heading" => esc_html__("Name", 'taskereasy'),
- "param_name" => "name",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Position", 'taskereasy'),
- "param_name" => "position",
- ),
- array(
- 'type' => 'attach_image',
- 'heading' => esc_html__( 'Image', 'taskereasy' ),
- 'param_name' => 'team_image'
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Image Size", 'taskereasy'),
- "param_name" => "image_size",
- "description" => 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).'
- ),
-
- )
- ),
-
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html__( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html__( 'Design options', 'taskereasy' ),
- )
- )
- ));
- add_shortcode( 'taskereasy_team', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'name' => '',
- 'position' => '',
- 'team_image' => '',
- 'custom_design' => '',
- ), $atts));
-
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- /* $image_url = html_entity_decode(vc_value_from_safe($team_image, true));
- $img_size = html_entity_decode(vc_value_from_safe($image_size, true));
- $imageurl = wp_get_attachment_image_src( $image_url, $img_size );*/
- $team_members = vc_param_group_parse_atts( $atts['team_members'] );
- $output = '';
- $count = 0;
- $output .= '<div class="owl-carousel">';
- foreach ($team_members as $member) {
- $img_url = $team_members[$count]['team_image'];
- $img_size = isset($team_members[$count]['image_size']);
- $imgurl = wp_get_attachment_image_src($img_url, $img_size );
- //$output .= $imgurl[0];
- $output .='
- <div class="item">
- <div class="team-wrap">
- <div class="team-img"> <img src="'.$imgurl[0].'" alt="image"> </div>
- <h5>'.$team_members[$count]['name'].'</h5>
- <p>'.$team_members[$count]['position'].'</p>
- </div>
- </div>
- ';
- $count++;
- }
- $output .= '</div>';
- return $output;
- });
|