• scottdaris

    (@scottdaris)


    Before I ask my question, I just want to say I have a clean installation of WP with the default themes and with no added plugins.

    That said, how do you add more Screen Options (top dropdown) so that more columns appear in certain areas, namely in this case the main “Posts” page? Right now only the following appear as columns: Author, Categories, Tags, Comments, Date. I would like to add the column “Image” so that a thumbnail of the post appears. The Featured Image is set for all my posts – that part is fine – but I need the thumbnail to appear when viewing the whole list of Posts. I don’t see an area in the admin where you can add more Screen Options. Concise, simple answers would be greatly appreciated. Thank You.

Viewing 6 replies - 1 through 6 (of 6 total)
  • J M

    (@hiphopinenglish)

    Adding this to your functions.php should work:

    add_filter('manage_posts_columns', 'posts_columns', 5);
    add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
    function posts_columns($defaults){
        $defaults['riv_post_thumbs'] = __('Thumbs');
        return $defaults;
    }
    function posts_custom_columns($column_name, $id){
            if($column_name === 'riv_post_thumbs'){
            echo the_post_thumbnail( 'featured-thumbnail' );
        }
    }

    Note the action (manage_posts_custom_column) and the filter ( manage_posts_columns) are what you can hook into. A more in-depth version of this functionality can be found here (if you want to limit to certain post types for example).

    Thread Starter scottdaris

    (@scottdaris)

    Thanks, HHIE. I actually found this snippet right before you posted it. Yes, it does the job, but now I can’t figure out how to change the order of the columns, as well as the screen option order. I know how to change the admin bar menu items order but this one I can’t find an answer to.

    J M

    (@hiphopinenglish)

    Do you mean the default order of posts on the All Posts screen?

    Thread Starter scottdaris

    (@scottdaris)

    No, that part I know. I mean the way the columns are ordered. I want something like:

    Thumbs | Date | Categories | Tags | Comments

    J M

    (@hiphopinenglish)

    I see. I guess the best way to do it is on registering your custom one, insert it into the array of columns where you want it. To rearrange all of the columns incl. the defaults, see this answer on WPSE.

    Thread Starter scottdaris

    (@scottdaris)

    Yup, that’s it. Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add Screen Options’ is closed to new replies.