• Resolved awkward_clam

    (@awkward_clam)


    site is here:

    https://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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The alt can be changed in the picture uploader. Go here: https://en.support.wordpress.com/images/ and look at step 4.

    Thread Starter awkward_clam

    (@awkward_clam)

    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

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

    Thread Starter awkward_clam

    (@awkward_clam)

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

    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.

    Thread Starter awkward_clam

    (@awkward_clam)

    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.

    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.

    Thread Starter awkward_clam

    (@awkward_clam)

    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

    No problem!

    PS: Please change the status to “Resolved”

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘changing alt tag’ is closed to new replies.