I have a repeater field,i want to display sub field data only for logged in user
how to?
my field
<?php if ( have_rows( ‘downloads_nhieu_phien_ban’ ) ) : ?>
<?php while ( have_rows( ‘downloads_nhieu_phien_ban’ ) ) : the_row(); ?>
<?php the_sub_field( ‘nhap_link’ ); ?>
<?php the_sub_field( ‘ten_version_link’ ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php // no rows found ?>
<?php endif; ?>
if (is_user_logged_in()) {
if (have_rows(... etc
}
<?php
if ( is_user_logged_in() ) {
if ( have_rows( ‘downloads_nhieu_phien_ban’ ) ){
while ( have_rows( ‘downloads_nhieu_phien_ban’ ) ) {
the_row();{
the_sub_field( ‘ten_version_link’ );
the_sub_field( ‘nhap_link’ );
else {
?><p>you must be logged in to view the form</p><?php }
}
}
}
}
?>
my code but don’t work