WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] changing alt tag (10 posts)

  1. awkward_clam
    Member
    Posted 3 years ago #

    site is here:

    http://www.yourvancouvermortgagebroker.ca

    I'm trying to figure out how to change the alt tag on the featured images on the front page. It is by default changing them to the post title. The photos that I have uploaded have all the fields named "vancouver mortgage broker" but my question is where would I look to change the way this is automated?

    Thanks and Merry Christmas

  2. coopersita
    Member
    Posted 3 years ago #

    The alt can be changed in the picture uploader. Go here: http://en.support.wordpress.com/images/ and look at step 4.

  3. awkward_clam
    Member
    Posted 3 years ago #

    What I'm saying is that I've changed all of those fields to "Vancouver Mortgage Broker" but it's showing up on the page as the post title for some reason.

    Thanks

  4. coopersita
    Member
    Posted 3 years ago #

    Is this a sort of featured image you are setting for the slideshow? Or are they the images embedded in posts?

  5. awkward_clam
    Member
    Posted 3 years ago #

    Yeah, it's a featured image. So there is a featured.php in the editor..

  6. coopersita
    Member
    Posted 3 years ago #

    You are going to have to open the file, and find the line of code that loads the images, and change the part that sets the alt. It probably has it set to <?php the_title() ?>, change it to "vancouver mortgage broker".

    It's inside <div class="slide">.

    If you post here the code from <div class="slide"> to </div> <!-- end .slide --> I'll be able to help you further.

  7. awkward_clam
    Member
    Posted 3 years ago #

    Hey,

    <div class="slide">
    					<a>">
    						<?php
    						$post_title = get_the_title();
    
    						$thumbnail = get_thumbnail($width,$height,'thumb',$post_title,$post_title);
    						$thumb = $thumbnail["thumb"];
    
    						print_thumbnail($thumb, $thumbnail["use_timthumb"], $post_title, $width, $height, 'thumb'); ?>
    					</a>
    					<div class="description">
    						<h2><a>"><?php truncate_title(27); ?></a></h2>
    
    						<?php $tagline = get_post_meta($post->ID, 'Tagline', true);
    						if ($tagline != '' ) { ?>
    							<p class="tagline">“<?php echo($tagline) ?>”</p>
    						<?php } ?>
    
    						<p><?php truncate_post(375);?></p>
    
    					</div> <!-- end .description -->
    				</div> <!-- end .slide -->

    So there are a few $post_titles, not sure which one to change. Thank you so much.

  8. coopersita
    Member
    Posted 3 years ago #

    I think the line you need to change is this:

    $post_title = get_the_title();

    get_thumbnail and print_thumbnail are not a standard WordPress functions (at least none that I could find). Probably a plugin.

    My guess is that you could change it so that it uses your text, like this:

    $post_title = "your text here";

    If that's not it, you should contact the plugin developers, and ask them.

    Hope this helps.

  9. awkward_clam
    Member
    Posted 3 years ago #

    Nice, that did it. I was afraid it was going to change the actual post title.

    Cheers,

    Thanks a ton, you were really helpful this whole time.

    J

  10. coopersita
    Member
    Posted 3 years ago #

    No problem!

    PS: Please change the status to "Resolved"

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.