WordPress.org

Ready to get started?Download WordPress

Forums

Subpages in Navigation Header (2 posts)

  1. chrisliv
    Member
    Posted 7 years ago #

    Whenever I make a new subpage it shows up in the navigation header as if it were a parent page.

    I've searched all over for a solution.

    I'm using a version of Blix Krieg (no ads) that I've customized. The problem also occurs in a "fresh" version of the same theme.

    I don't know php. Please help. I don't want to scrap all my work and find a new theme to play with.

  2. chrisliv
    Member
    Posted 7 years ago #

    Code from my header.php file:

    <!-- 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('url'); ?>">Blog.</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 -->

Topic Closed

This topic has been closed to new replies.

About this Topic