treehouse : what would you like to learn today?
Web Design Web Development iOS Development

How to add a tooltip

  • Hi everybody How can I add a tooltip for all images as small thumbnails My Site All the small images I want to appear in the same text picture Viewer I don't know how it can be done with a plugin or code Can someone help me Thank you!

  • Hi Hugo Giraudel Thanks for the site How should I do for my site How to edit my site I want the text to appear in print exactly as in the picture example For all small pictures thumbnails Thank you!

  • You can create new element with absolute position, get user mouse coords and attach it to mouse with some margins when your image is hovered.

  • Hi everybody What code to put in the css style How to edit the functions.php In functions.php I have following code

    if (!function_exists('theme_get_post_thumbnail')){ function theme_get_post_thumbnail($args = array()){ global $post;

      $size = theme_get_array_value($args, 'size', array(theme_get_option('theme_metadata_thumbnail_width'), theme_get_option('theme_metadata_thumbnail_height')));
      $auto = theme_get_array_value($args, 'auto', theme_get_option('theme_metadata_thumbnail_auto'));
      $featured = theme_get_array_value($args, 'featured', theme_get_option('theme_metadata_use_featured_image_as_thumbnail'));
      $title = theme_get_array_value($args, 'title', get_the_title());
    
    
      $result = '';
    
      if ($featured && (function_exists('has_post_thumbnail')) && (has_post_thumbnail())) {
        ob_start();
        the_post_thumbnail($size, array('alt' =>  '', 'title' =>  $title));
        $result = ob_get_clean();
      } elseif ($auto) {
        $attachments = get_children(array('post_parent' =>  $post->ID, 'post_status'  =>  'inherit', 'post_type'  =>  'attachment', 'post_mime_type'  =>  'image', 'order'  =>  'ASC', 'orderby'  =>  'menu_order ID'));
        if($attachments) {
          $attachment = array_shift($attachments);
          $img = wp_get_attachment_image_src($attachment->ID, $size);
          if (isset($img[0])) {
            $result = '<img src="'.$img[0].'" alt="" width="'.$img[1].'" height="'.$img[2].'" title="'.$title.'" class="wp-post-image" />';
          }
        }
      } 
      if($result !== ''){
        $result = '<div class="avatar alignleft"><a href="'.get_permalink($post->ID).'" title="'.$title.'">'.$result.'</a></div>';
      }
      return $result;
    }
    

    }> At each image thumbnail viewer want to defend the text picture Thanks to all

  • Does anyone know how to make 3 weeks all I'm looking for Thank you!

  • Hi everybody I created a tooltip for my site Site link How to add html code for thumbanil Example Code Html p a class="hint--left hint--warning" data-hint="This is a warning tooltip">You did something wrong!

    I want to appear text for images thumbnails 150x150 px in home page Thank you