GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress cloning image alt/title tags? (https://gfy.com/showthread.php?t=1064039)

Socks 04-09-2012 04:19 PM

Wordpress cloning image alt/title tags?
 
I usually write the same thing for alt/title tags, would be nice to just enter it in once and have it get used for both fields. Is there a plugin that does that? I don't want a generator, I just want to do it once per image rather than twice.

papill0n 04-09-2012 04:37 PM

seo image

Why 04-09-2012 05:02 PM

change the core code or change your template.

both are very easy, should take under a minute.

fris 04-09-2012 05:58 PM

Quote:

Originally Posted by Socks (Post 18875600)
I usually write the same thing for alt/title tags, would be nice to just enter it in once and have it get used for both fields. Is there a plugin that does that? I don't want a generator, I just want to do it once per image rather than twice.

you could make it use the post title for the alt and title tag for images.

fris 04-09-2012 06:08 PM

something like this maybe

Code:

function change_image_stuff($html) {
        global $post;
        $html = preg_replace('/(alt|title)=\"[^"]*"\s/','$1="'.$post->post_title.'" ', $html);
        return $html;
}

add_filter( 'post_thumbnail_html', 'change_image_stuff', 10 );
add_filter( 'image_send_to_editor', 'change_image_stuff', 10 );



All times are GMT -7. The time now is 11:02 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc