0

I developed my site with a fine WP developer (if anyone's interested, lemme know), but he is out of town and I am still resolving one thing. I have a border image under the navigation tabs which is conditional for the navigation based on page. He's advising me to add the following:

At the top of the template file type '"echo $pagename;"' This should then output the name of the page as WP sees it.

Here's the home page with no borders under the tabs Blog, Humor, Consulting

http://www.leesachs.com

Click on Humor or Consulting and you'll see the border I'm trying to get

There is a border under those tabs that SHOULD be under 'Blog' but it is not appearing

Here's the conditional statements for all 3 (assume all the paths and images are in place) We also tried changing replacing (is_home()) with ($pagename == "blog") but that didn't work

if (is_home()){
echo ('<img src="' . get_stylesheet_directory_uri() . '/img/blog_bar.jpg" alt="blog page     border" />');
}elseif ($pagename == "humor"){
echo ('<img src="' . get_stylesheet_directory_uri() . '/img/humor_bar.jpg" alt="humor page     border" />');
}elseif ($pagename == "consulting"){
echo ('<img src="' . get_stylesheet_directory_uri() . '/img/consulting_bar.jpg"     alt="consulting page border" />');
4

1 に答える 1

0

ブログ ページに移動しても、img html は表示されません。ブログページはホームページではないと思うので、それをホームページにするか、あなたが言及した他の条件 ($pagename == "blog") を入れることができます。

* [編集] * http://leesachs.com/http://leesachs.com/blog/に移動した場合、ブログ ページはホームページではありません。どちらも別のページです。これに答えるのは、Wordpress のバックエンドを見ずに行うのは困難です。

于 2013-03-08T07:11:28.823 に答える