Get Value of Custom Field
As the $posts are the posts of post_type abschreibungstabelle, you can get the custom field values by using get_post_custom_values if( ! $posts ) return; $out=”<select id=”afa_select”><option>Anlagegut auswählen</option>”; foreach( $posts as $p ) { $custom_field_value = get_post_custom_values( ‘nutzungsdauer’, $p->ID ); // Now you can use the value the way you want $out .= ‘<option value=”‘ . … Read more