Title: magic101's Replies | WordPress.org

---

# magic101

  [  ](https://wordpress.org/support/users/magic101/)

 *   [Profile](https://wordpress.org/support/users/magic101/)
 *   [Topics Started](https://wordpress.org/support/users/magic101/topics/)
 *   [Replies Created](https://wordpress.org/support/users/magic101/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/magic101/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/magic101/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/magic101/engagements/)
 *   [Favorites](https://wordpress.org/support/users/magic101/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Contact Form 7 Display None](https://wordpress.org/support/topic/contact-form-7-display-none/)
 *  Thread Starter [magic101](https://wordpress.org/support/users/magic101/)
 * (@magic101)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/contact-form-7-display-none/#post-10480262)
 * Just found this in functions.php of theme and wonder if its why contact form 
   7 does not appear on the page. look at the page code the form is not visible 
   as it is wrapped in a div with display none, cf code is there but does not display
   the form
 * /* Disable SPAN wrapper for CF7
    ============================================
   =*/ add_filter(‘wpcf7_form_elements’, function($content) { $content = preg_replace(‘/
   <(span).*?class=”\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^”]+)?\s*”[^\>]*>(.*)
   <\/\1>/i’, ‘\2’, $content); return $content; });
 * add_filter(‘wpcf7_form_elements’, function( $content ) {
    $dom = new DOMDocument();
   $dom->preserveWhiteSpace = false; $dom->loadHTML(mb_convert_encoding($content,‘
   HTML-ENTITIES’, ‘UTF-8’), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
 *  $xpath = new DomXPath($dom);
    $spans = $xpath->query(“//span[contains(@class,‘
   wpcf7-form-control-wrap’)]” );
 *  foreach ( $spans as $span ) :
    $children = $span->firstChild; $span->parentNode-
   >replaceChild( $children, $span ); endforeach;
 *  return $dom->saveHTML();
    });
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Contact Form 7 Display None](https://wordpress.org/support/topic/contact-form-7-display-none/)
 *  Thread Starter [magic101](https://wordpress.org/support/users/magic101/)
 * (@magic101)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/contact-form-7-display-none/#post-10477262)
 * Thanks for that
 * The (div Display None) is put in by the developers theme not by us we have put
   in a few forms on various pages and it does the same to everyone, yet change 
   theme to 17 and the form shows every time as it is supposed to.
 * This gives me the feeling that the theme is putting in the div to stop contact
   form 7 showing. I may be wrong but never in all my years have I seen this happen
   b4.
    Looking at other sites we have you do not see this div and we have never
   had this happen to any themes we have used.
 * <div style=”display: none;”> wrapping around the form. This makes me feel the
   developer has some code somewhere that does this, for what reasons I do not know.
 * Driving me nuts over 50hrs trying to find whats wrong.

Viewing 2 replies - 1 through 2 (of 2 total)