Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #1042


    First of all I want to thank you for this great theme.

    I’ve a problem with ALT/TITLE for images in index and in portfolio pages, analyzing php files seems that images have ALT=””, this could be a problem for SEO.

    I’ve tryed to make myself the modification, but without good results as in Blog page there is the function title=”<?php the_title(); ?>”, but this doesn’t works in other pages.

    Is there a way to update the theme to support Image Title/Alt in all pages as in Blog page?

    Thanks a lot for your assistance.

    If needed, here my website with AMPLIFY Theme http://www.roccocaprella.com


    You can also use functions like <?php bloginfo('name'); ?> or <?php bloginfo('description'); ?> to achieve what you want. Maybe <?php the_title(); ?> doesn’t work for you in certain cases because you’re editing php code.So what I mean is following:

    The code:

    <?php echo '<img src="xy.png" alt="" title="" />'; ?>

    doesn’t allow you to write title="<?php the_title(); ?>" but instead you need to combine the string with a function like:

    <?php echo '<img src="xy.png" title=" '. the_title(); . ' " alt=" '. bloginfo('description'); . ' " />'; ?>

    The Dude


    Thanks a lot, but I’ve some problems to insert your code.

    I think that, for Portfolio page, I have to modify this string:

    echo'<div class=”feature_image_container”><div class=”imgwrap”></div></div>';


    Can you help me hot to modify in the right way ALT and insert TITLE?

    Thanks again for your support.


    Yes i.e. for your example you need to modify this code

    echo'<div class="feature_image_container"><div class="imgwrap"><a '.$link.'><img src="'.$preview_pic_mainpage.'" alt=""/></a></div></div>';


    echo'<div class="feature_image_container"><div class="imgwrap"><a '.$link.'><img src="'.$preview_pic_mainpage.'" title="'. the_title();.'" alt="'. bloginfo('description');."'/></a></div></div>';

    The Dude



    I’ve inserted your code replacing the original one, but now I have a syntax error:

    Parse error: syntax error, unexpected ‘.’ in /web/htdocs/www.roccocaprella.com/home/wp-content/themes/amplify/template_portfolio.php on line 62



    Sorry, stupid mistake. I forgot to remove the “;” after the functions.

    So here’s the correct code:

    echo'<div class="feature_image_container"><div class="imgwrap"><a '.$link.'><img src="'.$preview_pic_mainpage.'" title="'. the_title().'" alt="'.bloginfo('description').'"/></a></div></div>';

    The Dude


    Ok, now works! Thanks!

    There is a strange behavior, the code works, but instead of showing ALT/TITLE on the image, put these on the top of image, here you can see how this works:


    For ex., in the first article you’ll see “Training e CorsiSony Certified Vegas Trainer” (Title and Bloginfo) on the top of image, instead of in the image as tooltip.

    Thanks a lot for your support.



    Yes I just realized that myself on the test server :-).

    It’s such a strange behaviour and I don’t know why. I even tested to declare variables first but that didn’t change anything.

    The Dude


    Ok, thanks!

    I’ll wait news.

    Ciao ;)


    Ok I solved the problem myself ;-)

    I used the wrong function before, please use this code:

    echo'<div class="feature_image_container"><div class="imgwrap"><a '.$link.'><img src="'.$preview_pic_mainpage.'" title="'.get_the_title().'" alt="'.get_bloginfo(description).'"/></a></div></div>';

    It should work now. You can replace get_bloginfo(description) with any function you like, i.e. get_the_title(). Here are some examples: http://codex.wordpress.org/Function_Reference/get_bloginfo and http://codex.wordpress.org/Template_Tags/get_the_title

    The Dude


    G R E A T

    Now all works. Thank you so much!!!!

    Ciao :)

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘AMPLIFY – No ALT/TITLE for images in home and in portfolio pages’ is closed to new replies.