I am developing a site for a client who is a Youth Football (Soccer) Club, with lots of different Teams depending on the abilities and ages of the children. I have added in a Custom Post Type called Match Reports so that the Managers of each Team can login and write posts for their latest matches their teams were involved in.
I also have a News section using the standard Posts part of WP. I have written a Shortcode which will display the News on the Homepage. What I want to be able to do is enable a system where one of the Match Reports can be added to the Homepage by selecting an option, using the Advanced Custom Fields plugin - it is a two-option radio button form, with true/false values - Show on Homepage? Yes/No.
In my News shortcode, I have added the Match Reports Custom Post Type in, which works perfectly, but I am not sure how to only show the Reports with the "Show on Homepage - Yes" radio button selected. Here are my Query Parameters:
$queryArgs = array(
"post_type" => array( "post", "match-report" ),
"meta_key" => "show_in_news",
"meta_value" => "true"
The problem with this is that because the standard Posts do not have the Custom Field in, only the Match Reports show up, and if I remove the Custom Field queries, it will show all the Match Reports together with the Posts. I need it to only show the Match Reports with
show_in_news (my Custom Field with radio buttons, created with Advanced Custom Fields, with a value of a
true, together with all of the Posts.
Can anyone help me out? Thanks very much if so :)