Hi,
I am trying to get all the categories for the custom post that I have created with the custom field.I am not able to get the custom field value
This is my following code
$customPostTaxonomies = get_object_taxonomies(‘answer’);
if(count($customPostTaxonomies) > 0){
$args = array(
‘orderby’ => ‘name’,
‘show_count’ => 0,
‘pad_counts’ => 0,
‘hierarchical’ => 1,
‘taxonomy’ => $customPostTaxonomies,
‘exclude’ => array(1),
‘title_li’ => ”,
‘show_option_none’=> ”
);
$categories = get_categories($args);
foreach($categories as $ca){
$taxonomy = $ca->taxonomy;
$term_id = $ca->term_id;
$GLOBALS[‘wp_embed’]->post_ID = $taxonomy . ‘_’ . $term_id;
$get_custom_fl = get_fields(‘_select_menu_type’, $GLOBALS[‘wp_embed’]->post_ID);
echo $get_custom_fl;
}