You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Портфолио https://www.behance.net/d4d4186e
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Портфолио https://www.behance.net/d4d4186e
Question
Нарек
Имеется такой код который выводит субкатегории которые в основной категории под id=3.
<?php $categories = get_categories(array('child_of' => 3)); ?><?php foreach ($categories as $child) { ?> //код<?php } ?>Для всех категорий у меня созданы произвольные поля с использованием плагина Advanced Custom Fields. У одного поля name=text.
Вопрос в том как эти поля вывести внутри этого цикла?
Пробовал
<?php $categories = get_categories(array('child_of' => 3)); ?><?php foreach ($categories as $child) { ?><h2><?php echo $child->cat_name; ?></h2><p> <?php echo $child->category_description; ?> </p><p><?php echo get_field( 'text', $term->taxonomy . '_' . $term->term_id ); ?></p><?php } ?>выводит только название и описание категории.
Пробовал
<?php $categories = get_categories(array('child_of' => 3)); ?><?php foreach ($categories as $child) { ?><h2><?php echo $child->cat_name; ?></h2><p> <?php echo $child->category_description; ?> </p><p><?php echo $child->get_field( 'text', $term->taxonomy . '_' . $term->term_id ); ?></p><?php } ?>получаю
Что я делаю не так? С php пока знаком косвенно.
Edited by НарекLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.