Code troubleshooting help
-
I just recently upgraded my wordpress to 2.5.1 … and I think I have everything working except for the navigation in the header. Previously I had all of my pages there (home, about, Mongolia, prayer, photos – those were the page names) – now only home and photos show up. I am an admitted code novice – but I want to learn. Could someone help me troubleshoot the following code?
My site is https://www.remembermongolia.org
Thanks in advance!
<!– 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>-
<li<?php if (is_home()) echo ” class=\”selected\””; ?>>“>Home
- Photos
<?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.”>Archives\n”;
}
elseif($page_name == “about”) {
(is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
echo “<li”.$selected.”>About\n”;
}
elseif ($page_name == “contact”) {
(is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
echo “<li”.$selected.”>Contact\n”;
}
elseif ($page_name == “about_short”) {/*ignore*/}
else {
(is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
echo “<li”.$selected.”>$page_title\n”;
}
}
}
?></div><!– /navigation –>
- The topic ‘Code troubleshooting help’ is closed to new replies.