Title: how to add html code to functions.php
Last modified: August 20, 2016

---

# how to add html code to functions.php

 *  [olariu daniel](https://wordpress.org/support/users/olariu-daniel/)
 * (@olariu-daniel)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-add-html-code-to-functionphp/)
 * Hello
    How to add html code into functions.php for thumbnail images [ Tooltip <span> <img class=”callout” src=”src/callout_black.gif” /> **Most Light-weight Tooltip** This is the easy-to-use Tooltip driven purely by CSS. </span> ](https://wordpress.org/support/topic/how-to-add-html-code-to-functionphp/?output_format=md#)
   [ <img src=”../img/demo/css-tooltip-image.gif” /> <span> <img class=”callout” src=”src/callout_black.gif” /> **CSS only Tooltip** <img src=”../img/demo/css-tooltip-image.gif” style=”float:right;” /> Pure CSS popup tooltips with clean semantic XHTML. </span> ](https://wordpress.org/support/topic/how-to-add-html-code-to-functionphp/?output_format=md#)
   [My site](http://www.retete-super.ro) [http://www.retete-super.ro](http://www.retete-super.ro)
   Functions.php 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” />’; } } } Thank you

The topic ‘how to add html code to functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [olariu daniel](https://wordpress.org/support/users/olariu-daniel/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-add-html-code-to-functionphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
