WordPress.org

Ready to get started?Download WordPress

Forums

Horizontal Navigation (1 post)

  1. Martin J
    Member
    Posted 4 years ago #

    Hi there, at present im working on a localhost situation with the hopes of implementing a wordpress CMS, the site has 5 static page links and 1 for the blog, from the static links there are 5 child pages to 1 level.

    I dont want to show the child pages in a dropdown, just adding them to my footer with wp_list_pages and then excluding the main pages just to show the children,

    The problem im having is that when i go to a child page from the footer i want the Navbar parent to be highlighted, which isnt happening,
    below is the code for my header and footer

    Header navbar

    <div class="mainmenu">
    <ul>
    
    				<li class="<?php if (is_page('home')) { echo "current_page_item"; } ?>"><a href="/"><span class="left"><span class="right">Home</span></span></a>
    			</li>
    				<li class="<?php if (is_page('services')) { echo "current_page_item"; } ?>"><a href="/services/"><span class="left"><span class="right">Services</span></span></a>
                            </li>
    				<li class="<?php if (is_page('portfolio')) { echo "current_page_item"; } ?>"><a href="/portfolio/"><span class="left"><span class="right">Portfolio</span></span></a>
    			</li>
    				<li class="<?php if (is_page('about-us')) { echo "current_page_item"; } ?>"><a href="/about-us/"><span class="left"><span class="right">About Us</span></span></a>
    			</li>
    				<li class="<?php if (is_page('contact-us')) { echo "current_page_item"; } ?>"><a href="/contact-us/"><span class="left"><span class="right">Contact Us</span></span></a>
    			</li>
    				<li class="<?php if (is_home()) { echo "current_page_item"; } ?>"><a href="/news/"><span class="left"><span class="right">Latest News</span></span></a>
    			</li>
            </ul>

    Footer

    <div class="footer_links">
    				<h3>Navigation</h3>
    				<ul>
    <?php wp_list_pages('exclude=3,9,18,22,14,30,32,35&title_li='); ?>
    				</ul>
    			</div>
    			<div class="footer_links">
    				<h3>Our Services</h3>
    				<ul>
    
    <?php wp_list_pages('exclude=3,4,5,7,9,18,32&title_li='); ?>
    </ul>
    			</div>
    			<div class="footer_links footer_links_end">
    				<h3>Keep in Touch</h3>
    				<ul>
    <?php wp_list_pages('exclude=3,4,5,7,14,22,30,35&title_li='); ?>
    </ul>
    			</div>
    		</div>

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.