Code for alt tag
-
Can someone guide me on how to pull the alt tag from the database. I am currently using the title tag for the images alt=”<?php the_title(); ?>” but want to switch this to the alt tag for SEO purposes.. any ideas?
Here is the context in which it is used – using a custom field called banner.
<?php if(get_post_meta($post->ID, “banner”, true)!=”) { ?>
<img src=”<?php echo get_post_meta($post->ID, “banner”, true)?>” width=”695″ height=”240″ alt=”<?php the_title(); ?>” border=”0″/>
<?php } ?>Thanks
Liz
- The topic ‘Code for alt tag’ is closed to new replies.