WordPress.org

Ready to get started?Download WordPress

Ideas

Order by date

  1. moab69
    Member

    Order by date the page in the dashboar.
    Thank you

    Alessandro

    Posted: 4 years ago #
  2. bertozxx
    Member

    Hi, open file edit-pages.php in wp-admin.
    Search

    <select name="action">
    <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
    <option value="edit"><?php _e('Edit'); ?></option>
    <option value="delete"><?php _e('Delete'); ?></option>
    </select>

    <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />

    <?php wp_nonce_field('bulk-pages'); ?>

    and after paste this:
       

    <select name="orderby">
    <option value="name"><?php _e('Ordina Per Nome'); ?></option>
    <option value="data"><?php _e('Ordina Per Data'); ?></option>
    </select>

    <select name="metod">
    <option value="asc"><?php _e('ASC'); ?></option>
    <option value="desc"><?php _e('DESC'); ?></option>
    </select>

    <input type="submit" value="<?php esc_attr_e('Ordina'); ?>" name="order" id="order" class="button-secondary action" />
    <?php wp_nonce_field('bulk-pages'); ?>

    <?php

    $order = ( $_GET['orderby'] );
    $met = ( $_GET['metod'] );

    if ($order == 'name') {

    $query = array('post_type' => 'page', 'orderby' => 'menu_order title',
    'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => $met);

    $post_status_label = __('Pages');

    if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
    $post_status_label = $post_stati[$_GET['post_status']][1];
    $query['post_status'] = $_GET['post_status'];
    $query['perm'] = 'readable';
    }

    $query = apply_filters('manage_pages_query', $query);
    wp($query);

    }

    else if ($order == 'data') {

    $query = array('post_type' => 'page', 'orderby' => 'menu_order date',
    'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => $met);

    $post_status_label = __('Pages');
    if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
    $post_status_label = $post_stati[$_GET['post_status']][1];
    $query['post_status'] = $_GET['post_status'];
    $query['perm'] = 'readable';
    }

    $query = apply_filters('manage_pages_query', $query);
    wp($query);

    }

    ?>

    Posted: 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    1 Vote
  • Status

    This is plugin territory