Forums

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

  1. duncmorley
    Member
    Posted 7 months 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 7 months ago #

  3. duncmorley
    Member
    Posted 7 months ago #

    Nice one, worked a treat, thanks

Reply

You must log in to post.

About this Topic