WordPress.org

Ready to get started?Download WordPress

Forums

i cant use <img> tags in a theme??? (5 posts)

  1. danoob32
    Member
    Posted 5 years ago #

    Im new to wordpress themes, Im trying to design a theme but it seems that the themes dont allow you to use <img> tags (for example, using an img tag for the logo)... it appears like a broken link.

    Is there something wrong in my code or simply something i dont know about wordpress themes?

  2. SimonJ
    Member
    Posted 5 years ago #

    You can definitely use <img> tag in a template file, along with any html tag.

    The path to your images is probably wrong. You have to point your theme folder.

    If you could give us an url or any example of what you're trying to do, we will give you a solution.

    S.

  3. danoob32
    Member
    Posted 5 years ago #

    I pointed the images to the theme folder but take a look to what happens

    http://www.flickr.com/photos/26042217@N06/3470568647/

  4. SimonJ
    Member
    Posted 5 years ago #

    This image is totally useless for us

    We need the link to your site...

    S.

  5. SimonJ
    Member
    Posted 5 years ago #

    Ok... I managed to zoom the image to see your code.

    If your images directory is in the theme folder, you must use something like:

    <img src="<?php bloginfo('template_directory'); ?>/images/yourimage.jpg" alt="" />

    <?php bloginfo('template_directory'); ?> generate the complete path to your theme directory... If your image are in a sub folder in your theme, then you add it :

    <?php bloginfo('template_directory'); ?>/images/

    On the html side, it will output :

    <img src="http://www.yourdomain.com/wp-content/themes/yourtheme/images/yourimage.jpg" alt="" />

    S.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.