Makale, blog ve benzeri sayfalarda Wordpress nav görünür değil

1 Cevap php

Benim wordpress * (özel bir şablon) * nav tüm tüm sayfaların üstünde çalışıyor ama şimdi Ana nav bu pages göstermek olmadığını öğrendim

Tüm sayfalar mesela search.php, single.php, index.php, page.php hepsi var <?php get_header(); ?>

Ne yanlış ben gerçekten bilmiyorum.

İşte benim header.php için kod

    <?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */
?>
<!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" <?php language_attributes() ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/sifr.css" type="text/css" />

<script src="<?php bloginfo('template_url'); ?>/js/sifr.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/js/sifr-config.js" type="text/javascript"></script>
<script src="http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js"></script>

<?php wp_head(); ?>
</head>
<?php
 $current_page = $post->ID;
 $parent = 1;

 while($parent) {
  $page_query = $wpdb->get_row("SELECT post_name, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
  $parent = $current_page = $page_query->post_parent;
  if(!$parent) $parent_name = $page_query->post_name;
 }
?>
<body id="<?php echo (is_page()) ? "$parent_name" : ((is_home()) ? "blog" : ((is_search()) ? "other" : ((is_single()) ? "blog" : "blog"))); ?>">
<div id="BGtie">

<!--HEAD WRAPPER-->
<div id="headwrapper">

<!--HEADER-->
<div id="headContainer">

<div id="nameTag">
<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
</div>

<!--TOP NAV-->
<div id="topNav">
<ul>
<li><a href="<?php bloginfo('url'); ?>home">Home</a></li>
<li><a href="#">Request info</a></li>
<li><a href="#">Contact us</a></li>
<?php do_action('icl_language_selector'); ?>
</ul>


</div>
<!--END TOP NAV-->

<!--MAIN NAV-->
<?php if ( is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'fr') ) {include("main-nav-fr.php");} ?>
<?php if (is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'en')) include("main-nav-en.php") ?>
<!--END MAIN NAV-->

</div>
<!--END HEADER-->

</div>

<!--END HEAD WRAPPER-->
</div>

1 Cevap

<!--MAIN NAV-->
<?php if ( is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'fr') ) {include("main-nav-fr.php");} ?>
<?php if (is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'en')) include("main-nav-en.php") ?>
<!--END MAIN NAV-->

is_page () ne zaman blog yazısı false döndürür. Is_page çıkarın ve ince olmalıdır.

Daha fazla okuma - http://codex.wordpress.org/Conditional_Tags