Support

Account

Home Forums Front-end Issues Custom Fields of Category for Custom post type

Unread

Custom Fields of Category for Custom post type

  • 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;
    }

Viewing 1 post (of 1 total)

The topic ‘Custom Fields of Category for Custom post type’ is closed to new replies.