Title: Lost forms styling using conditional statement
Last modified: August 28, 2018

---

# Lost forms styling using conditional statement

 *  [masterofstuff](https://wordpress.org/support/users/masterofstuff/)
 * (@masterofstuff)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/lost-forms-styling-using-conditional-statement/)
 * Hi
    I have a little problem with styling. I have create custom post types and
   in one of my template I have added contact form with some styling and it was 
   looks great. But now i did some conditional statement <?php if($name == ‘Artur’){
   echo do_shortcode( ‘[contact-form-7 id=”273″ title=”Post name1″]’ ); }elseif(
   $name == ‘Richard’){ echo do_shortcode( ‘[contact-form-7 id=”295″ title=”Post
   name1″]’ ); }?> When i did this i have lost all my styling, now forms are displaying
   in default styling. How i can fix this.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flost-forms-styling-using-conditional-statement%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Ken Suarez](https://wordpress.org/support/users/kensuarez/)
 * (@kensuarez)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/lost-forms-styling-using-conditional-statement/#post-10767625)
 * Hello, Good Day!
 * Is there a way we can see the other style you have setup so we have something
   to compare. Also try wrapping up your form with a div in the backend part so 
   that the styling set for the fields for example **<div id=”basicform”>[shortcode]
   </div>** will be carried over on the other form. In this case target fields will
   be close to generic and not specific to one form only. So you see what I mean
   I have a comparison for the style below.
 * instead:
    #wpcf7-f273-p58-o1 input, #wpcf7-f273-p58-o1 textarea
 * you can have it as:
    #basicform .wpcf7-form input, #basicform .wpcf7-form textarea
 * If you have more questions or clarifications don’t hesitate to reply on this 
   thread.
    -  This reply was modified 7 years, 7 months ago by [Ken Suarez](https://wordpress.org/support/users/kensuarez/).

Viewing 1 replies (of 1 total)

The topic ‘Lost forms styling using conditional statement’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ken Suarez](https://wordpress.org/support/users/kensuarez/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/lost-forms-styling-using-conditional-statement/#post-10767625)
 * Status: not resolved