Jump to content

Recommended Posts

Posted

Hi I cant get alt tags to work with image description.

$content .= "<a href='$large->url' class='thumb-roll'> <img src='$thumb->url' alt='$image->description' /></a>";

873599264_ScreenShot2019-10-03at17_23_16.png.dc17dd8ae7988dc7a72669e33d6a2998.png

Thanks for any help.

Posted
$content .= "<a href='$large->url' class='thumb-roll'> <img src='$thumb->url' alt='$image->description' /></a>";

How does your code before that part looks like?

I guess you already tried $large->description and $thumb->description. Correct?

Are descriptions set?

Posted

The thumbnails alt tag is working fine now but how would I set the large image alt that it links too

foreach ($page->images as $image) {
        $large = $image->width(1000);
        $thumb = $image->size(400, 400);
        $content .= "<a href='$large->url' class='thumb-roll'> <img src='$thumb->url' alt='$thumb->description' /></a>";
    }

Posted

You wouldn't.

Just use $image->description as it's the actual image which has a description. Your thumb and large variations or just that. Variations of the original image.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...