Home › Forums › Add-ons › Repeater Field › Repeater field for Sidebar Page Links › Reply To: Repeater field for Sidebar Page Links
Ok I now have this which displays the category image and all the posts associated with the category beneath it `<?php $args = array (
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘hide_empty’ => true,
);
$terms = get_terms( ‘category’, $args );
foreach ( $terms as $term ) {
echo ‘<br />’;
echo ” . ‘<img src=”‘ . get_field(‘category_image’, $term->taxonomy . ‘_’ . $term->term_id) . ‘”>’;
$post_args = array (
‘category_name’ => $term->slug,
‘posts_per_page’ => ‘-1’,
‘no_found_rows’ => true
);
$query = new WP_Query( $post_args );
while ( $query->have_posts() ) {
$query->the_post(); ?>
<br /><div class=”hidepost”><?php the_title(); ?></div>
<?php }
} ?>`
What I now need is a way to show or hide the page links on a page by page basis.
Anybody have any ideas how I might achieve this?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.