lundi 30 mai 2016

Form PHP/CSS/HTML wordpress

please i installed a plugin in wordpress to let guests publish(its a free medical advises the guest post and the doctor answer) so i installed the plugin User Submitted Posts now i'm customizing the form but i see this background in the form i want a simple form and easy to use i can't remove this background

enter image description here

The php/html

    <?php // User Submitted Posts - HTML5 Submission Form

if (!function_exists('add_action')) die();

global $usp_options;

$current_user = wp_get_current_user();

if ($usp_options['disable_required']) {
    $required = ''; 
    $captcha = '';
    $files = '';
} else {
    $required = ' data-required="true" required';
    $captcha = ' user-submitted-captcha'; 
    $files = ' usp-required-file';
} ?>

<!-- User Submitted Posts @ http://ift.tt/1KESg0k -->
<div id="user-submitted-posts">
    <?php if ($usp_options['usp_form_content'] !== '') echo $usp_options['usp_form_content']; ?>

    <form id="usp_form" method="post" enctype="multipart/form-data" action="">
        <div id="usp-error-message" class="usp-callout-failure usp-hidden"></div>
        <div id="usp-success-message" class="usp-callout-success usp-hidden"></div>
        <?php echo usp_error_message();

        if (isset($_GET['success']) && $_GET['success'] == '1') :
            echo '<div id="usp-success-message">'. $usp_options['success-message'] .'</div>';
        else :

        if (($usp_options['usp_name'] == 'show' || $usp_options['usp_name'] == 'optn') && ($usp_options['usp_use_author'] == false)) { ?>

        <fieldset class="usp-name">
            <label for="user-submitted-name"><?php _e('Votre Nom ', 'usp'); ?></label>
            <input name="user-submitted-name" type="text" value="" placeholder="<?php _e('Votre Nom', 'usp'); ?>"<?php if (usp_check_required('usp_name')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if (($usp_options['usp_url'] == 'show' || $usp_options['usp_url'] == 'optn') && ($usp_options['usp_use_url'] == false)) { ?>

        <fieldset class="usp-url">
            <label for="user-submitted-url"><?php _e('Your URL', 'usp'); ?></label>
            <input name="user-submitted-url" type="text" value="" placeholder="<?php _e('Your URL', 'usp'); ?>"<?php if (usp_check_required('usp_url')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_email'] == 'show' || $usp_options['usp_email'] == 'optn') { ?>

        <fieldset class="usp-email">
            <label for="user-submitted-email"><?php _e('Votre Email', 'usp'); ?></label>
            <input name="user-submitted-email" type="text" value="" placeholder="<?php _e('Votre Email', 'usp'); ?>"<?php if (usp_check_required('usp_email')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_title'] == 'show' || $usp_options['usp_title'] == 'optn') { ?>

        <fieldset class="usp-title">
            <label for="user-submitted-title"><?php _e('Titre', 'usp'); ?></label>
            <input name="user-submitted-title" type="text" value="" placeholder="<?php _e('Titre', 'usp'); ?>"<?php if (usp_check_required('usp_title')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_tags'] == 'show' || $usp_options['usp_tags'] == 'optn') { ?>

        <fieldset class="usp-tags">
            <label for="user-submitted-tags"><?php _e('Post Tags', 'usp'); ?></label>
            <input name="user-submitted-tags" type="text" value="" placeholder="<?php _e('Post Tags', 'usp'); ?>"<?php if (usp_check_required('usp_tags')) echo $required; ?> class="usp-input">
        </fieldset>
        <?php } if ($usp_options['usp_captcha'] == 'show') { ?>

        <fieldset class="usp-captcha">
            <label for="user-submitted-captcha"><?php echo $usp_options['usp_question']; ?></label>
            <input name="user-submitted-captcha" type="text" value="" placeholder="<?php _e('Antispam Question', 'usp'); ?>"<?php echo $required; ?> class="usp-input exclude<?php echo $captcha; ?>">
        </fieldset>
        <?php } if (($usp_options['usp_category'] == 'show' || $usp_options['usp_category'] == 'optn') && ($usp_options['usp_use_cat'] == false)) { ?>

        <fieldset class="usp-category">
            <label for="user-submitted-category"><?php _e('Maladie', 'usp'); ?></label>
            <select name="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $required; ?> class="usp-select">
                <option value=""><?php _e('Choix du maladie.', 'usp'); ?></option>
                <?php foreach($usp_options['categories'] as $categoryId) { $category = get_category($categoryId); if (!$category) { continue; } ?>

                <option value="<?php echo $categoryId; ?>"><?php $category = get_category($categoryId); echo sanitize_text_field($category->name); ?></option>
                <?php } ?>

            </select>
        </fieldset>
        <?php } if ($usp_options['usp_content'] == 'show' || $usp_options['usp_content'] == 'optn') { ?>

        <fieldset class="usp-content">
            <?php if ($usp_options['usp_richtext_editor'] == true) { ?>

            <div class="usp_text-editor">
            <?php $settings = array(
                    'wpautop'          => true,  // enable rich text editor
                    'media_buttons'    => true,  // enable add media button
                    'textarea_name'    => 'user-submitted-content', // name
                    'textarea_rows'    => '10',  // number of textarea rows
                    'tabindex'         => '',    // tabindex
                    'editor_css'       => '',    // extra CSS
                    'editor_class'     => 'usp-rich-textarea', // class
                    'teeny'            => false, // output minimal editor config
                    'dfw'              => false, // replace fullscreen with DFW
                    'tinymce'          => true,  // enable TinyMCE
                    'quicktags'        => true,  // enable quicktags
                    'drag_drop_upload' => true, // enable drag-drop
                );
                wp_editor('', 'uspcontent', apply_filters('usp_editor_settings', $settings)); ?>

            </div>
            <?php } else { ?>

            <label for="user-submitted-content"><?php _e('Votre Problém', 'usp'); ?></label>
            <textarea name="user-submitted-content" rows="5" placeholder="<?php _e('Votre Problém', 'usp'); ?>"<?php if (usp_check_required('usp_content')) echo $required; ?> class="usp-textarea"></textarea>
            <?php } ?>

        </fieldset>
        <?php } if ($usp_options['usp_images'] == 'show') { ?>
        <?php if ($usp_options['max-images'] !== 0) { ?>
        textarea 
        <fieldset class="usp-images">
            <label for="user-submitted-image"><?php _e('Image ici', 'usp'); ?></label>
            <div id="usp-upload-message"><?php echo $usp_options['upload-message']; ?></div>
            <div id="user-submitted-image">
            <?php // upload files
            $minImages = intval($usp_options['min-images']);
            $maxImages = intval($usp_options['max-images']);
            $addAnother = $usp_options['usp_add_another'];

            if ($addAnother == '') $addAnother = '<a href="#" id="usp_add-another" class="usp-no-js">' . __('Une autre Image', 'usp') . '</a>';
            if ($minImages > 0) : ?>
                <?php for ($i = 0; $i < $minImages; $i++) : ?>

                <input name="user-submitted-image[]" type="file" size="25"<?php echo $required; ?> class="usp-input usp-clone<?php echo $files; ?> exclude">
                <?php endfor; ?>
                <?php if ($minImages < $maxImages) : echo $addAnother; endif; ?>
            <?php else : ?>

                <input name="user-submitted-image[]" type="file" size="25" class="usp-input usp-clone exclude">
                <?php echo $addAnother; ?>
            <?php endif; ?>

            </div>
            <input class="usp-hidden exclude" type="hidden" name="usp-min-images" id="usp-min-images" value="<?php echo $usp_options['min-images']; ?>">
            <input class="usp-hidden exclude" type="hidden" name="usp-max-images" id="usp-max-images" value="<?php echo $usp_options['max-images']; ?>">
        </fieldset>
        <?php } ?>
        <?php } ?>

        <fieldset id="coldform_verify" style="display:none;">
            <label for="user-submitted-verify"><?php _e('Human verification: leave this field empty.', 'usp'); ?></label>
            <input class="exclude" name="user-submitted-verify" type="text" value="">
        </fieldset>
        <div id="usp-submit">
            <?php if (!empty($usp_options['redirect-url'])) { ?>

            <input class="usp-hidden exclude" type="hidden" name="redirect-override" value="<?php echo $usp_options['redirect-url']; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_author'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-name" value="<?php echo $current_user->user_login; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_url'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-url" value="<?php echo $current_user->user_url; ?>">
            <?php } ?>
            <?php if ($usp_options['usp_use_cat'] == true) { ?>

            <input class="usp-hidden exclude" type="hidden" name="user-submitted-category" value="<?php echo $usp_options['usp_use_cat_id']; ?>">
            <?php } ?>

            <input class="exclude" name="user-submitted-post" id="user-submitted-post" type="submit" value="<?php _e('Envoyer', 'usp'); ?>">
            <?php wp_nonce_field('usp-nonce', 'usp-nonce', false); ?>
        </div>
        <?php endif; ?>

    </form>
</div>
<script>(function(){var e = document.getElementById('coldform_verify'); if(e) e.parentNode.removeChild(e);})();</script>
<!-- User Submitted Posts @ http://ift.tt/1KESg0k -->

The CSS

    @charset "UTF-8";
/* 
    User Submitted Posts > CSS > HTML5 form
    http://ift.tt/1KESg0k
    Complete list of CSS hooks for the submission form @ http://m0n.co/e
*/

div#user-submitted-posts fieldset input[type=text] {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-image input[type=file] {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-posts textarea  {
    border: none;
    border-bottom: 2px solid #37b8eb;
    clear: both; width: 70%;
}

div#user-submitted-posts fieldset label{ 
clear: both; width: 70%;
}

div#usp-submit input[type=submit] {
    background-color: #37b8eb;
    border: none;
    color: white;
    padding: 12px 62px;
    text-decoration: none;
    margin: 4px 2px;
    cursor: pointer;
}

div#user-submitted-posts { border-radius: 5px; background-color: #f2f2f2; padding: 10px; width: 100%; font-size: 15px; }
div#user-submitted-posts fieldset { margin: 10px 0; padding: 0; border: 0; background-color: #f2f2f2; }

/*div#user-submitted-posts fieldset label           { float: left; clear: both; width: 70%; margin: 0; padding: 0; line-height: 18px; }*/
/*div#user-submitted-posts fieldset input.usp-input { float: left; clear: both; width: 70%; margin: 0; padding: 5px; font-size: 12px; }*/
/*div#user-submitted-posts textarea.usp-textarea    { float: left; clear: both; width: 80%; margin: 0; padding: 5px; font-size: 12px; }*/
/*div#user-submitted-posts select                   { float: left; clear: both; width: auto; margin: 0; padding: 5px; font-size: 12px; }*/

div#user-submitted-image { float: left; clear: both; width: 70%; }
div#usp-upload-message   { float: left; clear: both; width: 70%; }
a#usp_add-another        { float: left; clear: both; }

div#user-submitted-posts fieldset input.usp-input.usp-clone { width: 90%; margin: 0 0 5px 0; padding: 7px; background-color: #fafafa; }
/*div#usp-submit { margin: 15px 0; }*/

/* JS > Parsley */
.parsley-errors-list {
    list-style-type: none; float: left; clear: both; margin: 0; padding: 0; font-size: 11px; line-height: 18px; color: #fff; background-color: #cc3333;
    -webkit-transition: all 0.5s ease-in; -moz-transition: all 0.5s ease-in; -o-transition: all 0.5s ease-in; transition: all 0.5s ease-in;
    opacity: 0; -moz-opacity: 0; -webkit-opacity: 0;
    }
.parsley-errors-list.filled { opacity: 1; }
.parsley-required { margin: 0; padding: 2px 3px; }
.usp-files-error { margin-top: -5px; }
.usp-hidden, .usp-no-js { display: none; }
.usp-js { display: block; }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire