Hallo, die Taxonomy für mein Custom Post type wird leider nicht angezeigt. Ich sehe nur die Überschrift , bzw. den Namen der Taxonomy auf meiner Seite ,sonst nichts.
ZitatAlles anzeigen// Custom Post-Type Unterkunft erstellen
function custom_post_type() {
$labels = array(
'name' => __( 'Unterkünfte', 'Post Type General Name', 'text_domain' ),
'singular_name' => __( 'Unterkunft', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Unterkünfte', 'text_domain' ),
'parent_item_colon' => __( '', 'text_domain' ),
'all_items' => __( 'Alle Unterkünfte', 'text_domain' ),
'view_item' => __( 'Unterkunft ansehen', 'text_domain' ),
'add_new_item' => __( 'neue Unterkunft erstellen', 'text_domain' ),
'add_new' => __( 'Neue Unterkunft', 'text_domain' ),
'edit_item' => __( 'Unterkunft bearbeiten', 'text_domain' ),
'update_item' => __( 'Unterkunft updaten', 'text_domain' ),
'search_items' => __( 'Unterkunft suchen', 'text_domain' ),
'not_found' => __( 'keine Unterkünfte gefunden', 'text_domain' ),
'not_found_in_trash' => __( 'Keine Unterkunft im Papierkorb', 'text_domain' ),
);
$args = array(
'label' => __( 'unterkunft', 'text_domain' ),
'description' => __( 'Beschreibung der Unterkunft', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title','excerpt','editor', 'thumbnail', 'comments',),
'taxonomies' => array( '', ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => get_bloginfo('template_directory').'/images/unterkunft.png',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'unterkunft', $args );
}
// Register Custom Taxonomy
function Objekttyp() {
$labels = array(
'name' => _x( 'Objekttypen', 'Taxonomy General Name', 'text_domain' ),
'singular_name' => _x( 'Objekttyp', 'Taxonomy Singular Name', 'text_domain' ),
'menu_name' => __( 'Objekttyp', 'text_domain' ),
'all_items' => __( 'All Genres', 'text_domain' ),
'parent_item' => __( 'Parent Genre', 'text_domain' ),
'parent_item_colon' => __( 'Parent Genre:', 'text_domain' ),
'new_item_name' => __( 'New Genre Name', 'text_domain' ),
'add_new_item' => __( 'Neuen Typ hinzufügen', 'text_domain' ),
'edit_item' => __( 'Typ ändern', 'text_domain' ),
'update_item' => __( 'Update Genre', 'text_domain' ),
'separate_items_with_commas' => __( 'Separate genres with commas', 'text_domain' ),
'search_items' => __( 'Objekttyp suchen', 'text_domain' ),
'add_or_remove_items' => __( 'Add or remove genres', 'text_domain' ),
'choose_from_most_used' => __( 'Choose from the most used genres', 'text_domain' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'rewrite' => true,
);
register_taxonomy( 'objekttyp', 'unterkunft', $args );
}
Ich weiß allerdings auch nicht so genau was in der taxonomy.php stehen muss.
ZitatAlles anzeigen<?php get_header(); ?> <div id="wrapper">
<div id="main">
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?> <!-- gghghghghghghg -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php echo get_the_term_list( $post->ID, 'objekttyp', '' ); ?>
<div class="artikel-unterkunft"> <!-- /* Anfang Text */ -->
<div id="startthumb"><a href="<?php the_permalink() ?>"><?php if (has_post_thumbnail()) { the_post_thumbnail('related-post-thumbnail'); } ?></a>
</div>
<div class="description">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="startdescription">
<span style="font-size: 20px;"><?php the_terms($post->ID,'objekttyp'); ?> für
1-<?php the_field('personen'); ?> Personen<br/></span>
<strong><?php the_field('anzahl_zimmer:');?> Zimmer | <?php the_field('anzahl_schlafzimmer');?> Schlafzimmer | <?php the_field('anzahl_wohnzimmer');?> Wohnzimmer </strong><br /></span>
<span style="font-size: 15px;"> <?php the_field('grosse');?> qm Wohnfläche</span>
</div>
<div class="preis"><span>ab<strong> € <?php the_field('woche'); ?>/Woche</strong></span><br />
<div class="ausstattungs-liste" style="padding-left:0;width:145px">
<?php if ( is_array( get_field('ausstattung') ) ) : ?>
<?php foreach( (array) get_field('ausstattung') as $icon ) : ?>
<span class="icon <?php echo $icon; ?>"alt="<?php echo $icon; ?>" title="<?php echo $icon; ?>"></span>
<?php endforeach; ?>
<?php endif; ?> <br />
</div>
</div>
</div>
<div class="clearen"></div>
</div><!-- Ende Artikel -->
<?php endwhile; endif; ?>
</div> <div class="unterstrichen"></div>
<?php get_sidebar(); ?>
<div class="clearen"></div>
</div> <!-- Ende Wrapper -->
<?php get_footer(); ?>
<?php wp_footer(); ?>
ist das soweit richtig? oder wo liegen die Fehler?