Home › Forums › Front-end Issues › Build a menu from from multiple custom posts › Reply To: Build a menu from from multiple custom posts
Solution if anyone is look for it, managed to figure it out.
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'is_featured_product',
)
)
);
?>
<?php $loop = new WP_Query( $args ); ?>
<div class="nav subnav">
<ul id="menu-top-ten-product-menu" class="menu">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li>
<a href="<?php the_field('product_logo'); ?>">
<img src="<?php the_field('product_logo'); ?>" alt="">
</a>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>
</div>
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.