WordPress Pages Custom List

Are you a WordPress theme developer? if so, you probably need to add automatic listing of the WordPress pages to themes allot. wp_list_pages() works fine if the design’s navigation uses a list. If not, you usually have to add a list there, and tweak the css to ignore the list.

Not anymore. I wrote a simple function that you can include in your themes that lets you customize the navigation output, fully customizing what goes before, after and between the pages.

All you need to do is copy the contents of w3l_tl_pages.php to the functions.php file of your WordPress theme, thencall the w3l_tl_pages() function in the place you want the site navigation to appear. The parameters are w3l_tl_pages('before', 'after', 'between')

The function will call only the top level pages, and order them by the menu order (which can be set for each page in the wp admin)

Click Here to download.


4 Responses to “WordPress Pages Custom List”

  1. This is a great function. Unfortunately the mysql part that gets the pages doesn’t work in Wordpress 2.0.5, so I had to customize it a bit.

    Here is the query-variable that I’m using, if someone should get the same problem:

    $query = “SELECT *, post_title FROM $wpdb->posts WHERE post_status = ’static’ AND post_parent = 0 ORDER BY post_title asc”;

  2. David says:

    This plugin is great I must instaled his. Thank’s

  3. Hans Zandstra says:

    Thank you very much for this plugin!

    After installing i still have a problem with “main_photo”.

    Is there an updated version of wppa.php available?

Leave a Reply

bottom