ID) . '">[...]'; } add_filter('excerpt_more', 'new_excerpt_more'); function acsr_post_player() { global $post; $audio = get_post_meta($post->ID, 'wpcf-audio', false); // most posts without audio have Array( ), but some posts have Array ( [0] => ) if(!empty($audio) and $audio[0]) { $get_artists = get_post_meta($post->ID, 'wpcf-artiste', false); $artists = ""; if (!empty($get_artists)): foreach($get_artists as $key => $val) { $artists .= $val; } endif; $annee = get_post_meta($post->ID, 'wpcf-annee', true); $duree = get_post_meta($post->ID, 'wpcf-duree', true); $genre = get_post_meta($post->ID, 'wpcf-genre', 'true'); $get_thematiques = get_post_meta($post->ID, 'wpcf-thematiques', true); $thematiques = ""; if (($get_thematiques)!=' '): foreach($get_thematiques as $keyc => $valc) { $thematiques .= $valc; } endif; $audio_title = the_title('', '', false); $args = array( "duree" => $duree, "genre" => $genre, "thematiques" => $thematiques, "annee" => $annee, "artiste" => $artists ); $qstring = http_build_query($args); sort($audio); $single = count($audio) == 1; // There is only one audio clip echo '
" . $annee . ""; $duree = get_post_meta($post->ID, 'wpcf-duree', true); if($duree != '') echo " " . $duree . ""; if (get_post_meta($post->ID, 'wpcf-genre', true)): echo "Genre :"; echo get_post_meta($post->ID, 'wpcf-genre', 'true') . "
"; endif; } /** AJOUTER CATEGORY POUR LES PRODICTIONS**/ add_action( 'init', 'register_cpt_production' ); function register_cpt_production() { $labels = array( 'name' => _x( 'production', 'production' ), 'singular_name' => _x( 'production', 'production' ), 'add_new' => _x( 'Ajouter', 'production' ), 'add_new_item' => _x( 'Ajouter un production', 'production' ), 'edit_item' => _x( 'Editer un productions', 'production' ), 'new_item' => _x( 'Nouveau productions', 'production' ), 'view_item' => _x( 'Voir le productions', 'production' ), 'search_items' => _x( 'Rechercher un productions', 'production' ), 'not_found' => _x( 'Aucun produit trouvé', 'production' ), 'not_found_in_trash' => _x( 'Aucun productions dans la corbeille', 'production' ), 'parent_item_colon' => _x( 'productions parent :', 'production' ), 'menu_name' => _x( 'productions', 'production' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'description' => 'Les productions de ma boutique.', 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'revisions' ), 'taxonomies' => array( 'category', 'post_tag' ), 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_nav_menus' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'has_archive' => true, 'query_var' => true, 'can_export' => true, 'rewrite' => true, 'capability_type' => 'post' ); register_post_type( 'production', $args ); } function acsr_setup() { /* * Makes ACSR available for translation. * * Translations can be added to the /languages/ directory. * If you're building a theme based on ACSR, use a find and replace * to change 'acsr' to the name of your theme in all the template files. */ load_theme_textdomain( 'acsr', get_template_directory() . '/languages' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'acsr' ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 442, 9999 ); // Unlimited height, soft crop } add_action( 'after_setup_theme', 'acsr_setup' ); /** * Enqueues scripts and styles for front-end. */ function acsr_scripts_styles() { global $wp_styles; /* * Loads our main stylesheet. */ wp_enqueue_style( 'acsr-style', get_stylesheet_uri() ); /* * Loads the Internet Explorer specific stylesheet. */ wp_enqueue_style( 'acsr-ie', get_template_directory_uri() . '/css/ie.css', array( 'acsr-style' ), '20121010' ); $wp_styles->add_data( 'acsr-ie', 'conditional', 'lt IE 9' ); } add_action( 'wp_enqueue_scripts', 'acsr_scripts_styles' ); /** * Creates a nicely formatted and more specific title element text * for output in head of document, based on current view. * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string Filtered title. */ function acsr_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'acsr' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'acsr_wp_title', 10, 2 ); /** * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link. * */ function acsr_page_menu_args( $args ) { if ( ! isset( $args['show_home'] ) ) $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'acsr_page_menu_args' ); /** * Registers our main widget area and the front page widget areas. */ function acsr_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'acsr' ), 'id' => 'sidebar-1', 'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'acsr' ), 'before_widget' => '', 'before_title' => '', '' ); ?>