WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display Posts As Ascending Order in Admin Panel (4 posts)

  1. Ian
    Member
    Posted 4 years ago #

    I want to be able to see my posts with the oldest listing first (at the bulk edit post view), since I'm using wordpress for database management not standard blogging. Is there a way to do this easily? I've searched a lot but can't seem to find it. It works fine on my public page.

  2. MichaelH
    Member
    Posted 4 years ago #

  3. Ian
    Member
    Posted 4 years ago #

    Perfect, I just changed the plugin to say date and it worked!

    <?php
    /*
    Plugin Name: Set Post Order In Admin
    Version: 0.1
    Plugin URI: http://wordpress.org/support/topic/336715/
    Description: In Posts->Edit, display posts in date order.
    Author: MichaelH
    Author URI: http://codex.wordpress.org/User:MichaelH/MyPlugins
    */
    
    function set_post_order_in_admin( $wp_query ) {
      if ( is_admin() ) {
        $wp_query->set( 'orderby', 'date' );
        $wp_query->set( 'order', 'ASC' );
      }
    }
    add_filter('pre_get_posts', 'set_post_order_in_admin' );
    ?>
  4. SantaSativa
    Member
    Posted 4 years ago #

    Thank you ianaleksander, I was looking for something like this.

Topic Closed

This topic has been closed to new replies.

About this Topic