vc-logo.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*------------------------------------------------------*/
  3. /* taskereasy Heading
  4. /*------------------------------------------------------*/
  5. vc_map(array(
  6. "name" => esc_html__("Clients", 'taskereasy'),
  7. "base" => "taskereasy_logo_carousel",
  8. 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
  9. "class" => "",
  10. "description" => esc_html__("Add taskereasy client logo carousel", 'taskereasy'),
  11. "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
  12. "params" => array(
  13. array(
  14. "type" => "attach_images",
  15. "heading" => esc_html__("Images", 'taskereasy'),
  16. "param_name" => "images",
  17. ),
  18. array(
  19. 'type' => 'css_editor',
  20. 'heading' => esc_html__( 'CSS', 'taskereasy' ),
  21. 'param_name' => 'custom_design',
  22. 'group' => esc_html__( 'Design options', 'taskereasy' ),
  23. )
  24. )
  25. ));
  26. add_shortcode( 'taskereasy_logo_carousel', function($atts, $content = null) {
  27. extract(shortcode_atts(array(
  28. 'images' => '',
  29. 'custom_design' => '',
  30. ), $atts));
  31. $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
  32. $image_ids = explode(',', $images);
  33. $image_no = 1;
  34. $output = '';
  35. $output .=' <div id="partners">
  36. <div class="partners-logo">
  37. <div class="owl-carousel">';
  38. foreach( $image_ids as $image_id ){
  39. $images = wp_get_attachment_image_src( $image_id, 'thumbnail' );
  40. $output .=' <div class="item"> <img src="'.esc_url($images[0]).'" alt="image"> </div>';
  41. $image_no++;
  42. }
  43. $output .=' </div></div>
  44. </div>';
  45. return $output;
  46. });