Viewing 6 replies - 1 through 6 (of 6 total)
  • It’s pretty easy.

    For the main menu, use:

    <ul id="nav">
    	<?php wp_list_pages('title_li=&depth=1&sort_column=menu_order'); ?>
    </ul>

    Then for the submenus, use:

    <?php
    	global $post;     // if outside the loop
    	if(is_page()):
    		$children = wp_list_pages('echo=0&title_li=&sort_column=menu_order&child_of='.$post->ID);
    		if(!$children && $post->post_parent)
    		$children = wp_list_pages('echo=0&title_li=&sort_column=menu_order&child_of='.$post->post_parent);
    
    		if($children) {
    		    echo ('<ul id="submenu">');
    		    echo $children;
    		    echo ('</ul><br />');
    		    }
    	endif;
    ?>

    You can then use CSS to style the menus as you want.

    Thread Starter b-cobra

    (@b-cobra)

    hi stiand
    thanx for your reply
    could you please tell me where i have to put that

    Look for wp_list_pages in your theme files. If you provide a link it would be easier.

    Thread Starter b-cobra

    (@b-cobra)

    this is my example: http://www.grafpedia.com/
    +
    i think that its wp_list_categoryes; because i want to put the categories in the header
    thank you

    Thread Starter b-cobra

    (@b-cobra)

    please, i need it

    Try using my example, and exchange wp_list_pages for wp_list_categories. Haven’t tried it, but they use the same arguments, so it should work in theory.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Pleas, help me’ is closed to new replies.