Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Josh Leuze

    (@jleuze)

    You can change the alt text, but you can’t remove it unless you want to use JavaScript to disable tool tips.

    Hi all, would it be possible to delete the title-tag and the alt-tag from the sourcecode? Where can I find the code for that? Thanks!

    ALT attribute is important part of search engine optimization. It describes your images to search engine and when a user searches for a certain image this is a key determining factor for a match.

    TITLE attribute play lesser role but is important for visitors as this text will automatically appear in the tooltip when mouse is over the image.

    https://www.ads-software.com/extend/plugins/seo-image/

    Plugin Author Josh Leuze

    (@jleuze)

    If you’re concerned about SEO, writing good alt and title text can help, but if you don’t want them at all you can remove them using a custom slideshow template.

    Because the_post_thumbnail function for the slide images loads the whole image tag, you can’t edit it. But you can make your own image tag without an alt or title tag using the URL of the slide image.

    Here is the code you need to do this. This replaces everything within the “mslide” div container which starts on line 103:

    <?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="" /></a>
    
    <?php // Adds slide image without Slide URL link
    
    else: ?>
    
    	<img src="<?php echo esc_attr($featuredslide[0]); ?>" alt="" />
    
    <?php endif; ?>

    thank you!

    Plugin Author Josh Leuze

    (@jleuze)

    No problem!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I hide the alt text on slide images?’ is closed to new replies.