• Hi everybody
    How do I add html code in functions.php?
    Code html:

    <a href="#"> Tooltip <span> <img class="callout" src="src/callout.gif" /> <strong>Most Light-weight Tooltip</strong> This is the easy-to-use Tooltip driven purely by CSS. </span> </a>

    Code functions.php

    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 = '<div class="avatar alignleft">ID).'" title="'.$title.'">'.$result.'</div>';
    }
    return $result;
    }
    }

    [please mark any posted according to the forum guidelines http://codex.wordpress.org/Forum_Welcome#Posting_Code – the above codes might be corrupted by the forum’s parser]

    I want to add the html code for the photo small (thumbnails)
    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You can’t add html directly to a PHP file.

    You will need to do some more research on how to implement what you want I can’t see that snippet of html doing jack

    Thread Starter olariu daniel

    (@olariu-daniel)

    Do you have an example on how a website can be done
    Thank you

    You are confused. It looks like you are trying to use a tooltip script and you heard that you need to insert some code into the functions.php file. That, I assure you, is not the code you actually need to put in the functions.php file. It is probably the markup you will need to have WordPress generate in the final output for the page you want to use it on. The code you need to put in functions is likely the code that sees the class “callout” and then runs on that.

    Looks like you jumped into the deep end of the pool here. I suggest hiring someone to create your site for you, take a class on PHP and/or WordPress theme development, or spend weeks doing the research on your own.

    If you are a do it yourself kind of person… buckle up. It’s a long ride. I’d highly suggest the PHP courses at lynda.com. Once you have a semi-solid grasp on PHP (and some MySQL), you should be able to trudge through learning how WordPress works.

    It is also possible, though not likely, that whoever created the tooltip code you want to use might be willing to help you or direct you to some very precise instructions.

    Suffice it to say that there are tons of basics you need to know before this forum will likely be of any help to you, unfortunately.

    Thread Starter olariu daniel

    (@olariu-daniel)

    Hi
    Example for the code http://www.menucool.com/tooltip/css-tooltip
    My site http://www.retete-super.ro
    I want to add this cod http://www.menucool.com/tooltip/css-tooltip for thumbnail thin red border in my site.
    No one knows yet how to do it
    I hope someone can help me
    Thank you wordpress.org for help

    You need to add the css to your style.css file in your theme.

    And every where you want a tooltip you need to add the markup like it says to each element you want a tooltip for:

    <a href="#" class="tooltip"> Tooltip <span> <img class="callout" src="src/callout_black.gif" /> <strong>Most Light-weight Tooltip</strong><br /> This is the easy-to-use Tooltip driven purely by CSS. </span> </a> <a href="#" class="tooltip"> <img src="../img/demo/css-tooltip-image.gif" /> <span> <img class="callout" src="src/callout_black.gif" /> <strong>CSS only Tooltip</strong><br /> <img src="../img/demo/css-tooltip-image.gif" style="float:right;" /> Pure CSS popup tooltips with clean semantic XHTML. </span> </a>

    The instructions for what to do are actually on the page you directed us to. It’s just that you don’t know enough about the different markup languages to even know that they are instructions.

    So here we go: Put the CSS code provided on that page at the bottom of your theme’s styles.css file. Then, when you create your posts, use the html editor, not the visual editor and put in the HTML code provided on that site.

    If that doesn’t make sense to you, or you want it to work differently than it does, refer to my earlier post for options about learning the different coding languages.

    A mne to that! (is that how you spell a men??)

    If that doesn’t make sense to you, or you want it to work differently than it does, refer to my earlier post for options about learning the different coding languages.

    Thread Starter olariu daniel

    (@olariu-daniel)

    I want to put all the small images with thin border the next tooltip text viewing picture
    How to integrate this code to thumbnail in my site http://www.retete-super.ro
    <a href="#"> Tooltip <span> <img class="callout" src="src/callout.gif" /> <strong>Most Light-weight Tooltip</strong> This is the easy-to-use Tooltip driven purely by CSS. </span> </a>
    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do I add html code in functions.php’ is closed to new replies.