Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to add a tooltip Re: How to add a tooltip

#126684
dani555
Participant

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 = ‘‘;
}
}
}
if($result !== ”){
$result = ‘

‘;
}
return $result;
}
}>
At each image thumbnail viewer want to defend the text picture
Thanks to all