Support » Themes and Templates » Trying To Fix A Simple ALT Tag Problem (Thanks To Anyone That Assists)

  • I have a (probably simple) question.

    Our site is located:

    On our opening page, we have the thumbnails that are of course 80 x 80 pixels. When you put your mouse over the top of them, they display an ALT Tag. Simple enough to understand so far.

    Now, when you go to that page to view the post, for example:

    You will see a larger image at the top, its dimensions being 581 x 180

    The problem is that no ALT Tag is working when we mouse over the image.

    The front page is obviously edited on the index.php page and the post page is edited on the single.php page.

    The code does look the same for both, but it does not work in this theme by default. Can anyone tell me what code needs to be fixed on the single page so that it displays the ALT Tag like it does on the front page?

    Thanks to anyone that takes a moment to post a fix.

    The code that appears to handle this from the index.php page is:

    <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=<?php echo $thumbheight ?>&w=<?php echo $thumbwidth ?>&zc=1&q=80" alt="<?php the_title(); ?>" /></a>

    The code that does not appear to be working at this time on the single.php page is:

    <div id="main-post-image-container" class="box">
    	<div class="main-post-image-inner">
    		<img class="box" src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=180&w=581&zc=1&q=80" alt="<?php the_title(); ?>" />
    		<h3><span>Sitewide Article Views: <?= simplehitcounter_hit(); ?></span>Posted on <?php the_time('l, F jS, Y') ?></h3>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Mark Ratledge


    Forum Moderator

    Don’t know if this is enough to cause it, but you’re missing the opening “php” in your hitcounter function. I think it should be <?php simplehitcounter_hit(); ?> and I’m not sure if the = sign belongs in it, either. Might be enough to throw an error in the div and affect the alt tag.

    Roger that, let me test that out.

    Negative, that made the whole counter stop, and did not make the ALT tag start working. Thanks for the idea songdogtech.

    Back to the drawing board lol.

    If anyone else can chime in, THANK you.

    Nice looking site!

    It’s the link title that is being displayed, not the alt tag.

    On your homepage:
    <a title=”PVS-14 Review” href=”http://www.gunreviews….

    The code that makes the title:
    <a title="<?php the_title(); ?>"

    (edited to add backticks per songdogtech’s suggestion. 🙂 Thanks songdogtech.)

    Moderator Mark Ratledge


    Forum Moderator

    jrav001, You’re right; I missed the obvious. Jeez.

    Change alt="<?php the_title(); ?>"


    title="<?php the_title(); ?>" alt="image"

    If you put backticks around your code, it will display correctly in these threads.

    Excellent. You guys are very appreciated. It worked perfectly that way. Thank you very much, I greatly appreciate you guys.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trying To Fix A Simple ALT Tag Problem (Thanks To Anyone That Assists)’ is closed to new replies.