Awards website

I have post types called awards and nominee for one award (pictured in the screenshot) I have “Weather Event of The Year” and for this award I have nominees entered into the nominee post type. The problem I am running into at the moment is that nominees aren’t showing under the correct award. Am I going about this the right way? Can you suggest how I might achieve this setup?

Hey Daniel,

Thanks for writing in! I have checked your site and I am only seeing only 1 Nominee.

You are doing the correct way by the way. Just make sure that you add more Nominees.

Best Regards.

I think you have not understood me, which is probably my fault for not explaining clearly.

This screenshot is from wxawards.co.uk/awardsdir/. Each award will have its own nominees for which we’ll need to display ONLY them on each page. I’m not quite sure how to go about this…

I’ll go ahead and add some nominees to make testing easier.

Hello Daniel,

At the moment, in your Awards Single layout, you only have a Looper Provider Query Builder that displays all the Nominees. You would need to have a relation between the Awards and the Nominee first so that when you view a specific Award, a group of nominees related to the award will display. You may need to use ACF plugin which you already have. A field that will tie up the two custom post type is needed. It could be that in a Nominee item, there should be a field where you can assign to what Award.

Hope this makes sense.

I think I’m following but would appreciate some further help in setting this up. I have created the link with ACF and testing with “Jan 2023 Cold Spell” nominee, selected the award “Weather Event of The Year”

However it’s still showing the page (awards) and not the nominees…

Hey Daniel,

You need another Looper provider to access the ACF relationship. A good example is on these thread.

Hope that helps.

Not really @marc_a . Utterly confused to be honest…

I have changed the looper provider to dynamic content with {{dc:acf:post_field field=“field_63baefa652c1e”}} in the input field but it’s showing the same thing?

Hey Daniel,

You will need to check out this old thread:

You can then apply to your case and modify the query into:

$meta_query[] = array(
    'key'     => 'choose_award',
    'value'   => '123',
    'compare' => 'LIKE'
  );

 $query = array(
     'post_type'  => 'nominee',
     'meta_query' => $meta_query
 );


var_dump( http_build_query( $query ) );

which will give you the following query string:
post_type=post&meta_query%5B0%5D%5Bkey%5D=choose_award&meta_query%5B0%5D%5Bvalue%5D=123&meta_query%5B0%5D%5Bcompare%5D=LIKE

You will have to replace 123 with the dynamic shortcode {{dc:post:id}} as the ID of the current Award item.

Hope this makes sense.

Am I able to add a fallback to this post_type=post&meta_query%5B0%5D%5Bkey%5D=choose_award&meta_query%5B0%5D%5Bvalue%5D=123&meta_query%5B0%5D%5Bcompare%5D=LIKE

Hi Daniel,

You do not need to add a fallback. You need to use the {{dc:post:id}} so that when you view any of the Awards, it will automatically pull out the correct nominees for that award. If you use 123, it may not display anything.

Best Regards.