WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Echo attachement URL with custom size (3 posts)

  1. duncmorley
    Member
    Posted 2 years ago #

    Is it possible to echo a custom size attachment URL. I know WordPress has the following function built in:
    wp_get_attachment_url( $attachment_id );
    But you cannot add a size parameter to this function so it only ever outputs the full size image URL.

    I specifically need the URL only as I'm wanting to pass the URL into an inline CSS style.

  2. keesiemeijer
    moderator
    Posted 2 years ago #

  3. duncmorley
    Member
    Posted 2 years ago #

    Nice one, worked a treat, thanks

Topic Closed

This topic has been closed to new replies.

About this Topic