Dashboard columns

This topic contains 5 reply and 3 voices, and was last updated by Sk 9 years, 9 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
June 30, 2014 at 6:04 am 22594
Sk I have added one extra column in the dashboard, but I need to add a few more and hopefully control the order of the columns. Not sure how to do this. Sent the same question to Premium Support a few weeks ago and still no answer. Could use the help. Thanks.
July 1, 2014 at 11:09 am 22648
Sekander Badsha Sekander Badsha

Hello Bigtom,
It would be better for us to understand if you can provide a screenshot.

July 7, 2014 at 3:34 pm 23103
bigtom bigtom

Not sure how to add a screen shot here.

The first problem is adding more than one column to the dashboard. If we can start with that it would be a great help.

Thanks.

July 7, 2014 at 7:26 pm 23129
Sekander Badsha Sekander Badsha

You can upload the screenshot anywhere and post the link here. With out seeing what you’re really trying to do, I’m unable to understand what is the issue. Hope you understand and thanks for having patience. 🙂

July 8, 2014 at 2:49 am 23154
bigtom bigtom

I want to do this for more than one column.

http://docs.wedevs.com/adding-columns-to-dashboard-table/

As your example shows a screen shot this should help you. I have added one column just fine per the documentation, but what if I need to add “Sub Title 2” as well?

Your example shows Sub Title between Status and Options, but how can I set it between Featured Image and Title?

July 8, 2014 at 4:28 pm 23190
Sk Sk

Hello bigtom,

Here is your answer.

As your example shows a screen shot this should help you. I have added one column just fine per the documentation, but what if I need to add “Sub Title 2″ as well?

You have used this code


/**
 * Add a new column header in dashboard table
 *
 * @param array $args dashboard query arguments
 * @return void
 */
function wpufe_dashboard_change_head( $args ) {
    printf( '<th>%s</th>', __( 'Sub Title', 'wpuf' ) );
}
 
add_action( 'wpuf_dashboard_head_col', 'wpufe_dashboard_change_head' );

to add one column title.

now write one more line in the function to add one more column like the following


/**
 * Add a new column header in dashboard table
 *
 * @param array $args dashboard query arguments
 * @return void
 */
function wpufe_dashboard_change_head( $args ) {
    printf( '<th>%s</th>', __( 'Sub Title', 'wpuf' ) );
    printf( '<th>%s</th>', __( 'Sub Title2', 'wpuf' ) );
}
 
add_action( 'wpuf_dashboard_head_col', 'wpufe_dashboard_change_head' );

Your example shows Sub Title between Status and Options, but how can I set it between Featured Image and Title?

please navigate to wp-user-frontend/templates/dashboard.php and cut line 29 which is

<?php do_action( 'wpuf_dashboard_head_col', $args ) ?>

then pest it after line 25 on the same page. which is

<?php
 if ( 'on' == $featured_img ) {
     echo '<th>' . __( 'Featured Image', 'wpuf' ) . '</th>';
 }
?>

That’s all you have to do.

Thank you.

Viewing 5 Posts - 1 through 5 (of 5 total)