Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Screenshot of website illustrating the issue: http://www.hlrse.net/Qwerty/xhtml/tiptopcare.net/preview_formsWithEmptyDIVSpacing_20121124-1104.png

I am using Contact Form 7 (http://contactform7.com/) for the form on this webpage. The problem I experience is not so much with the plugin itself, but rather Wordpress. It is inserting empty DIV tags between each row on that form, creating hideously tall empty spacing and resulting in a very tall vertically-dragged out form. How can I have Wordpress not add the empty DIV tags for only the Page content area (because I am using a Page as the frontpage to Wordpress)? I have tried solutions that apply to the entire Wordpress site, but when I find a solution that successfully omits empty DIV tags, it breaks the image slider of the theme (using PageLines).

share|improve this question
1  
Have you validated your page markup? When I've seen this kind of thing in the past it has usually involved broken markup and a WordPress attempt to clean it up (which doesn't always work well). – s_ha_dum Nov 24 '12 at 17:31
WordPress does not add empty div elements, there is something else broken on your site. Please add debug information to your question to make answers possible. – toscho Nov 24 '12 at 18:09
validator.w3.org/… - Never validated, mostly because I never expect these automated things (Wordpress, Themes, the whole system) to wind up being valid markup. – BlueToast Nov 24 '12 at 18:10
I enabled debug, and as soon as I got logged into wp-admin this inserted at the top of the page: Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /home/username/public_html/wp-includes/functions.php on line 2722 – BlueToast Nov 24 '12 at 18:17
Enabled plugins at time of post: Contact Form 7, TinyMCE Advanced, WP-DBManager, WP Super Cache (was disabled previously, empty DIV tag problem still occurred) – BlueToast Nov 24 '12 at 18:21
show 3 more comments

2 Answers

Use child theme.

Then design a simple page for your frontpage. if you change something in the original theme. when upgrading lose changes.

share|improve this answer

Have you tried using some CSS? Check the id used for the form then add...

.wpcf7-form div:empty {
    display: none;
}

This just checks for the empty div tags and hides them from view.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.