09/16/2016 at 3:19 pm
#391790
Participant
Hi Steve,
Thanks for your help. I tried the code:
[connections meta_query='{"meta_query":{"0":{"key":"field_id_membership-cat","value":"supervisor","compare":"!="}}}']
and it displays all the records that have some value in the custom field, but it doesn’t filter them depending on the value.
I am not a coder and and kind learning as I go along. Below is the snippet I used to create my custom field. I want to have a directory page that only displays entries with the value “Analyst” and a separate page that only displays entries with the value “Supervisor”
// Register the metabox and fields.
add_action( 'cn_metabox', 'cn_register_custom_membership_category' );
function cn_register_custom_membership_category() {
$atts = array(
'title' => 'Your AJA Membership Category',
'id' => 'membership-cat',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Field Name',
'show_label' => FALSE,
'id' => 'field_id_membership-cat',
'type' => 'checkboxgroup',
'options' => array(
'Candidate' => 'Candidate',
'Analyst' => 'Analyst',
'Supervisor' => 'Supervisor',
'Professional Member' => 'Professional Member',
),
'default' => '',
),
),
);
cnMetaboxAPI::add( $atts );
}