WordPress.org

Ready to get started?Download WordPress

Forums

PNG image files - Recognition Problem (7 posts)

  1. sodafizz
    Member
    Posted 8 years ago #

    http://featuringdave.com/logicalmeme/

    On my comments template, the PNG images for “submit comment� are not being recognized in browsers. (One gets the red X image in IE and the text “submit query� in Firefox).

    I have the two image files (submit.png, submit_over.png) in the proper directory. Here’s the relevant section of my Comments template:

    <input name="submit" type="image" id="submit" tabindex="5" src="<?php bloginfo(?stylesheet_directory?); ?>/img/submit.png" onmouseover="this.src="<?php bloginfo(?stylesheet_directory?); ?>/img/submit_over.png" onmouseout="this.src="<?php bloginfo(?stylesheet_directory?); ?>/img/submit.png" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

    Any idea why it wouldn’t be working?

  2. niziol
    Member
    Posted 8 years ago #

    This: <?php bloginfo(?stylesheet_directory?); ?> needs to be like this: <?php bloginfo('stylesheet_directory'); ?> or if that doesn't work, hard-code an absolute path or something, the image path is the problem, following it leads to a 404.

    Good luck,
    Michael.

  3. billh
    Member
    Posted 8 years ago #

    Also remember if you are going to have transparencies in your PNG files, IE will NOT recognize that. All other browsers (well, those not based on IE) will handle PNG transparencies just fine.

  4. vkaryl
    Member
    Posted 8 years ago #

    IE can handle 8-bit in pngs. Just not 24-bit. And if anyone really wants a workaround for that, check out http://koivi.com/ie-png-transparency/

  5. sodafizz
    Member
    Posted 8 years ago #

    I tried Niziol's suggestion, but I'm now getting the following parsing error when trying to create a comment:

    Parse error: parse error, unexpected '?', expecting ')' in /home/content/s/o/d/sodafizz/html/logicalmeme/wp-content/themes/blueband3/comments.php on line 72

    I've tried changing the ' mark back to a ? mark, but to no avail. I'm still getting the parsing error message...

    I'll restore my backup 'comments' file when I go home tonight, but I still can't figure out why the PNG file does not read in even Firefox.

  6. Kafkaesqui

    Posted 8 years ago #

    The error relates to niziol's suggestion and means you missed something when changing ? to ' around the bloginfo() parameter 'stylesheet_directory'. Your images do not display because the path to them is incorrect.

    If you continue to have problems, copy the source of your comments template (comments.php) to:

    http://paste.uni.cc

    and reply with the url to it.

  7. moshu
    Member
    Posted 8 years ago #

    Based on the quotes you posted in the OP the first question that comes up is: what text editor are you using to edit your template files?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags