WordPress.org

Forums

filter pages by Page Template, in wp-admin (1 post)

  1. alex chousmith
    Member
    Posted 3 years ago #

    I am looking for the best way, in the wp-admin area, to filter the Pages list ( wp-admin/edit.php?post_type=page ) to only show pages of a particular custom Page Template.

    Currently, I found that I could add a filter to "the_post" and do something like

    $template = get_post_meta($post->ID,'_wp_page_template',true);
    if ( $template != 'mypagetemplate.php' ) {
        $post->post_status = 'notmytemplate';
    }

    to hide the Pages that are not using that "mypagetemplate.php" page template. But the wp admin menu still highlights All Pages, so I don't think this is ideal.

    anyone have any advice?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by alex chousmith
  • This topic is not resolved
  • WordPress version: 3.2.1