• Can you implement unicalization for images with same post name in alt text? For example by adding image number to text end: if page content 3 images and post name is “My post name”, alt text for first image will be My post name – 1, for second My post name – 2, for third My post name – 3… I implement it in DomHelper trait setEmpty()/setNotEmpty() static function as third variable with default null value, but after updating it will be lost.

    // DomHelper
    public function setEmpty($option, $node, $img_url, $num = null)
    {
        if ( Option::check($option) ) {
            $numText = $num ? ' - ' . $num : '';
    
            switch ( Option::get($option) ) {
                case Option::get($option) == 'alt_empty_fkw':
                    $node->setAttribute("alt", $this->focus_keyword() . $this->site_title() . $numText);
                        break;
    ...
    // DomController
    $imagesNodes = $html->query( "https://img" );
    
    for ($i = 0; $i < count($imagesNodes); $i++ ) {
        $node = $imagesNodes[$i];
        // Return image URL
        $img_url = $node->getAttribute( "src" );
        // Set alt for Post & Pages
                
        if ( is_singular( array( 'post', 'page' ) ) ) {
            $index = $i + 1;
    ....
    • This topic was modified 1 year, 11 months ago by degorych.
    • This topic was modified 1 year, 11 months ago by degorych.
Viewing 1 replies (of 1 total)
  • Plugin Author Pagup

    (@pagup)

    Hi,

    Thank you for contacting our support.

    About your issue, we have been looking at this and despite the fact that it’s interesting, we’re not sure that it’s really beneficial for SEO purposes (even if it won’t hurt it).

    However, we will add it to our Todolist for next updates.

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Unicalization images in the page with number’ is closed to new replies.