merci pour ta réponse,
j'avais vu cette discussion et je dois dire que je ne l'avais pas vraiment compris, mon anglais ne me permet pas de comprendre certaine subtilité (le premier post) du coup je n'etait pas sur que c'était la réponse à ma question.
Maintenant que tu me confirme que oui, j'ai un problème plus "technique" : je ne suis pas sur de ce que je dois faire.
Tu me dis si je me trompe.
je dois mettre le code suivant :
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
if( put something here ) ) ){
$classes[] = 'active ';
}
return $classes;
}
dans mon fichier function.php, c'est ça ?
mais je maitrise très très très très mal le php donc peux-tu me préciser où, voici l'intégralité de mon fichier function.php
<?php
/**
* Functions.php contains all the core functions for your theme to work properly.
* Please do not edit this file!!
*
* @package Thoughts WordPress Theme
* @since 1.0
* @author AJ Clarke : http://wpexplorer.com
* @copyright Copyright (c) 2012, AJ Clarke
* @link http://wpexplorer.com
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/*
* Loads the Options Panel
*
* If you're loading from a child theme use stylesheet_directory
* instead of template_directory
*/
define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/options-framework/' );
require_once dirname( __FILE__ ) . '/options-framework/options-framework.php';
// Define Constants
define( 'WPEX_JS_DIR', get_template_directory_uri().'/js' );
define( 'WPEX_CSS_DIR', get_template_directory_uri().'/css' );
// Theme Setup
if ( !function_exists( 'wpex_setup' ) ) {
function wpex_setup() {
//default width of primary content area
$content_width = 945;
//theme support
add_theme_support('automatic-feed-links');
add_theme_support('custom-background');
add_theme_support('post-thumbnails');
//register navigation menus
register_nav_menus ( array(
'main_menu' => __( 'Main Menu', 'wpex' )
) );
// Add Post Formats Support
add_theme_support( 'post-formats', array( 'video', 'quote', 'link', 'audio', 'image', 'gallery' ) );
//Localization support
load_theme_textdomain( 'wpex', get_template_directory() .'/lang' );
}
}
add_action( 'after_setup_theme', 'wpex_setup' );
// TGM Plugin Activation => https://github.com/thomasgriffin/TGM-Plugin-Activation
require_once ( get_template_directory() .'/functions/recommend-plugins.php' );
// Includes
require_once( get_template_directory() .'/functions/scripts.php' );
require_once ( get_template_directory() .'/functions/hooks.php' );
require_once( get_template_directory() .'/functions/theme_customizer.php' );
require_once( get_template_directory() .'/functions/font_awesome.php' );
require_once( get_template_directory() .'/functions/pagination.php' );
require_once( get_template_directory() .'/functions/img_resizer.php' );
require_once( get_template_directory() .'/functions/img_defaults.php' );
require_once( get_template_directory() .'/functions/wpex_comments_output.php' );
if( is_admin( )) {
require_once( get_template_directory() .'/functions/gallery-metabox/gmb-admin.php' );
require_once( get_template_directory() .'/functions/post_meta.php' );
require_once( get_template_directory() .'/functions/dashboard-feed.php' );
require_once( get_template_directory() .'/functions/welcome.php' );
} else {
require_once( get_template_directory() .'/functions/gallery-metabox/gmb-display.php' );
}
// Image caption
if ( !function_exists( 'wpex_post_feat_img_caption' ) ) :
function wpex_post_feat_img_caption() {
global $post;
$thumbnail_image = get_posts( array( 'p' => get_post_thumbnail_id( get_the_ID() ), 'post_type' => 'attachment') );
if ( $thumbnail_image[0]->post_content !== '' ) {
echo '<p class="single-portfolio-image-description clearfix">'.$thumbnail_image[0]->post_content.'</p>';
}
}
endif;
// Change default read more style
if ( !function_exists( 'wpex_new_excerpt_more' ) ) {
function wpex_new_excerpt_more($more) {
global $post;
return '...';
}
}
add_filter('excerpt_more', 'wpex_new_excerpt_more');
// Change default excerpt length
if ( !function_exists( 'wpex_custom_excerpt_length' ) ) {
function wpex_custom_excerpt_length( $length ) {
return get_theme_mod( 'wpex_excerpt_length', '100' );
}
}
add_filter( 'excerpt_length', 'wpex_custom_excerpt_length', 999 );
merci d'avance