function my_theme_add_editor_styles() {
add_editor_style();
}
add_action( 'init', 'my_theme_add_editor_styles' );
foreach( $rand_posts as $post ) : setup_postdata($post); ?>
<?php ale_part('postpreview'); ?>
<?php endforeach; ?>
add_action( 'init', 'register_post_type_init' );
function register_post_type_init() {
$labels = array(
'name' => 'Видео',
'singular_name' => 'Видео',
'add_new' => 'Добавить видео',
'add_new_item' => 'Добавить новое видео',
'edit_item' => 'Редактировать видео',
'new_item' => 'Новое видео',
'all_items' => 'Все видео',
'view_item' => 'Просмотр видео на сайте',
'search_items' => 'Искать видео',
'not_found' => 'Видео не найдено.',
'not_found_in_trash' => 'В корзине нет видео.',
'menu_name' => 'Видеоновости'
);
$args = array(
'labels' => $labels,
'public' => true,
'show_ui' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-video-alt3',
'menu_position' => 20,
'supports' => array( 'title', 'editor', 'comments', 'author', 'thumbnail'),
'taxonomies' => array( 'category' )
);
register_post_type('video', $args);
}
add_action('wpcf7_before_send_mail', 'dco_wpcf7_before_send_mail');
function dco_wpcf7_before_send_mail($contact_form) {
$submission = WPCF7_Submission::get_instance();
$data = & $submission->get_posted_data();
$subject = $data['your-subject'];
if ($subject == 'Директор') {
$mail = $contact_form->prop('mail');
$mail['recipient'] = 'director@domain.com';
$contact_form->set_properties(array('mail' => $mail));
}
if($subject == 'Менеджер') {
$mail = $contact_form->prop('mail');
$mail['recipient'] = 'manager@domain.com';
$contact_form->set_properties(array('mail' => $mail));
}
}
<div class="logo">
<?php if(!is_front_page() && !is_home()) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php endif; ?>
<?php if(get_field('logo_image', 'option')): ?>
<img src="<?php the_field('logo_image', 'option'); ?>" title="" alt="">
<?php endif; ?>
<?php if(get_field('logo_text', 'option')): ?>
<span><?php the_field('logo_text', 'option'); ?></span>
<?php endif; ?>
<?php if(!is_front_page() && !is_home()) : ?>
</a>
<?php endif; ?>
</div>