I've many articles in a K2 category called "houses". Each article has an extra field called "address" and I need to show in a page this extra field for each article.
Something like this (a là Wordpress):
$houses = get_k2_articles_from_category('houses');
foreach ($houses as $house){
echo $house->address;
}
Is it possible?
you have to override your k2 template
and add <?php echo $item->extraFields->YOUR_ALIAS_HERE->value; ?>
<?php echo $item->extraFields->YOUR_ALIAS_HERE->value; ?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.