<?php if get_field( "video", $post_id ) : ?>
<div id = "video">
<iframe width="100%" height="315" src="https://www.youtube.com/embed/<?php echo get_field( "video", $post_id ); ?>?rel=0&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<?php endif; ?>
$en_lang = 'en';
$ru_lang = 'ru';
$curr_lang = pll_current_language();
if ( $curr_lang == $en_lang ) {
// для англ версии
} elseif ( $curr_lang == $ru_lang ) {
// для русской
}
function add_custom_post_type_to_query( $query ) {
if ( $query->is_main_query() && !is_admin() ) {
$query->set( 'post_type', array('post', 'recipe') );
}
}
add_action( 'pre_get_posts', 'add_custom_post_type_to_query' );
add_action('template_redirect', 'bez_stranic_vlogenii');
function bez_stranic_vlogenii() {
global $wp_query, $post;
if ( is_attachment() ) :
$wp_query->set_404();
endif;
}