// добываем слаг поста
global $post;
$slug = $post->post_name;
// функция получения ID по слагу
function get_id_by_slug($slug) {
$query = new WP_Query(
array(
'name' => $slug,
'post_type' => 'post'
)
)
$query->the_post();
return get_the_ID();
}
// наше поле
$postData = get_fields(function get_id_by_slug($slug));
#calendar_wrap.calendar_wrap {
padding: 10px 10px;
}
$thumb_ID = get_sub_field('ale_projects_img');
$img_src = wp_get_attachment_image_src($thumb_ID, 'large');
<img src="<?php echo $img_src[0]; ?>">
function my_custom_style() {
if(is_page_template('my-custom-page-template.php')) {
wp_enqueue_style( 'style', get_template_directory_uri() . '/assets/css/style.css' );
}
}
add_action( 'wp_enqueue_scripts', 'my_custom_style' );