Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Pictures + Alt Text (http://forum.bytesforall.com/showthread.php?t=18973)

Thierry85 Nov 26, 2012 01:37 PM

Pictures + Alt Text
 
Hello

I have a question about pictures because it seems that the home, category, archives and tags page does not show the titles and alt text which are essential for seo.

Title and alt text are available but only on single page...

juggledad Nov 26, 2012 04:53 PM

multi post pages display excerpts of the posts. Following Wordpress lead, all html is stripped from an excerpt hence what you experience.

Thierry85 Nov 27, 2012 04:23 AM

Hello juggledad and thanks for your reply :)

Go to this website with www.investir-et-reussir.fr and you will see that images of my homepage does not have alt text

juggledad Nov 27, 2012 09:33 AM

I have created an enhancement request RFE 013-06: have bfa_thumb return title and 'alt' text and notified the developer

darkcrizt Dec 22, 2012 09:11 AM

Hi I was also in the same situation as you can use the titles of the entries in the images as alt agregre only a function in functions.php and edit some lines thumb.php
PHP Code:

//alt imagen by darkcrizt
function add_rel_lightbox($content)
{
    
//Comprueba en la pagina los enlaces directos a las imagenes (sin los atributos)
    
$string '/<a href="(.*?).(jpg|jpeg|png|gif|bmp|ico)"><img(.*?)class="(.*?)wp-image-(.*?)" \/><\/a>/i';
    
preg_match_all$string$content$matchesPREG_SET_ORDER);
    
//Comprueba si el adjunto tiene refetencia
    
foreach ($matches as $val
    {
        
$slimbox_caption '';
        
$post get_post($val[5]);
        
$slimbox_caption esc_attr$post->post_content );
        
//Sustituye al instancia con el Lightbox y las refetencias. No fallará si leyenda está vacía.
        
$string '<a href="' $val[1] . '.' $val[2] . '"><img' $val[3] . 'class="' $val[4] . 'wp-image-' $val[5] . '" /></a>';
        
$replace '<a href="' $val[1] . '.' $val[2] . '" ><img' $val[3] . 'class="photo thumb ' $val[4] . 'wp-image-' $val[5] . '" itemprop="photo" rel="v:photo" alt="'.get_the_title().'"/></a>';
        
$content str_replace$string$replace$content);
    }
    return 
$content;
}
/* Filter Hook */
add_filter('the_content''add_rel_lightbox'2); 

in thumb.php looking for this line

PHP Code:

$bfa_thumb .= '<img src="' $thumbimage['url'] . '" width="' $thumbimage['width'] . '" height="' $thumbimage['height'] . '" />
            <span></span>'


and change it to this

PHP Code:

/* alt in images by darkcrrizt - seo */
$bfa_thumb .= '<img rel="v:photo" itemprop="image" class="photo" src="' $thumbimage['url'] . '" width="' $thumbimage['width'] . '" height="' $thumbimage['height'] . '" alt="'.get_the_title().'" />
            <span></span>'




All times are GMT -6. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.