Last active
October 27, 2020 13:54
-
-
Save YakovSPb/5a2a735bdef30fcbf0728a8b08932f62 to your computer and use it in GitHub Desktop.
WP ACF - произвольные поля
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WP ACF - группа полей | |
============================================= | |
1) Вывести картинку логотипа для header | |
$yak_logo = get_field('slajd_akczii', 10); | |
$yak_logo_ulr = $yak_logo['sizes']['image350']; | |
$yak_logo_ulr = $yak_logo['url']; | |
<img src="<?php echo $yak_slider_akcii_url; ?>" alt="alt"> | |
2) Вывести text логотипа | |
<?php echo get_field('logo_text'); ?> | |
<?php echo get_field('logo_text', 10); ?> | |
3) Вывести повторитель | |
//have_rows('tablicza_czen', 10) // id | |
<?php if( have_rows('tablicza_czen') ): ?> | |
<div class="card_table"> | |
<?php while( have_rows('tablicza_czen') ): the_row(); | |
$usluga_tabliczy = get_sub_field('usluga_tabliczy'); | |
$czena_tabliczy = get_sub_field('czena_tabliczy'); | |
?> | |
<div class="card_item"><div><?php echo $usluga_tabliczy; ?></div><div><?php echo $czena_tabliczy; ?></div></div> | |
<?php endwhile; ?> | |
</div> | |
<?php endif; ?> | |
4) Вывести группу | |
<?php echo get_field('adress_footer', 27)['adress_footer_title']; ?> | |
5) Получить ярлык | |
<?php echo(get_field_object('standard_date')['label']); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment