• hoiol

    (@hoiol)


    I’m using the plugin to show a random image on my sidebar. The full image is over killing it so I have modified the plugin to get a different image size.

    If anyone is interested in achieving this here is what you need to change:

    • In random-image-class.php look for “$link = wp_get_attachment_url( $galleryid, false, ‘medium’ );” and replace it for “$link = wp_get_attachment_image_src( $galleryid, ‘medium’ );” (change “medium” for the desired size)
    • In the same file look for “$galleryurls[] = $link;” and replace it with “$galleryurls[] = $link[0];”

    That’s really it!

    https://www.ads-software.com/plugins/wordpress-random-image/

  • The topic ‘Geting a different image size’ is closed to new replies.