<br><br><div class="gmail_quote">On Thu, Apr 21, 2011 at 11:33 PM, Philip Walton <span dir="ltr"><<a href="mailto:philip@philipwalton.com">philip@philipwalton.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
I haven't been following this discussion, so sorry if this isn't
what you were asking, but this is what I do in ALL my themes to make
the wp-caption div the same width as the img:<br>
<br>
<pre><tt>function theme_prefix_wpcaption($x=null, $attr, $content)</tt></pre>
<pre><tt>{ </tt></pre>
<pre><tt> extract(shortcode_atts( array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ), $attr));</tt></pre>
<pre><tt> if ( 0 >= (int) $width || empty($caption) ) {</tt></pre>
<pre><tt> return $content;</tt></pre>
<pre><tt> }</tt></pre>
<pre><tt> $id = $id ? 'id="' . $id . '" ' : '';</tt></pre>
<pre><tt> return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . $width . 'px">' . $content . '<div class="wp-caption-wrapper"><p class="wp-caption-text">' . $caption . '</p></div></div>';</tt></pre>
<pre><tt>}</tt></pre>
<pre><tt>add_filter('img_caption_shortcode', '</tt><tt><tt>theme_prefix_</tt></tt><tt>wpcaption', 10, 3);</tt></pre><div><div></div><div class="h5">
<br>
<br>
On 4/21/11 10:16 AM, Towfiq I. wrote:<br>
</div></div><span style="white-space:pre-wrap"><div><div></div><div class="h5">> @emil<br>
> <br>
> But the twenty-ten theme is rendering the same thing. The
caption<br>
> width is automatically added by wordpress and I am not able
to<br>
> override the default width. :/<br>
> <br>
> Any suggestion?<br>
> <br>
> <br>
> -- Towfiq I.<br>
> <br>
> <br>
> <br></div></div>
> _______________________________________________
theme-reviewers<div class="im"><br>
> mailing list <a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a> <br>
> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a></div></span><br>
</div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br><br>Thanks for the response Philip, but Emil's solution worked. I knew I could rewrite the default wp-caption output but wouldn't want to get into that trouble. <br>Didn't know css "!important" tag could beat the inline html style. Thanks again :)<br>
<br clear="all"><br>-- <br><span style="color:rgb(153, 153, 153)">Towfiq I.</span><br><br>