WordPress.org

Ready to get started?Download WordPress

Forums

Adding images with Dreamweaver (4 posts)

  1. LuckyGuyToday
    Member
    Posted 5 months ago #

    I have spent the last 4 days searching the web trying to figure this out for myself before posting but have not had success and I'm at my wits end.

    I am completely new to WP and my web designer skills are average on Dreamweaver. I use Dreamweaver for the WYSIWYG design. I have created HTML sites in the past without fail...until now.

    In order to get a feel for WP I created a very basic site. When I say "basic", I mean as basic as it gets. A simple red background with the word "hello" in black font. When I attempt to add an image it does not appear on the site even though it appears in my designer view. The image is located within the theme folder I am working in. I have gone as far as working with the free themes which are included and the image appears fine when I change the url in the style.css file.

    I have tried this on both a local server as well as a hosted service. The only 2 files in my theme folder are the index.php and the style.css which I read in various places are required files. The style.css just has the required template information /* commented out */. The style sheet data is within the index.php as that's how Dreamweaver functions by default.

    Because the site is basic no php code is required but I added it in the event it might resolve the issue but it didn't.

    Does anyone have a clue as to what the problem may be and how I can fix it? Here's my code in the event it helps:

    ----------------------------------------------------------------
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>

    <head>
    <meta charset="<?php bloginfo('charset'); ?>" />

    <?php if (is_search()) { ?>
    <meta name="robots" content="noindex, nofollow" />
    <?php } ?>

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">

    <title>Untitled Document</title>
    <style type="text/css">
    body,td,th {
    color: #000;
    }
    body {
    background-color: #C00;
    }
    </style>
    <link href="style2.css" rel="stylesheet" type="text/css" media="all">
    </head>

    <body>
    <p><img src="Logo_small.jpg" alt="logo_alt_text" name="SLHlogo" width="154" height="119" id="SLHlogo">
    </p>
    <p>Hello</p>
    </body>
    </html>
    ---------------------------------------------------------------------

    Thanks in advance for your support!

  2. Sleneau
    Member
    Posted 5 months ago #

    Are you working locally? Is the image file in the same folder as the file you're coding? Sometimes, relative paths won't work in wordpress themes, and you need to find the absolute URL of an image. To do that, read the following article.

    http://www.brightcherry.co.uk/scribbles/wordpress-get-image-path-relevant-to-theme/

    Beyond that, there isn't much I can think of to suggest, unless I can take a look at the site somehow. Good luck! (Also, lynda.com and the documentation on this site are superb for learning more about how to use wordpress, if you're just starting out).

  3. LuckyGuyToday
    Member
    Posted 5 months ago #

    Sleneau, that was the problem. Thank you kindly for your assistance!

  4. Sleneau
    Member
    Posted 5 months ago #

    Glad to help

Reply

You must log in to post.

About this Topic