Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 170

Home Forums Theme Support Cassiopeia Add alt tag to featured image in blog posts


Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3250

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    camel79
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi.
    Hope all is well.
    How can I add alt tag text to the featured image in the blog posts?

    I tried the following without success in the theme’s blog.php file:


    ">" alt="<?php echo $image_url['title']; ?>" title="" width="586" height="250" />

    I want to have the possibility to add the title text to the alt tag or, even better, the alt text to the alt tag.

    Let me know your comments.
    Thanks in advance.
    Regards.

    #3311

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi there,

    Here’s what you need to do:

    Go to the theme’s folder and edit the file named “blog.php”. Add this just after line 26:

    $image_title = get_post($image_id)->post_title;

    Now, add the image title like this:

    alt="<?php echo $image_title; ?>"

    Save. Done.

    Note: I didn’t test this method so I’m not 100% is working.

    Let me know how’s going.

    Cheers!
    Chris

    #3333

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    camel79
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Thank you Chris.

    I will test this method and let you know how’s going.

    Cheers,
    Fuad

    #3396

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    camel79
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi Chris,

    Hope all is well.
    I tested your method and it doesn’t work. I edited “blog.php” as you said and there was no change.
    Is it possible you can think of another method? I have no idea how to do it and the “alt” text is good for SEO.

    Thanks again.
    Cheers,
    Fuad

    #3428

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi there,

    Did you make sure your images alt attributes are inserted in the media uploader?

    Cheers!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.