Thank you, I’m glad you are liking Meteor Slides!
The title is automatically added to the slide images by WordPress, you would have to use JavaScript to remove them. But you can also change the content of these titles by editing the slide images in the media library and changing the image title.
Thread Starter
JRDLtd
(@jrdltd)
I need it to be blank and WordPress won’t allow that. I guess it will have to be done with JavaScript as you said.
Could you make an example script please? I am sure I could figure it out but I am not the fastest JS coder so if I had an example to work from it would be a real help.
Thanks.
There’s a plugin that you might be able to use. Or take a look at some of these options.
I would suggest using css to bump the title off of the screen.
use text-indent:-9999px;
This should get rid of the title and still leave it available for screen readers and SEO.
I will test this idea, if not I will go the javascript route and post that solution.
Thread Starter
JRDLtd
(@jrdltd)
@jleuze, Thanks that second option looks like it would work.
@adaptive Design, css can affect the title attribute? Thanks I may try that.
Thread Starter
JRDLtd
(@jrdltd)
Using css did not work for me.
Using the javascript jQuery method did. I added this code:
<script type="text/javascript">
jQuery(document).ready(function($) {
$('img[title]').each(function() { $(this).removeAttr('title'); });
});
</script>
To the end of the custom template file “meteor-slideshow.php” after:
</div><!-- .meteor-slides -->
Thanks for all your help! π
Awesome, glad you got it figured out!
Hello !
I have the same problem (I want to remove the attribute title on the pics) but I can’t code at all so I don’t know where to put the bit of code you gave ! Can you please specify ?
Cheers,
Thomas
Hi Thomas, you can do this in an easier way now with a custom slideshow template. Here is a post that explains how to do it.
Thanks for your answer JLeuze ! I don’t really understand how that works though. I’m not sure it’s for the same problem exactly : what I want to do is remove the attribute “title” from the image, not add a title to my slides.
By the way, it would be cool if I could also set the “alt” attribut for SEO (right now it takes the name of the image and I don’t see how I can change that)
You need to use a custom slideshow template, but you can ignore that example about adding titles. You just need to follow the instructions in this post:
http://wordpress.org/support/topic/how-do-i-hide-the-alt-text-on-slide-images?replies=7#post-2457311
You can set the alt text in the media library by editing the slide image’s metadata, but if you are editing the image tags anyways, an easier method would be to use the slide post’s title as the alt text so that you can edit it right from the slide posts.
Here is an example that would do that:
<?php // Get just the URL for the slide featured image
$featuredslide = wp_get_attachment_image_src( get_post_thumbnail_id($GLOBALS['post']->ID), 'featured-slide' ); ?>
<?php // Adds slide image with Slide URL link
if ( get_post_meta( $post->ID, "slide_url_value", $single = true ) != "" ): ?>
<a href="<?php echo get_post_meta( $post->ID, "slide_url_value", $single = true ); ?>"><img src="<?php echo esc_attr($featuredslide[0]); ?>" alt="<?php the_title(); ?>" /></a>
<?php // Adds slide image without Slide URL link
else: ?>
<img src="<?php echo esc_attr($featuredslide[0]); ?>" alt="<?php the_title(); ?>" />
<?php endif; ?>
Worked perfectly, sorry for not having read thoroughly the post you mentionned before… (I always get a bit scared when I see php lines π )
I copied the file meteor-slide.php in the “root” of my theme directory (where there is the index.php file). I’m using Suffusion theme, so I put it in the folder “Suffusion”. Is that correct ? (there are some subfolders to this folder such as “admin”, “custom”, “functions” etc, I was wondering if I had to put “meteor-slide.php” in one of those ?
Thanks a lot for you help and great pluggin !
Thomas
No problem Thomas, that’s right the custom template file goes in the root of your theme.