How to fix no img attribute from this code
-
I’m having a lot of trouble getting the code below to echo either the profile title or just a manual text “profile image” as the image attribute.
<a class="bs-author-pic mb-3" href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php echo get_avatar( get_the_author_meta( 'ID') , 150); ?></a> This code derive from page article where it shows the author image. i.e https://sopriza.com/men-should-never-ignore-these-5-symptoms/
-
Yes, I am aware that if users are given the option to enter alt text, some may do so in an abusive manner. For the time being, we’ve adjusted the php script to generate the alt automatically, thus there are no longer any SEO problem with alt images.
-
I’m having a lot of trouble getting the code below to echo either the profile title or just a manual text “profile image” as the image attribute.
<a class="bs-author-pic mb-3" href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php echo get_avatar( get_the_author_meta( 'ID') , 150); ?></a>
This code derive from page article where it shows the author image. i.e https://sopriza.com/men-should-never-ignore-these-5-symptoms/
@Sala you’re missing the
alt
attributeSee below for a basic example
https://www.w3schools.com/tags/att_img_alt.asp -
@Sala you’re missing the
alt
attributeSee below for a basic example
https://www.w3schools.com/tags/att_img_alt.asp@phenomlab thanks for quick reply, my problem is how can i deploy the alt attribute inside the code above?
-
@phenomlab thanks for quick reply, my problem is how can i deploy the alt attribute inside the code above?
@Sala you can either use a WordPress plugin to do it for you, or a jQuery function. How is the image being uploaded?
-
@Sala you can either use a WordPress plugin to do it for you, or a jQuery function. How is the image being uploaded?
@phenomlab The image is being uploaded using an inbound, right from the registration form
-
@phenomlab The image is being uploaded using an inbound, right from the registration form
@Sala said in How to fix no img attribute from this code:
The image is being uploaded using an inbound, right from the registration form
I guess the next question here is how do you apply an
alt
description to an image that is being uploaded to make sure it is unique? What value are you expecting here, and does it make more sense to ask the user to “describe” the image they are uploading? You’d probably also want some control over what is being entered there to ensure it complies with site policies etc… -
Yes, I am aware that if users are given the option to enter alt text, some may do so in an abusive manner. For the time being, we’ve adjusted the php script to generate the alt automatically, thus there are no longer any SEO problem with alt images.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (ether email, or push notification). You'll also be able to save bookmarks, use reactions, and upvote to show your appreciation to other community members.
With your input, this post could be even better 💗
RegisterLog in