Home › Forums › General Issues › New acf entries not showing › Reply To: New acf entries not showing
Any idea why I’m having problems with this John?
I’m getting all data in correctly but I want to change the order displayed. When I put the relationship lookup first, the awards data (award name/year/short description) disappears. I can make it appear this way using absolute positioning but it stuffs up when it comes to other devices.
!! I will get this relationshi/reverse relationship stuff worked out one day 🙂
Thx
This is the order I want but cannot get
<?php $awards_query = new WP_Query( array( 'post_type' => 'awards', 'showposts' => 50, 'meta_key'=>'award_year', 'orderby' => 'meta_value_num' ) ); ?>
<?php while ($awards_query->have_posts()) : $awards_query->the_post(); ?>
<div class="vc_col-med-4 vc_col-lg-4 vc_col-sm-6 vc_col-xs-12 awards">
<?php foreach(get_field('project') as $post):
setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>" >
<?php the_post_thumbnail('awards', array( 'class' => 'award_img' ) ); ?></a>
<h3 class="award_project"><?php the_title(); ?></h3>
<?php endforeach; wp_reset_postdata(); ?>
<h2 class="award_name"><?php the_field('award_name'); ?> |
<?php the_field('award_year'); ?></h2>
<p><?php the_field('short_description'); ?></p>
</div><!--end cols -->
This is the work around I’m using with absolute positioning
<?php $awards_query = new WP_Query( array( 'post_type' => 'awards', 'showposts' => 50, 'meta_key'=>'award_year', 'orderby' => 'meta_value_num' ) ); ?>
<?php while ($awards_query->have_posts()) : $awards_query->the_post(); ?>
<div class="vc_col-med-4 vc_col-lg-4 vc_col-sm-6 vc_col-xs-12 awards">
<h2 class="award_name"><?php the_field('award_name'); ?> |
<?php the_field('award_year'); ?></h2>
<p><?php the_field('short_description'); ?></p>
<?php foreach(get_field('project') as $post):
setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>" >
<?php the_post_thumbnail('awards', array( 'class' => 'award_img' ) ); ?></a>
<h3 class="award_project"><?php the_title(); ?></h3>
<?php endforeach; wp_reset_postdata(); ?>
</div><!--end cols -->
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.