Breadcrumb NavXT 3.4.1
-
WordPress 2.9.2 日本語版の default のテンプレートに Breadcrumb NavXT 3.4.1 をインストールし有効化して、パンくずナビを設置していますが、固定ページのみ表示位置がずれて文字のサイズが小さくなります。
archive.phpのnavigationをコメントアウトして <div id=”content” class=”narrowcolumn” role=”main”> の直下と content の閉じタグの直前に以下のコードを貼り付けました。<div class=”breadcrumb”>
<?php
if(function_exists(‘bcn_display’))
{
bcn_display();
}
?>
</div>間違っているところがあればご指摘の上、解決法をご教示ください。
-
Firefox+Firebug か Chrome+Firebug Lite で
.breadcrumb のスタイルが固定ページとその他で違いがないか確認すると良いです。
よくわからない場合は、問題の発生している URL を提示すると話が早いです。kzさん、返信ありがとうございます。
問題の発生しているURLはhttp://eiji.in/wp/です。トップページと自己紹介のページのナビゲーションの表示位置や文字のサイズをカテゴリーのナビゲーションと同じようにしたいのです。
宜しくお願いします。トップページ,自己紹介のページでは
<div id="content" class="narrowcolumn" role="main">
の直下では無くて、直前にパンくずを出力されてますので
直下に移動すれば OK だと思います。何度もすみません。
パンくずはarchive.phpのcontent直下にあります。archive.phpに設置する事が間違いではないかと思いheader.phpに設置しても変わりません。
宜しくお願いします。kzさんのご指摘をご理解いただけましたか?
固定ページ
<div class=”breadcrumb”>
<div id=”content” class=”narrowcolumn” role=”main”>ブログ
<div id=”content” class=”narrowcolumn” role=”main”>
<div class=”breadcrumb_top”>中略していますが、パンクズを入れるところが違っています。
kvexさん、返信有難うございます。
archive.php のところに
<div class=”breadcrumb”>
<div id=”content” class=”narrowcolumn” role=”main”>
<div class=”breadcrumb_top”>
と試してみましたが、やっぱり言われた事が解っていないようです。
具体的にどこに入れたらいいのでしょうか。
宜しくお願いします。
archive.php のコードは以下のとおりです。
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/get_header();
?><div class=”breadcrumb”>
<?php
if(function_exists(‘bcn_display’))
{
bcn_display();
}
?>
</div><div id=”content” class=”narrowcolumn” role=”main”>
<div class=”breadcrumb_top”>
<?php
if(function_exists(‘bcn_display’))
{
bcn_display();
}
?>
</div><?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class=”pagetitle”><?php printf(__(‘Archive for the ‘%s’ Category’, ‘kubrick’), single_cat_title(”, false)); ?></h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class=”pagetitle”><?php printf(__(‘Posts Tagged ‘%s’’, ‘kubrick’), single_tag_title(”, false) ); ?></h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class=”pagetitle”><?php printf(_c(‘Archive for %s|Daily archive page’, ‘kubrick’), get_the_time(__(‘F jS, Y’, ‘kubrick’))); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class=”pagetitle”><?php printf(_c(‘Archive for %s|Monthly archive page’, ‘kubrick’), get_the_time(__(‘F, Y’, ‘kubrick’))); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class=”pagetitle”><?php printf(_c(‘Archive for %s|Yearly archive page’, ‘kubrick’), get_the_time(__(‘Y’, ‘kubrick’))); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class=”pagetitle”><?php _e(‘Author Archive’, ‘kubrick’); ?></h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?>
<h2 class=”pagetitle”><?php _e(‘Blog Archives’, ‘kubrick’); ?></h2>
<?php } ?><div class=”navigation”><!–breadcrumbとwp-pagenaviを使う為にdefaultをコメントアウト
<div class=”alignleft”>
<?php next_posts_link(__(‘« Older Entries’, ‘kubrick’)); ?>
</div>
<div class=”alignright”>
<?php previous_posts_link(__(‘Newer Entries »’, ‘kubrick’)); ?>
</div>
ここまでコメントアウト–><?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?>
</div>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<h3 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”<?php printf(__(‘Permanent Link to %s’, ‘kubrick’), the_title_attribute(‘echo=0’)); ?>”><?php the_title(); ?></h3>
<small><?php the_time(__(‘l, F jS, Y’, ‘kubrick’)) ?></small><div class=”entry”>
<?php the_content() ?>
</div><p class=”postmetadata”><?php the_tags(__(‘Tags:’, ‘kubrick’), ‘, ‘, ‘
‘); ?> <?php printf(__(‘Posted in %s’, ‘kubrick’), get_the_category_list(‘, ‘)); ?> | <?php edit_post_link(__(‘Edit’, ‘kubrick’), ”, ‘ | ‘); ?> <?php comments_popup_link(__(‘No Comments »’, ‘kubrick’), __(‘1 Comment »’, ‘kubrick’), __(‘% Comments »’, ‘kubrick’), ”, __(‘Comments Closed’, ‘kubrick’) ); ?></p></div>
<?php endwhile; ?>
<div class=”navigation”>
<!–breadcrumbとwp-pagenaviを使う為にdefaultをコメントアウト
<div class=”alignleft”><?php next_posts_link(__(‘« Older Entries’, ‘kubrick’)); ?></div>
<div class=”alignright”><?php previous_posts_link(__(‘Newer Entries »’, ‘kubrick’)); ?></div>
–><?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?>
</div>
<?php else :
if ( is_category() ) { // If this is a category archive
printf(“<h2 class=’center’>”.__(“Sorry, but there aren’t any posts in the %s category yet.”, ‘kubrick’).'</h2>’, single_cat_title(”,false));
} else if ( is_date() ) { // If this is a date archive
echo(‘<h2>’.__(“Sorry, but there aren’t any posts with this date.”, ‘kubrick’).'</h2>’);
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var(‘author_name’));
printf(“<h2 class=’center’>”.__(“Sorry, but there aren’t any posts by %s yet.”, ‘kubrick’).”</h2>”, $userdata->display_name);
} else {
echo(“<h2 class=’center’>”.__(‘No posts found.’, ‘kubrick’).'</h2>’);
}
get_search_form();
endif;
?></div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<div class="breadcrumb"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </div> <div id="content" class="narrowcolumn" role="main"> <div class="breadcrumb_top"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </div>
ここ、2回もパンクズ入ってますが
<div id="content" class="narrowcolumn" role="main"> <div class="breadcrumb_top"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </div>
の間違いじゃないですか?
それと、archive.php のことを言われてますが、そこも確かにそうなのですが、ご質問の趣旨からすろと page.php とかではなくてですか?
お使いのテーマの構成がわからないので、エスパーにならないといけないですけど・・・kz さん、kvex さん、お陰さまで解決できました。
結果、固定ページ用に page.php の content 開始タグの直下に <div class=”breadcrumb”> を配置して、それ以外のカテゴリー、月、日の時系列用に archive.php の content タグ内の上下に <div class=”breadcrumb”> を配置して上手くいきました。
この度はお世話になりました、有難うございました。また教えて下さい。失礼します。Breadcrumb NavXT 3.4.1 (Breadcrumb NavXT – Adminstration Interface)をインストールし有効化して、パンくずナビを設置し、
ホーム > Archive by category ‘カテゴリーのタイトル’
と表示してくれるのですが、Archive by category ”
を表示しないようにしたいです。
どなたか教えていただけませんか?
よろしくお願いします。終了したスレにぶら下げるよりも新規スレを立てていただけますか?
ちなみに、設定の「記事&ページ」のところで「パンクズリストに分類を表示」のチェックをはずすってことでいいのかな?
すみません。
新しく投稿しました。
- トピック「Breadcrumb NavXT 3.4.1」には新たに返信することはできません。