• Resolved miguelcortereal

    (@miguelcortereal)


    Make post images display their alt and title attributes.

    I found this function and it could be an approach to make it work.

    //get attachment meta
    if ( !function_exists('wp_get_attachment') ) {
        function wp_get_attachment( $attachment_id )
        {
            $attachment = get_post( $attachment_id );
            return array(
                'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
                'caption' => $attachment->post_excerpt,
                'description' => $attachment->post_content,
                'href' => get_permalink( $attachment->ID ),
                'src' => $attachment->guid,
                'title' => $attachment->post_title
            );
        }
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi Miguel,

    Thanks for the suggestion!
    I will include something similar in the next release.

    Have a nice day,
    Iulia

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hello,

    I added in the most recent release the alt attribute for image and the title. Please upgrade and check.

    Regards,
    Iulia

    Thread Starter miguelcortereal

    (@miguelcortereal)

    Its working great now.

    Thanks a lot.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Img alt and title attributes’ is closed to new replies.