plugins – How to display ACF coustom field from category on author.php


I use ACF added a coustom field for category.

it works fine in archive.php , here is code:

<?php echo get_field('students_no_class', get_queried_object() );?>

but it doesn’t work in author.php , nothing show up.

in author page I need disaply coustom field value after

<?php if (have_posts()) : while (have_posts()) : the_post();?>

I also did a test:when I delete author.php, the author page will use archive.php template and the coustom field show up nothing.

user18787 1 year 2021-08-30T00:19:01-05:00 0 Answers 0 views 0

Leave an answer