Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Cannot get alt text working

No matter how many times I stare at my code, it looks to me like it's the exact same as the code in the video. I can't figure out why my alt text won't show up. Here's my code:

        <?php 
          $thumbnail_id = get_post_thumbnail_id(); 
          $thumbnail_url = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail-size', true );
          $thumbnail_meta = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
        ?>

        <a href="<?php the_permalink(); ?>"><img src="<?php echo $thumbnail_url[0]; ?>" alt="<?php echo $thumbnail_meta; ?> featured image"></a>

2 Answers

Help me out, where is the video at?

Sorry, this should have been in WordPress. It's from the Bootstrap to Wordpress course and the video, "Finishing Up Our Bootstrap Slideshow Carousel." I thought it would have been posted under the topic for that exact video when I created that.