/
home
/
wqgepnx
/
www
/
wp-content
/
themes
/
prixexport
/
File Upload :
llllll
Current File: /home/wqgepnx/www/wp-content/themes/prixexport/functions.php
<?php /** * Understrap functions and definitions * * @package understrap */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } $understrap_includes = array( '/theme-settings.php', // Initialize theme default settings. '/setup.php', // Theme setup and custom theme supports. '/widgets.php', // Register widget area. '/enqueue.php', // Enqueue scripts and styles. '/template-tags.php', // Custom template tags for this theme. '/pagination.php', // Custom pagination for this theme. '/hooks.php', // Custom hooks. '/extras.php', // Custom functions that act independently of the theme templates. '/customizer.php', // Customizer additions. '/custom-comments.php', // Custom Comments file. '/jetpack.php', // Load Jetpack compatibility file. '/class-wp-bootstrap-navwalker.php', // Load custom WordPress nav walker. '/woocommerce.php', // Load WooCommerce functions. '/editor.php', // Load Editor functions. ); foreach ( $understrap_includes as $file ) { $filepath = locate_template( '/inc' . $file ); if ( ! $filepath ) { trigger_error( sprintf( 'Error locating /inc%s for inclusion', $file ), E_USER_ERROR ); } require_once $filepath; } // Size de l'image en HP add_image_size( 'hp', 220, 180, true ); // Ordre des catégories add_action( 'pre_get_posts', 'my_change_sort_order'); function my_change_sort_order($query){ if(is_archive()): $query->set( 'order', 'ASC' ); $query->set( 'orderby', 'title' ); endif; }; // Custom post type function wpm_custom_post_type() { $labels = array( 'name' => _x( 'Votes', 'Post Type General Name'), 'singular_name' => _x( 'Vote', 'Post Type Singular Name'), 'menu_name' => __( 'Votes'), 'all_items' => __( 'Toutes les Votes'), 'view_item' => __( 'Voir les Votes'), 'add_new_item' => __( 'Ajouter une nouvelle Vote'), 'add_new' => __( 'Ajouter'), 'edit_item' => __( 'Editer la Votes'), 'update_item' => __( 'Modifier la Votes'), 'search_items' => __( 'Rechercher une Vote'), 'not_found' => __( 'Non trouvée'), 'not_found_in_trash' => __( 'Non trouvée dans la corbeille'), ); $args = array( 'label' => __( 'Votes'), 'description' => __( 'Tous sur les Votes'), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', ), 'hierarchical' => false, 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'vote'), ); register_post_type( 'voting', $args ); $labels = array( 'name' => _x( 'Juries', 'Post Type General Name'), 'singular_name' => _x( 'jury', 'Post Type Singular Name'), 'menu_name' => __( 'Juries'), 'all_items' => __( 'Toutes les Juries'), 'view_item' => __( 'Voir les Juries'), 'add_new_item' => __( 'Ajouter une nouvelle jury'), 'add_new' => __( 'Ajouter'), 'edit_item' => __( 'Editer la Juries'), 'update_item' => __( 'Modifier la Juries'), 'search_items' => __( 'Rechercher une jury'), 'not_found' => __( 'Non trouvée'), 'not_found_in_trash' => __( 'Non trouvée dans la corbeille'), ); $args = array( 'label' => __( 'Juries'), 'description' => __( 'Tous sur les Juries'), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', ), 'hierarchical' => false, 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'jury'), ); register_post_type( 'jury', $args ); } add_action( 'init', 'wpm_custom_post_type', 0 ); $usermail = $_GET['mail']; /* function single_post_insert() { $new_post = array( 'post_title' => $usermail, 'post_content' => 'coucou', 'post_status' => 'publish', 'post_type' => 'voting' ); $pid = wp_insert_post($new_post); var_dump($usermail); echo json_encode(array('flag'=>'1')); die; } add_action( 'wp_ajax_single_post', 'single_post_insert' ); add_action( 'wp_ajax_nopriv_single_post', 'single_post_insert' ); */ function wpc_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter('upload_mimes', 'wpc_mime_types');
Copyright ©2k19 -
Hexid
|
Tex7ure