Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
- function my_theme_enqueue_styles() {
- $parent_style = 'parent-style';
- wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
- wp_enqueue_style( 'child-style',
- get_stylesheet_directory_uri() . '/style.css',
- array( $parent_style ),
- wp_get_theme()->get('Version')
- );
- }
- function wpm_custom_post_type() {
- $labels = array(
- 'name' => 'Réalisations',
- 'singular_name' => 'Réalisation',
- 'menu_name' => 'Réalisations',
- 'all_items' => __( 'Toutes les réalisations'),
- 'view_item' => __( 'Voir les réalisations'),
- 'add_new_item' => __( 'Ajouter une nouvelle réalisation'),
- 'add_new' => __( 'Ajouter'),
- 'edit_item' => __( 'Editer la réalisation'),
- 'update_item' => __( 'Modifier la réalisation'),
- 'search_items' => __( 'Rechercher une réalisation'),
- 'not_found' => __( 'Non trouvée'),
- 'not_found_in_trash' => __( 'Non trouvée dans la corbeille')
- );
- $args = array(
- 'labels' => $labels,
- 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt'),
- 'hierarchical' => false,
- 'public' => true,
- 'has_archive' => true,
- 'rewrite' => array( 'slug' => 'nos-realisations')
- );
- register_post_type( 'realisations', $args );
- }
- add_action( 'init', 'wpm_custom_post_type', 0 );
- function add_realisations_taxonomies() {
- $labels_types = array(
- 'name' => 'Types',
- 'singular_name' => 'Type',
- 'search_items' => 'Rechercher',
- 'all_items' => 'Tous les types',
- 'edit_item' => 'Modifier',
- 'update_item' => 'Mettre à jour',
- 'add_new_item' => 'Ajouter un type',
- 'new_item_name' => 'Nouveau type',
- 'menu_name' => 'Types',
- );
- $args_types = array(
- 'hierarchical' => true,
- 'labels' => $labels_types,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'nos-types' ),
- );
- register_taxonomy( 'types', array( 'realisations' ), $args_types );
- }
- add_action( 'init', 'add_realisations_taxonomies', 0 );
- add_action( 'init', 'produits' );
- function produits() {
- $labels_produits = array(
- 'name' => 'Produits',
- 'singular_name' => "Produit",
- 'menu_name' => "Mes produits",
- 'name_admin_bar' => "Produits",
- 'add_new' => "Ajouter",
- 'add_new_item' => "Ajouter un nouveau produit",
- 'new_item' => "Nouveau produit",
- 'edit_item' => "Modifier",
- 'view_item' => "Voir",
- 'all_items' => "Tous les produits",
- 'search_items' => "Rechercher",
- 'not_found' => "Non trouvé",
- 'not_found_in_trash' => "Non trouvé dans la corbeille"
- );
- $args_produits = array(
- 'labels' => $labels_produits,
- 'description' => __( 'Description.', 'your-plugin-textdomain' ),
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'nos-produits' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
- );
- register_post_type( 'produits', $args_produits );
- }
- add_action( 'init', 'rayons', 0 );
- function rayons() {
- // Add new taxonomy, make it hierarchical (like categories)
- $labels_rayons = array(
- 'name' => 'Rayons',
- 'singular_name' => 'Rayon',
- 'search_items' => 'Rechercher les rayons',
- 'all_items' => 'Tous les rayons',
- 'parent_item' => 'Rayons',
- 'edit_item' => 'Modifier',
- 'update_item' => 'Mise à jour des rayons',
- 'add_new_item' => 'Ajouter un nouveau rayon',
- 'new_item_name' => 'Nouveau rayon',
- 'menu_name' => 'Rayons'
- );
- $args_rayons = array(
- 'hierarchical' => true,
- 'labels' => $labels_rayons,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'nos-rayons' ),
- );
- register_taxonomy( 'rayons', array( 'produits' ), $args_rayons );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement