correct pinned post

This commit is contained in:
2024-04-12 21:04:43 +03:00
parent 73fc49d048
commit 6ab7d934a9
3 changed files with 92 additions and 27 deletions

View File

@@ -1590,6 +1590,23 @@ button {
color: #2f2f2f; color: #2f2f2f;
} }
.wp-authors{
position: relative !important;
}
.wp-authors IMG{
height: auto;
}
.edition-title{
font-weight: 700;
font-size: 2rem;
line-height: 2.4rem;
}
@media (max-width: 767px) { @media (max-width: 767px) {
.about { .about {
padding: 1.5rem 0.5rem; padding: 1.5rem 0.5rem;

View File

@@ -63,6 +63,14 @@
color: #2f2f2f; color: #2f2f2f;
} }
.edition-title{
font-weight: 700;
font-size: 2rem;
line-height: 2.4rem;
}
@media (max-width: 767px) { @media (max-width: 767px) {
.about { .about {
padding: 1.5rem 0.5rem; padding: 1.5rem 0.5rem;

View File

@@ -601,45 +601,85 @@ function custom_meta_tags() {
} }
add_action('wpcf7_before_send_mail', 'my_custom_contact_form_handler', 10, 3);
function my_custom_contact_form_handler($contact_form, $abort, $submission) {
add_action('wpcf7_mail_sent', 'my_custom_mail_sent' );
function my_custom_mail_sent( $contact_form ){
$log_file = WP_CONTENT_DIR . '/contact.log';
// Получаем ID формы
$form_id = $contact_form->id(); $form_id = $contact_form->id();
//if ( $form_id == '19' ) {
if ( $form_id == '0ddb83c' ) {
// Получаем данные формы
$submission = WPCF7_Submission::get_instance(); $submission = WPCF7_Submission::get_instance();
if ($submission) {
$posted_data = $submission->get_posted_data(); $posted_data = $submission->get_posted_data();
// Подключаемся к базе данных WordPress $mail = $posted_data['your-email'];
global $wpdb; global $wpdb;
// Определяем таблицу в базе данных WordPress в зависимости от ID формы
$table_name = $wpdb->prefix . 'subusers'; $table_name = $wpdb->prefix . 'subusers';
$hash = md5('775+'.$mail);
$wpdb->insert( $query = $wpdb->prepare("SELECT * FROM $table_name WHERE mail = %s", $mail);
$result = $wpdb->get_row($query);
if ( !$result ) { //аdd to table
$result = $wpdb->insert(
$table_name, $table_name,
array( array(
'mail' => $posted_data['your-email'], 'mail' => $mail,
'status' => 0, 'status' => 0,
'date' => current_time('mysql') 'date' => current_time('mysql'),
'hash' => $hash,
), ),
array( array(
'%s', // Формат для строкового поля '%s',
'%d', // Формат для цифрового поля '%d',
'%s' // Формат для поля с датой и временем '%s',
'%s'
) )
); );
}
}
} // }
$hash_link = home_url().'/subscript?id='.$hash;
$subject = 'Подписка на рассылку АгроЭксперт';
$message = "
Здравствуйте!\n
Для подтверждения подписки на нашу рассылку перейдите по ссылке ниже\n
$hash_link.\n\n
Если вы не отправляли заявку просто проигнорируйте это письмо.";
$headers = array('Content-Type: text/plain; charset=UTF-8');
// Отправка письма
wp_mail($mail, $subject, $message, $headers);
echo '<p>Благодарим за интерес к нашему изданию!</p>
<p>На Вашу почту отправлено письмо для подтверждения подписки.</p>';
return;
} }
function agroxpert_send_smtp_email( PHPMailer $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'mail.vetandlife.ru';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 465;
$phpmailer->Username = 'news@mail.agroexpert.press';
$phpmailer->Password = 'O6K!]aZDNJ';
$phpmailer->SMTPSecure = 'ssl';
$phpmailer->From = 'news@mail.agroexpert.press';
$phpmailer->FromName = 'Ветеринария и жизнь';
}
add_action( 'phpmailer_init', 'agroxpert_send_smtp_email' );