Forums

Moving Pages to my headermenu. (5 posts)

  1. Anonymous
    Unregistered
    Posted 1 year ago #

    Hi guys!
    So I`m tweaking the default theme with my own design.
    If you take a look here: http://www.stigr-lighting.com

    I want to move my pages menu, to the header menu as you can see is already there. what code do I have to edit to make it list horizontal and not downwards?

    and where do I find wp_list_pages ?

  2. Evita
    Member
    Posted 1 year ago #

    list_pages has normally the class "page_item".
    .page_item {display:inline} (in your stylesheet) should do the trick.

    But look at the code of your header-nav, there are some mistakes. A list looks like:

    <ul>
    <li></li>
    <li></li>
    <li></li>
    </ul>

    Also take a look at the codex for using and styling the template tag "wp_list_pages".

  3. Anonymous
    Unregistered
    Posted 1 year ago #

    Hello! It did not work... some other tips I could try?

    hehe, yeah i know about the list error but it works ;) Gonne remove the list tags

  4. Anonymous
    Unregistered
    Posted 1 year ago #

    bump

  5. Evita
    Member
    Posted 1 year ago #

    It can't work, your code is shitty!
    Your code:

    <div id="header">
    	<div id="menu">
    	<!--<li class="pagenav"><h2>Pages</h2><ul><li class="page_item page-item-2"><a href="http://stigr-lighting.com/?page_id=2" title="About">About</a></li>
    </ul></li>-->
    		<li>
    		<ul><a href="http://stigr-lighting.com/wp-content/themes/default/about.php">About</a></ul>
    		<ul><a href="http://stigr-lighting.com/wp-content/themes/default/about.php">Gallery</a></ul>
    
    		<ul><a href="../../cv.php">CV</a></ul>
    		<ul><a href="../../links.php">Links</a></ul>
    		</li>
    	</div>
    </div>

    should look like:

    <div id="header">
    <div id="menu">
    <li class="page_item page-item-2>Page1</li>
    <li class="page_item page-item-2>Page2</li>
    <li class="page_item page-item-2>Page3</li>
    .
    .
    .
    </div>
    </div>
    <hr />

    So clean your HTML to something like this:

    in your header.php:
    <div id="header">
    <div id="menu">
    <?php wp_list_pages('title_li='); ?>
    </div>
    </div>
    <hr />

    and in your style.css:
    #menu li .page_item {display:inline;}

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.