ma barre de navigation disparait quand je rajoutte mon super code :( (Créer un compte)

  • Statut : non résolu
Affichage de 1 message (sur 1 au total)
  • Auteur
    Messages
  • #459266
    radiCarl
    Membre
    Chevalier WordPress
    137 contributions

    Ma configuration WP actuelle
    – 2.5.1 :
    – i3Theme :
    http://www.radicarl.net :

    Problème(s) rencontré(s) :

    Bonjour,

    Il y a quelques jours, j’ai radicalement modifié l’apparence de mon blog en intégrant un nouveau thème, spécifiquement le fameux i3theme. Cependant, mon ancien thème avait l’avantage d’avoir une bannière distincte pour chaque page du blog. Malheureusement, quand je rajoute le code en question dans le « header » de mon nouveau thème, la barre de navigation (l’onglet avec les boutons accueil et intro) disparait complètement de la bannière. C’est à dire, si le code fonctionne bien, il génère toutefois un bug à la barre de navigation que je n’arrive pas à comprendre. Si bien qu’après plusieurs essais infructueux, je me résigne à vous demander votre aide.

    :D

    Voici mon header au complet, le code de mon ancien thème rajouté est indiqué entre les deux commentaires « rajout ».

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?> » />

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>


    <meta name="generator" content="WordPress <?php bloginfo('version'); ?> » /> <!-- leave this for stats -->
    <meta name="robots" content="index, follow" />
    <meta name="description" content="l'art de tout mêler à la politique : Projet Montréal, écologie, Web 2.0, infographie, Plateau Mont-Royal, entomologie" />
    <meta name="keywords" content="Carl Boileau, radical, radicarl, Projet Montréal, écologie, Web 2.0, infographie, Plateau Mont-Royal, Montréal, entomologie" />


    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?> » type= »text/css » media= »all » />
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/print.css » type= »text/css » media= »print » />

    <!-- Sidebar docking boxes (dbx) by Brothercake - http://www.brothercake.com/ -->
    <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/dbx.js"></script>
    <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/dbx-key.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/dbx.css » media= »screen, projection » />

    <!--[if lt IE 7]>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie-gif.css" type="text/css" />
    <![endif]-->

    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed » href= »<?php bloginfo('rss2_url'); ?> » />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?> » />

    <?php wp_head(); ?>
    </head>


    <body>
    <div id="page">
    <div id="wrapper">
    <div id="header">
    <h1><a href="<?php echo get_settings('home'); ?>« ></a></h1>


    <!-- /rajout -->
    <?php if (is_home() OR is_single()) : ?>

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/main-bg.jpg » style= »width: 1024px; height: 559px » alt= »radiCarl – Web Log » />
    <?php elseif (is_page(7)) : ?>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/top-intro.jpg » style= »width: 1024px; height: 559px » alt= »radiCarl – Web Log » />
    <?php else : ?>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/main-bg.jpg » style= »width: 1024px; height: 559px » alt= »radiCarl – Web Log » />
    <?php endif; ?>
    <!-- /rajout -->

    </div><!-- /header -->


    <?php
    $current_page = $post->ID; // Hack to prevent the no sidebar error
    include_once(« sidebar-left.php »);
    $post->ID = $current_page;
    ?>




    <div id="left-col">
    <div id="nav">
    <ul>
    <li class="page_item <?php if ( is_home() ) { ?>current_page_item<?php } ?>« ><a href="<?php echo get_settings('accueil/blogue'); ?>/ » title= »Page d’entrée »>accueil / blogue</a></li>
    <li> <a title="Présentation de ce site Web" href="/radicarl.net/intro" >Introduction</a></li>
    <li> <a title="Objectifs de ce site" href="/radicarl.net/mission" >Mission</a></li>
    <li> <a title="Nétiquette, protocole et conventions" href="/radicarl.net/chartre" >ma Chartre 2.0</a></li>
    <li> <a title="ou l'art de se présenter" href="/qui-suis-je" >Qui suis-je?</a></li>
    <li> <a title="parce que nous sommes ce que nous faisons" href="/portefolio" >Porte Folio</a></li>
    <li> <a title="Curriculum vitae" href="/radicarl.net/carl-boileau-cv" >CV</a></li>
    </ul>
    </div><!-- /nav -->



    <?php /* Menu for subpages of current page (thanks to K2 theme for this code) */
    global $notfound;
    if (is_page() and ($notfound != '1')) {
    // Code Remove: to prevent the no sidebar error.
    while($current_page) {
    $page_query = $wpdb->get_row(« SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = ‘$current_page' »);
    $current_page = $page_query->post_parent;
    }
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;


    // if ($wpdb->get_results(« SELECT * FROM $wpdb->posts WHERE post_parent = ‘$parent_id’ AND post_status != ‘attachment' »)) {
    if ($wpdb->get_results(« SELECT * FROM $wpdb->posts WHERE post_parent = ‘$parent_id’ AND post_type != ‘attachment' »)) {

    ?>

    <div id="subnav">
    <ul>
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&child_of='. $parent_id); ?>
    </ul>
    </div><!-- /sub nav -->

    <?php } } ?>

    Vous remarquerez ce code bizarre… qui a justement pour commentaire, « Hack to prevent the no sidebar error« 

    <?php 
    $current_page = $post->ID; // Hack to prevent the no sidebar error
    include_once(« sidebar-left.php »);
    $post->ID = $current_page;
    ?>

    Merci pour l’attention

Affichage de 1 message (sur 1 au total)
  • Vous devez être connecté pour répondre à ce sujet.