It likely will be in header.php
of your theme folder.
However, check your
admin -> Manage -> Pages
and see what’s listed. You may just need to rebuild your “Pages” links.
Hey…the problem is definitely in the header.php file in my theme folder, but I am no php expert so can’t understand why this code isn’t working.
The way that I confirmed it was the header.php file, was that I changed the text “Home” to “Homey” as a test, and of course when I refreshed the blog the text changed accordingly.
I have attached the navigation code…does anyone have any ideas why my blog is not picking up the static Pages I have created in WordPress and adding them to my navigation bar? I have also tried creating new Pages but to no avail..
Here’s the code.
<!-- navigation ................................. -->
<div id="navigation">
<!-- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<fieldset>
<input value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
<input type="submit" value="Go!" id="searchbutton" name="searchbutton" />
</fieldset>
</form> -->
<ul>
<li<?php if (is_home()) echo " class='selected'"; ?>><a href="<?php bloginfo('home'); ?>">Home</a></li>
<?php
$pages = BX_get_pages();
if ($pages) {
foreach ($pages as $page) {
$page_id = $page->ID;
$page_title = $page->post_title;
$page_name = $page->post_name;
if ($page_name == "archives") {
(is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ' class="selected"':$selected='';
echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">Archives</a></li>\n";
}
elseif($page_name == "about") {
(is_page($page_id))?$selected = ' class="selected"':$selected='';
echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">About</a></li>\n";
}
elseif ($page_name == "contact") {
(is_page($page_id))?$selected = ' class="selected"':$selected='';
echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">Contact</a></li>\n";
}
elseif ($page_name == "about_short") {/*ignore*/}
else {
(is_page($page_id))?$selected = ' class="selected"':$selected='';
echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">$page_title</a></li>\n";
}
}
}
?>
</ul>
</div><!-- /navigation -->
Hey again,
I ended up hardcoding the navigation menu using straight HTML in the header.php file. Not ideal, but I don’t plan on changing the pages any time soon so no big deal I guess.
I still would like to know if anyone can see any bugs in the php code (refer to last post) which is causing my navigation menu to appear pretty much empty.