[theme-reviewers] Request to review theme

Towfiq I. tislam100 at gmail.com
Thu Apr 21 17:37:19 UTC 2011


On Thu, Apr 21, 2011 at 11:33 PM, Philip Walton <philip at philipwalton.com>wrote:

>  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:
>
> function theme_prefix_wpcaption($x=null, $attr, $content)
>
> {
>
>     extract(shortcode_atts( array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ), $attr));
>
>     if ( 0 >= (int) $width || empty($caption) ) {
>
>         return $content;
>
>     }
>
>     $id = $id ? 'id="' . $id . '" ' : '';
>
>     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>';
>
> }
>
> add_filter('img_caption_shortcode', 'theme_prefix_wpcaption', 10, 3);
>
>
>
> On 4/21/11 10:16 AM, Towfiq I. wrote:
> > @emil
> >
> > But the twenty-ten theme is rendering the same thing. The caption
> > width is automatically added by wordpress and I am not able to
> > override the default width. :/
> >
> > Any suggestion?
> >
> >
> > -- Towfiq I.
> >
> >
> >
> > _______________________________________________ theme-reviewers
>
> > mailing list theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>

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.
Didn't know css "!important" tag could beat the inline html style. Thanks
again :)


-- 
Towfiq I.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110421/52b2b267/attachment-0001.htm>


More information about the theme-reviewers mailing list