Tagged: SEO, woocommerce, title, alt
This topic contains 10 replies, has 3 voices, and was last updated by littlecas 3 months ago.
-
AuthorPosts
-
3 months, 1 week ago #1063648
I am trying to copy product title to image alt http://prntscr.com/lhz0hb. Please see my code:
add_filter('wp_get_attachment_image_attributes', 'change_attachement_image_attributes', 20, 2);
function change_attachement_image_attributes($attr, $attachment) {
global $post;
if ($post->post_type == 'product') {
$title = $post->post_title;
$attr['alt'] = $title;
$attr['title'] = $title;
}
return $attr;
}
But seems that it doesn't works. Help me pls with that.
3 months, 1 week ago #1063649This reply has been marked as private.3 months, 1 week ago #1063682Hi,
Thanks for contacting us.
Currently, we don't support to display title under product image as your desired. You need to change single product layout if you want to move title not only custom code.
Hopefully, you can understand it.
Best Regards,
NooTheme
3 months, 1 week ago #1063683No, no. I wanna set product image alt (meta alt) from the product title, please see my screenshot http://prntscr.com/li4mfg.
3 months, 1 week ago #1063692Please pay attention to it
3 months, 1 week ago #1063742Hi again.
To add product title to the product image on the single page, you can change the code at file
wp-content/plugins/noo-mebla-core/framework/woo_extensions.php line 100.
and change the code for alt "alt="<?php echo $image['alt']; ?>"" to the product title.
Please check it again.
Thanks.
Jackie.3 months, 1 week ago #1063746Yep your fix is active http://prntscr.com/lilcvj, but for now we have only meta title, meta alt field still empty, please see my screenshot http://prntscr.com/lildjg.
And this applies only for the new products, and how to make changes for old ones?
3 months, 1 week ago #1063799Ok problem is fixed. Thank you.
3 months ago #1063802This reply has been marked as private.3 months ago #1063850Guys, can you help me ?
3 months ago #1063928This topic is closed and moved to https://nootheme.com/forums/topic/woocommerce-product-image-meta-alt-text/
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.