WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a theme where I would like users to be able to select pages to show in the theme options page much like Thesis.

I've been Googling / reverse engineering Thesis for a couple hours but haven't found a great solution. I am wondering if anyone has done this or has seen a tutorial.

alt text

share|improve this question

This is how I do it in a custom theme:

<h3>Select pages to include in menu:</h3>

$page_ids = get_all_page_ids();
$current_selected = get_option("pages_to_include");

foreach( $page_ids as $page_id ) {
    if( get_post_status( $page_id ) == 'publish' ) {
        $checked = ( !empty( $current_selected ) && in_array( $page_id, $current_selected ) ) ? ' checked="checked"' : '';
        echo '<input type="checkbox" name="page_to_include[]" id="page-' . $page_id . '" value="' . $page_id . '"' . $checked . ' /> <label for="page-' . $page_id . '">' . get_the_title( $page_id ) . '</label><br />';

You store the pages list in an option (here is "pages_to_include").

share|improve this answer
Excellent I'll give it a shot! – abrudtkuhl Oct 3 '10 at 17:35
You are welcome! – sorich87 Oct 3 '10 at 18:44

Since WordPress 3.0 there has been a custom menu feature, does that fit your needs? Or something in it that doesn't fit your needs? See Appearance Menus SubPanel in the WordPress codex

share|improve this answer
I need this functionality in an admin options page so the user can select pages to include in a slider – abrudtkuhl Oct 5 '10 at 13:18
Doesn't custom menus do this, minus the fact that it will always be under Appearance > Menus (to be honest I have not used them yet)? I'd assume it's better to not reinvent the wheel if not needed as users should be looking there for customizing a menu (if your target is WordPress 3.0 or newer). – mtekk Oct 6 '10 at 0:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.