Support » Plugins » Help with missing ALT attributes!

  • I’m struggling to get the image ALT attributes to appear in my image tags…. This is on a portfolio page which generates thumbnails which in turn link to the full-size versions. Here is the code I am currently using:

    Template Name: GridFolio Portfolio
    	<?php get_header(); ?>
    				.ib-main a{
    						<div id="ib-main-wrapper" class="ib-main-wrapper">
    							 <div class="ib-main">
    						$category = gf_get_category_id(get_option('gf_portfolio_category'));
    						$categories = get_categories('child_of='.$category);
    						$ppp = 10000;
    						if (get_option('gf_portfolio_nav')) {
    						if (!empty($categories)) {
    							if (isset($_GET[pcat])) {
    								$pcat = $_GET[pcat];
    							else { $addtoclass = " class=\"active\""; }
    					<div class="portfnav">
    							<li><span>Filter: </span></li>
    							<li<?=$addtoclass; ?>><a href="<?php echo get_permalink(); ?>">All</a></li>
    							<?php gf_list_portfolio_child_categories($category,$pcat,get_permalink()); ?>
    								<?php } }?>
    						$category = ($pcat) ? $pcat : $category;
    								while ($wp_query->have_posts()) : $wp_query->the_post();
    							$do_not_duplicate = $post->ID;
    							$thumb_small= get_post_meta($post->ID, 'thumb-small', true);
    							$thumb_large = get_post_meta($post->ID, 'thumb-large', true);
    							$alt_text = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
    							if (empty($thumb_small)) { continue; }
    							else { ?>
    													 <article class="data-largesrc"><img src="<?php echo $thumb_small; ?>" data-largesrc="<?php echo $thumb_large; ?>" alt="<?php echo $alt_text; ?>"/><span><?php the_title() ?> </span>
    								<?php }
    						endwhile;  ?>
    				<?php get_footer(); ?>

    This does not work – the ALT attribute fields are empty in all the images. (I have written the ALT entries into the Media Library!)

    Would be really grateful if someone can tell me where I’m going wrong!

    Thanks in advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Help with missing ALT attributes!’ is closed to new replies.