add readated in pages
This commit is contained in:
@@ -735,6 +735,25 @@ function custom_meta_tags() {
|
||||
|
||||
$og_tags .= '<meta property="og:title" content="' . esc_html($title) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />' . PHP_EOL;
|
||||
|
||||
// Добавляем изображение текущего поста
|
||||
if (has_post_thumbnail()) {
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$image_id = get_post_thumbnail_id($post_id);
|
||||
|
||||
$image_data = wp_get_attachment_image_src($image_id, 'full');
|
||||
if ($image_data) {
|
||||
$og_tags .= '<meta property="og:image:width" content="' . esc_attr($image_data[1]) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:image:height" content="' . esc_attr($image_data[2]) . '" />' . PHP_EOL;
|
||||
}
|
||||
|
||||
$og_image = get_the_post_thumbnail_url($post_id, 'full');
|
||||
$og_tags .= '<meta property="og:image" content="' . esc_url($og_image) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta name="twitter:card" content="summary_large_image">';
|
||||
$og_tags .= '<meta name="twitter:image" content="' . esc_url($og_image) . '">';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -877,6 +896,13 @@ function agroxpert_send_smtp_email( $phpmailer ) {
|
||||
add_action( 'phpmailer_init', 'agroxpert_send_smtp_email' );
|
||||
|
||||
|
||||
// Принудительно меняем email отправителя
|
||||
add_filter('wp_mail_from', function($email) {
|
||||
return 'news@mail.agroexpert.press';
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function my_custom_mail_sent( $contact_form ){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user