Hello.
Please read the annotation for this option carefully. There is a template for the current page title – %title
View post on imgur.com
I just checked and it works as it should.
Hi,
That screenshot was great but I don’t see those options in this version (1.6.4).
The only option I see is under SEO, Basic SEO optimization settings, and on/off switch for “Automatically set the alt attribute”.
Where do we find these other options?
Thanks.
In the screenshot I sent, there is a component that is only available in the premium version of the plugin.
The “Automatically set the alt attribute” option assigns the alt attribute from the title of the current post, and the title attribute is taken from the image title field in the media library. The image title often includes the name of the image itself, which is not related to the title of the post
Hi,
This is my point. They’re not.
The alt and title attributes are taken from the title of the post that the image was uploaded to, not the current one. No matter what page the image is included on.
e.g.
<img width="425" height="222" src="https://example.com/wp-content/uploads/my-image.jpg" class="attachment-full size-full" alt="Test Course Display" srcset="https://example.com/wp-content/uploads/my-image.jpg 425w, https://example.com/wp-content/uploads/my-image.jpg 300w" sizes="(max-width: 425px) 100vw, 425px" title="Test Course Display" />
“Test Course Display” is the title of the page I tested the feature on, not the current page. It’s also not the title field from the media library either.
The alt attribute will change if I add an alt in the media library.
I looked at your code:
plugins/clearfy/includes/classes/class.configurate-seo.php
function change_attachement_image_attributes (line 148)
It’s pulling the title from the parent (which is the page it was uploaded to), not the current page (because it’s using $parent).
I played with the code in a sandbox and found it.
Please could you look at this?
Thanks.
This is what I wrote to you: the plugin takes the title from the media library. In the media library, the title is assigned when the image is uploaded and taken from the title of the post to which you attach the image. This is how WordPress works. If you want to change this logic, use the premium component I wrote about earlier