Bonjour à tous,
je viens de modifier le design de mon blog mais il y a encore des petits éléments qui me chiffonnent à savoir que la side-barre de menu, pour une raison que j'ignore change de taille au moment du scroll... Je voudrais qu'elle soit toujours de la même taille qu'elle ne bouge plus et qu'elle reste de préférence dasn sa version la plus "étroite" soit au moment du scroll...
Je ne sais même pas où trouver le code qui gère ça... Probablement dans functions.php ?
Dans le doute je vous colle ici l'ensemble du code... j'espère trouver une âme charitable qui me permettra de résoudre ce problème.
Merci beaucoup d'avance.
Modifié par lauretteflechette (12 Oct 2015 - 11:33)
je viens de modifier le design de mon blog mais il y a encore des petits éléments qui me chiffonnent à savoir que la side-barre de menu, pour une raison que j'ignore change de taille au moment du scroll... Je voudrais qu'elle soit toujours de la même taille qu'elle ne bouge plus et qu'elle reste de préférence dasn sa version la plus "étroite" soit au moment du scroll...
Je ne sais même pas où trouver le code qui gère ça... Probablement dans functions.php ?
Dans le doute je vous colle ici l'ensemble du code... j'espère trouver une âme charitable qui me permettra de résoudre ce problème.
<?php
/**
* Radiate functions and definitions
*
* @package ThemeGrill
* @subpackage Radiate Pro
* @since Radiate Pro 1.0
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 768; /* pixels */
}
/**
* $content_width global variable adjustment as per layout option.
*/
function radiate_content_width() {
global $post;
global $content_width;
if( $post ) { $layout_meta = get_post_meta( $post->ID, 'radiate_page_layout', true ); }
if( empty( $layout_meta ) || is_archive() || is_search() || is_home() ) { $layout_meta = 'default_layout'; }
$radiate_default_layout = get_theme_mod( 'default_layout', 'right_sidebar' );
if( $layout_meta == 'default_layout' ) {
if ( $radiate_default_layout == 'no_sidebar_full_width' ) { $content_width = 1158; /* pixels */ }
else { $content_width = 768; /* pixels */ }
}
elseif ( $layout_meta == 'no_sidebar_full_width' ) { $content_width = 1158; /* pixels */ }
else { $content_width = 768; /* pixels */ }
}
add_action( 'template_redirect', 'radiate_content_width' );
if ( ! function_exists( 'radiate_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function radiate_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on radiate, use a find and replace
* to change 'radiate' to the name of your theme in all the template files
*/
load_theme_textdomain( 'radiate', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Post thumbail is used for pages that are shown in the featured section of Front page.
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'radiate' ),
) );
// Enable support for Post Formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'radiate_custom_background_args', array(
'default-color' => 'EAEAEA',
'default-image' => '',
) ) );
// Adding excerpt option box for pages as well
add_post_type_support( 'page', 'excerpt' );
// Cropping images to different sizes to be used in the theme
add_image_size( 'featured-image-medium', 768, 350, true );
}
endif; // radiate_setup
add_action( 'after_setup_theme', 'radiate_setup' );
/**
* Register widgetized area and update sidebar with default widgets.
*/
function radiate_widgets_init() {
register_sidebar( array(
'name' => __( 'Right Sidebar', 'radiate' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Left Sidebar', 'radiate' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Registering footer sidebar one
register_sidebar( array(
'name' => __( 'Footer Sidebar One', 'radiate' ),
'id' => 'radiate_footer_sidebar_one',
'description' => __( 'Shows widgets at footer sidebar one.', 'radiate' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title"><span>',
'after_title' => '</span></h3>'
) );
// Registering footer sidebar two
register_sidebar( array(
'name' => __( 'Footer Sidebar Two', 'radiate' ),
'id' => 'radiate_footer_sidebar_two',
'description' => __( 'Shows widgets at footer sidebar two.', 'radiate' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title"><span>',
'after_title' => '</span></h3>'
) );
// Registering footer sidebar three
register_sidebar( array(
'name' => __( 'Footer Sidebar Three', 'radiate' ),
'id' => 'radiate_footer_sidebar_three',
'description' => __( 'Shows widgets at footer sidebar three.', 'radiate' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title"><span>',
'after_title' => '</span></h3>'
) );
}
add_action( 'widgets_init', 'radiate_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function radiate_scripts() {
// Load our main stylesheet.
wp_enqueue_style( 'radiate-style', get_stylesheet_uri() );
$radiate_googlefonts = array();
if( get_theme_mod( 'radiate_site_title_font', 'Default' ) != 'Default' ) { array_push( $radiate_googlefonts, get_theme_mod( 'radiate_site_title_font' ) ); }
if( get_theme_mod( 'radiate_site_tagline_font', 'Default' ) != 'Default' ) { array_push( $radiate_googlefonts, get_theme_mod( 'radiate_site_tagline_font' ) ); }
if( get_theme_mod( 'radiate_menu_font', 'Default' ) != 'Default' ) { array_push( $radiate_googlefonts, get_theme_mod( 'radiate_menu_font' ) ); }
if( get_theme_mod( 'radiate_all_titles_font', 'Default' ) != 'Default' ) { array_push( $radiate_googlefonts, get_theme_mod( 'radiate_all_titles_font' ) ); }
if( get_theme_mod( 'radiate_content_font', 'Default' ) != 'Default' ) { array_push( $radiate_googlefonts, get_theme_mod( 'radiate_content_font' ) ); }
if( get_theme_mod( 'radiate_site_title_font', 'Default' ) == 'Default' || get_theme_mod( 'radiate_site_tagline_font', 'Default' ) == 'Default' || get_theme_mod( 'radiate_menu_font', 'Default' ) == 'Default' || get_theme_mod( 'radiate_all_titles_font', 'Default' ) == 'Default' ) {
array_push( $radiate_googlefonts, 'Roboto' );
}
if( get_theme_mod( 'radiate_content_font', 'Default' ) == 'Default' ) { array_push( $radiate_googlefonts, 'Merriweather:400,300' ); }
$radiate_googlefonts = array_unique( $radiate_googlefonts );
$radiate_googlefonts = implode("|", $radiate_googlefonts);
wp_register_style( 'radiate_googlefonts', '//fonts.googleapis.com/css?family='.$radiate_googlefonts );
wp_enqueue_style( 'radiate_googlefonts' );
wp_enqueue_script( 'radiate-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'radiate-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'radiate-custom-js', get_template_directory_uri() . '/js/custom.js', array('jquery'),'',false );
$radiate_header_image_link = get_header_image();
$header_type = get_theme_mod( 'radiate_header_display_type', 'type_1_default' );
$header_resize = get_theme_mod( 'radiate_header_resize' );
if( get_theme_mod( 'radiate_slide_on_off' ) == 0 ){
if( $radiate_header_image_link == '')
$push_height = '1';
else
$push_height = '0';
}
else {
if ( get_theme_mod( 'radiate_slide_all_page' ) == 1 )
$push_height = '0';
else {
if( is_home() || is_front_page() )
$push_height = '0';
else
$push_height = '1';
}
}
if ( get_theme_mod( 'header_image_responsive_on_off' ) == 1 && get_theme_mod( 'radiate_slide_on_off' ) != 1 && get_header_image() ) {
$responsiveness = '1';
} else {
$responsiveness = '0';
}
wp_localize_script( 'radiate-custom-js', 'radiateScriptParam', array('header_type_key'=> $header_type, 'push_height_key'=>$push_height, 'header_resize'=>$header_resize, 'slider_on_off_check' => get_theme_mod( 'radiate_slide_on_off'), 'responsiveness' => $responsiveness ) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if( get_theme_mod( 'radiate_slide_on_off' ) == 1 ) {
if( ( is_home() || is_front_page() ) && ( get_theme_mod( 'radiate_slide_all_page' ) != 1 ) ) {
wp_register_script( 'radiate_jquery_cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true );
wp_enqueue_script( 'radiate_slider', get_template_directory_uri() . '/js/radiate-slider-setting.js', array( 'radiate_jquery_cycle' ), false, true );
}
elseif ( get_theme_mod( 'radiate_slide_all_page' ) == 1 ) {
wp_register_script( 'radiate_jquery_cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true );
wp_enqueue_script( 'radiate_slider', get_template_directory_uri() . '/js/radiate-slider-setting.js', array( 'radiate_jquery_cycle' ), false, true );
}
}
$radiate_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(preg_match('/(?i)msie [1-8]/',$radiate_user_agent)) {
wp_enqueue_script( 'html5', get_template_directory_uri() . '/js/html5shiv.js', true );
}
}
add_action( 'wp_enqueue_scripts', 'radiate_scripts' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load meta box file.
*/
require get_template_directory() . '/inc/meta-box.php';
Merci beaucoup d'avance.
Modifié par lauretteflechette (12 Oct 2015 - 11:33)