I am trying to create another class using the value of a text field from ACF PRO.
I have a custom post type named "portfolio" and it has a 4 categories, the ACF field setting is added to "taxonomy is equal to category".
When I edit a category I fill in the name that I want to get and then display like this :
<div class="grid-item-catalog catalog-project-Holder **the name need to be here**">
How do I get the ACF field value from the category?
Other information: my page template is page-portfolio.php and I am using an ACF repeater.
This is my code :
<!-- catalog -->
<div class="grid-catalog catalog-portfolio-wrraper">
<?php if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ?>
<!-- Repeater -->
<?php if( have_rows('portfolio-projects-repeater') ){ ?>
<?php while( have_rows('portfolio-projects-repeater') ) { the_row();
// vars
$projectDescription = get_sub_field('project-name');
$projectImage = get_sub_field('project-image');
$projectLinkText = get_sub_field('project-link-text');
$projectLink = get_sub_field('project-link');
?>
<div class="grid-item-catalog catalog-project-Holder {the name need to be here}">
<div class="catalog-project-name"><?php the_title(); ?></div>
<div class="catalog-project-content-container">
<div class="catalog-project-image"><img src="<?php echo $projectImage['url']; ?>" alt="<?php echo $projectImage['alt'] ?>" /></div>
<div class="catalog-project-content">
<div class="description-link-container">
<div class="description"><?php echo $projectDescription; ?></div>
<div class="link"><a href="<?php echo $projectLink; ?>" target="_blank" rel="nofollow"><?php echo $projectLinkText; ?></a></div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
<!-- End Repeater -->
<?php } ?>
<?php } ?>
</div>
<!-- end catalog -->
This is a screenshot of the settings for the category's ACF field, I hope it helps: