page-backvoices.php 3.86 KB
<?php
	get_header();
	global $post;
?>

<!--Контент страницы-->
<content class="content page_<?php echo $post->post_name; ?>">

<?php
/* Start the Loop */
while ( have_posts() ) :
	the_post();
	
	if ( has_post_format( 'aside' ) )
		echo '<div class="container">'.
				'<div class="row">'.
					'<div class="col-12">'.
						'<h1 class="text-center text-md-start">'.get_the_title().'</h1>';
	the_content();
	if ( has_post_format( 'aside' ) )
		echo 		'</div>'.
				'</div>'.
			'</div>';
?>
<?php
endwhile; // End of the loop.
?>
<!--Форма отзывов-->
<div class="review-form">
	<div class="container py-4">
		<h2 class="h1 text-center text-md-start">Обратный звонок</h2>
<?php
    $args = array(
    'id_form'=>'form_backvoices_big',
    'fields'=>array(
        'author' => '<div class="form-floating mb-3" style="order:-2;">'.
            '<input type="text" class="form-control form-control-lg rounded-4 border-0" name="author" id="author_full" placeholder="Ваше имя" value="" size="30" required/>'.
            '<label for="author_full" class="form-label">Ваше имя:</label>'.
            '<div class="invalid-feedback">Пожалуйста, укажите имя пользователя</div>'.
        '</div>',
        'phone' => '<div class="form-floating mb-3" style="order:-1;">'.
            '<input type="text" class="form-control form-control-lg rounded-4 border-0" name="phone" id="phone_full" placeholder="Номер телефона" value="" required />'.
            '<label for="phone_full" class="form-label">Номер телефона:</label>'.
            '<div class="invalid-feedback">Пожалуйста, укажите телефон</div>'.
        '</div>',
        'cookies' => '<div class="mb-3 form-check ps-0" >'.
            '<input type="checkbox" name="accept" class="form-check-input d-none" id="accept_full" value="accept" required="required" checked="checked"/>'.
            '<label class="form-check-label" for="accept_full">'.
                '<span>Я даю согласие на <a href="'.get_permalink( get_page_by_path( 'privacy-policy' ) ).'" class="text-blue">обработку персональных данных</a>.</span>'.
            '</label>'.
            '<div class="invalid-feedback">Вы должны принять перед отправкой</div>'.
        '</div>',
        //'email'  => '<input id="email" name="email" type="hidden" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" />'
    ),
    'comment_field' => '<div class="form-floating mb-3" >'.
        '<textarea class="form-control form-control-lg rounded-4 border-0" placeholder="Комментарий" name="comment" id="comment_full" rows="8" aria-required="true" style="height: 100px" required></textarea>'.
        '<label for="comment_full" class="form-label">Комментарий</label>'.
        '<div class="invalid-feedback">Пожалуйста, введите комментарий</div>'.
    '</div>',
    'submit_button'=> '<button name="%1$s" type="submit" class="btn btn-lg btn-style-1 px-5 rounded-pill %3$s" value="%4$s" id="%2$s">Отправить</button>',
    'comment_notes_before' => '',
    'title_reply'=> ''.
        '<div class="form-preloader align-items-center justify-content-center d-flex d-none text-center position-absolute top-0 bottom-0 start-0 end-0 m-auto" style="z-index:1; background-color: rgba(255,255,255,0.8)">'.
            '<div class="spinner-border" role="status">'.
                '<span class="visually-hidden">Обработка...</span>'.
            '</div>'.
        '</div>',
    'class_form'=>'d-flex flex-column needs-validation ajax-submit'
);
?>
        <div class="rounded-4 text-color-1 bg-custom-9 shadow-2 p-4">
            <?php
            comment_form($args, url_to_postid('backvoices'));
            ?>
        </div>    
	</div>
</div>

</content>
<?php
	get_footer();