WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Scissors] Pull diffferent image sizes (3 posts)

  1. ch00
    Member
    Posted 4 years ago #

    Hi all,

    I want to include the medium sized image generated by scissors in a special "Featured Excerpt" section on my site. Is there an easy way to pull the filename/path to the medium sized image given the filename or title of the original?

    I would just try appending the dimensions to the original file name in PHP (ex -200x200.jpg) but since images are being scaled, the dimensions are always different.

    What I don't want to do is search the filenames in the upload directory for the original name and then iterate to the second result which would hopefully be the medium sized file (thumbnail being the first result). Surely there is a less hacked way of doing this.

    Any suggestions? Thanks in advance.

  2. stephanreiter
    Member
    Posted 4 years ago #

    Check out the function 'image_get_intermediate_size' in the WordPress codex that allows you to retrieve an intermediate size of your choice, e.g. medium or thumbnail, for a given post-id (identifier of the image).

  3. taeke
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags