Thanks alchymyth i know i have to add html & CSS but i dont know where to put it and i need it to be dynamic so a different style for each different post status
heres full code
<?php
/* Template Name: View Posts */
if ( !current_user_can('publish_posts')) {
include('reject-view-posts.php');
exit(0);
}
?>
<?php get_header(); ?>
<?php
$query = new WP_Query( array(
'post_type' => 'post',
'posts_per_page' => '-1',
'post_status' => array(
'publish',
'pending',
'draft',
'private',
)
) );
?>
<div id="content">
<div id="inner-content" class="wrap clearfix">
<table id="view-posts-table">
<tr id="view-posts-table-top">
<th width="25%" >Post Title</th>
<th width="35%">Post Excerpt</th>
<th width="15%">Post Status</th>
<th width="15%">Actions</th>
</tr>
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<tr>
<td class="insert-posts-title"><?php echo get_the_title(); ?></td>
<td><?php echo substr(get_the_excerpt(), 0,170); ?></td>
<td><?php echo '<div id="posts-status">' . get_post_status( get_the_ID() )?></td>
<td><?php $edit_post = add_query_arg( 'post', get_the_ID(), get_permalink( 74 + $_POST['_wp_http_referer'] ) ); ?>
<a href="<?php echo $edit_post; ?>">Edit</a> <?php if( !(get_post_status() == 'trash') ) : ?>
<a class="confirm-dialog" href="<?php echo get_delete_post_link( get_the_ID() ); ?>">Delete</a>
<?php endif; ?></td>
</tr>
<?php endwhile; endif; ?>
</table>
</div>
</div>
<?php get_footer(); ?>
Thank you