WordPress.org

Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#22906 closed enhancement (wontfix)

Captions should be responsive

Reported by: maxwell.shim Owned by:
Milestone: Priority: normal
Severity: trivial Version: 3.5
Component: Media Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Problem 1 : Does not resize image with caption for a responsive design.

Returns the fixed width of the image function img_caption_shortcode()
So does not change the image width.

I think change style max-width.

return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="max-width: ' . (10 + (int) $width) . 'px">'

Change History (3)

comment:1 SergeyBiryukov16 months ago

  • Component changed from Graphic Design to Media
  • Description modified (diff)
  • Keywords has-patch removed

comment:2 DrewAPicture16 months ago

  • Resolution set to wontfix
  • Status changed from new to closed
  • Summary changed from Does not resize image with caption for a responsive design. to Captions should be responsive
  • Type changed from defect (bug) to enhancement

Modifying img_caption_shortcode() isn't necessary.

The same effect can be achieved by adding max-width: 100%; to .wp-caption in your theme's stylesheet. In fact, the Twenty Twelve theme does it this way, see [21407].

Sorta Related: #10409

comment:3 SergeyBiryukov16 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.