Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul>
- <?php $args = array('post_type' => 'formation');?>
- <?php $loop = new WP_Query($args);?>
- <?php while ($loop -> have_posts()): $loop->the_post();?>
- <li>
- <?php the_post_thumbnail('cpt_formation');?>
- <div class="container-other">
- <h4><?php the_title();?></h4>
- <p><?php the_content();?>
- </p>
- <a href="<?php the_field('url_formation');?>">En savoir plus</a>
- </div>
- </li>
- <?php endwhile;?>
- </ul>
- function custom_formation(){
- $labels = array(
- 'name' => 'Formation',
- 'all_items' => 'Toutes les formations', // affiché dans le sous menu
- 'singular_name' => 'Formation',
- 'add_new_item' => 'Ajouter une formation',
- 'edit_item' => 'Modifier la formation',
- 'menu_name' => 'Formation'
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_in_rest' => true,
- 'has_archive' => true,
- 'supports' => array( 'title', 'editor','thumbnail' ),
- 'menu_position' => 5,
- 'menu_icon' => 'dashicons-format-status',
- );
- register_post_type( 'formation', $args );
- enter register_taxonomy(
- 'thematique',
- 'formation',
- array(
- 'label' => 'Thématiques',
- 'labels' => array(
- 'name' => 'Thématiques',
- 'singular_name' => 'Thématiques',
- 'all_items' => 'Toutes les Thématiques',
- 'edit_item' => 'Éditer la Thématique',
- 'view_item' => 'Voir la Thématiques',
- 'update_item' => 'Mettre à jour la Thématiques',
- 'add_new_item' => 'Ajouter une Thématiques',
- 'new_item_name' => 'Nouvelle Thématiques',
- 'search_items' => 'Rechercher parmi les Thématiques',
- 'popular_items' => 'Thématiques les plus utilisés',
- ),
- 'hierarchical' => true,
- 'show_in_rest' => true,
- 'rewrite'=>false,
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement