Kreativ Font - Kreativ Sound - Kreativ Theme

Codex: wp_page_menu()

This is one of the most used functions in WordPress because it displays a list of WordPress Pages as links, and affords the opportunity to have Home added automatically to the list of Pages displayed. This Tag is useful to customize the Sidebar or Header, but may be used in other Templates as well

Codex get_userdata()

Usage

<?php wp_page_menu( $args ); ?>

Parameters
sort_column
(string) Sorts the list of Pages in a alphabetic order by title of the pages.
‘post_title’ – Sort Pages alphabetically by title.
‘post_date’ – Sort by creation time.

menu_class
(string) The div class the list is displayed in. Defaults to menu.

include
(string) Only list pages identified with the corresponding id’s, i.e.
wp_page_menu(‘include=2,14′) will list only pages with id’s 2 and 14

exclude
(string) Define a comma-separated list of Page IDs to be excluded from
the list (example: ‘exclude=3,7,31′).

exclude_tree
(string) Define a comma-separated list of parent Page IDs to be excluded.
Use this parameter to exclude a parent and all of that parent’s child Pages.

echo
(boolean) Toggles the display of the generated list of links or return
the list as an HTML text string to be used in PHP.

show_home
(boolean) Add “Home” as the first item in the list of “Pages”.

link_before
(string) Sets the text or html that precedes the link text inside < a > tag.

link_after
(string) Sets the text or html that follows the link text inside < a > tag.

Returned values
(string) The Menu’s HTML, if the ‘echo’ parameter is set to false.

Examples
Display Home as a Page
The following example causes “Home” to be added to the beginning of the list of Pages displayed. In addition, the Pages wrapped in a div element, Page IDs 5, 9, and 23, are excluded from the list of Pages displayed, and the pages are listed in Page Order. The list is prefaced with the title, “Page Menu”:

<h2>Page Menu</h2>
<?php
wp_page_menu('show_home=1&exclude=5,9,23'
            .'&menu_class=page-navi&sort_column=menu_order'); 
?>

More info: http://codex.wordpress.org/Function_Reference/wp_page_menu

Leave a comment

or Subscribe to this comment feed via RSS