The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Media Credit
Suggestion: Allow for responsive images with max-width (3 posts)

  1. Drew Jaynes
    Docs Czar
    Posted 4 years ago #

    I don't like having to edit plugins but this was a barrier toward fully fluid/responsive images for us. The absolute-value width in the shortcode output wasn't allowing images to scale properly.

    Might I suggest that instead of applying the image width in your output, apply max-width: 100% instead. I also tacked on height:auto as well.


    return '<div class="media-credit-container ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'
    	. do_shortcode( $content ) . '<span class="media-credit">' . $author_link . '</span></div>';


    return '<div class="media-credit-container ' . esc_attr($align) . '" style="max-width: 100%; height:auto;">'
    	. do_shortcode( $content ) . '<span class="media-credit">' . $author_link . '</span></div>';


  2. Scott Bressler
    Posted 4 years ago #

    Without thorough testing I won't be able to re-determine why, but there was a very specific reason that I needed to put the width there. I assume it had something to do with padding/margins and background colors expanding properly.

    Can you post a link to your site where you have this hack in place?


  3. Drew Jaynes
    Docs Czar
    Posted 4 years ago #


    Here's a link to the page I've implemented this on: http://drewf.us/mtz

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Media Credit
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic