WordPress.org

Support

Support » Plugins and Hacks » Contact Form 7 » [Resolved] [Plugin: Contact Form 7] Change Width of a form?

[Resolved] [Plugin: Contact Form 7] Change Width of a form?

Viewing 5 replies - 1 through 5 (of 5 total)
  • nevermind… I found it.

    Can you please share with us what your solution was? THX

    I’m not sure if this is the only way, but here is one way:
    Under the plugin directory:
    /plugins/contact-form-7/modules/
    Edit the following two files text.php and textarea.php

    Both have a “default size” that is set to:
    size=”40″ (columns)
    size=”10″ (rows)

    text.php (line 75 or so of the code)

    if ( $size_att )
    		$atts .= ' size="' . $size_att . '"';
    	else
    		$atts .= ' size="40"'; // default size

    Change “40” to something else (smaller width is size=”30″ columns). You’ll see a similar line of code for rows.

    textarea.php (line 72 or so of the code)

    if ( $cols_att )
    		$atts .= ' cols="' . $cols_att . '"';
    	else
    		$atts .= ' cols="40"'; // default size
    
    	if ( $rows_att )
    		$atts .= ' rows="' . $rows_att . '"';
    	else
    		$atts .= ' rows="10"'; // default size

    NOTE: When you upgrade to the next version of the plugin, you’ll need to do this again. Anyone know a better way to do this so you don’t need to re-edit after each new version?

    Anyone know how to change the column and row width using the “Additional Settings” feature in Contact Form 7?

    Found a better way! When making your form, use this:
    [text* phone 30/50]
    This creates 30 columns (width) and 50 (maxlength)
    [textarea* your-message 20/3] = 20 cols / 3 rows
    See:
    http://blog.strategy11.com/contact-form-7-widget/comment-page-1/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: Contact Form 7] Change Width of a form?’ is closed to new replies.
Skip to toolbar