Advertisement
Guest User

wp_pst_issue_2123

a guest
Mar 23rd, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Image List Template
  4. *
  5. * Description: Twenty Twelve loves the no-sidebar look as much as
  6. * you do. Use this page template to remove the sidebar from any page.
  7. *
  8. * Tip: to remove the sidebar from all posts and pages simply remove
  9. * any active widgets from the Main Sidebar area, and the sidebar will
  10. * disappear everywhere.
  11. *
  12. * @package WordPress
  13. * @subpackage Twenty_Twelve
  14. * @since Twenty Twelve 1.0
  15. */
  16.  
  17. get_header();
  18. ?>
  19.  
  20. <?php
  21. $or_pid = get_the_ID();
  22. if(isset($_REQUEST['p_id']) && $_REQUEST['p_id']>0){
  23. wp_delete_post($_REQUEST['p_id']);
  24.  
  25. }
  26. $user_id = get_current_user_id();
  27. $qry = 'SELECT * FROM wp_posts WHERE post_type = "post" AND post_author = '.$user_id .' AND post_status != "trash" ORDER BY post_date DESC';
  28. $res = $wpdb->get_results($qry);
  29. ?>
  30. <div class="content_main">
  31.  
  32. <div class="left_panel12">
  33. <ul>
  34. <li><a href="<?php echo get_permalink('654'); ?>">Post Add</a></li>
  35. <li><a href="<?php echo get_permalink('672'); ?>">Post List</a></li>
  36. <li><a href="<?php echo get_permalink('679'); ?>">My Post Rating</a></li>
  37. <li><a href="<?php echo get_permalink('684'); ?>">My Profile</a></li>
  38. <li><a href="<?php echo wp_logout_url( home_url()); ?>">Logout</a></li>
  39. </ul>
  40. </div>
  41.  
  42.  
  43. <div class="right_panel12">
  44. <div class="form80">
  45. <div class="div_tbl">
  46. <div class="tbl_row hding">
  47. <div class="tbl_col bold1">S. No.</div>
  48. <div class="tbl_col bold1">Title</div>
  49. <div class="tbl_col bold1">Image1</div>
  50. <div class="tbl_col bold1">Image2</div>
  51. <div class="tbl_col bold1">tags</div>
  52. <div class="tbl_col bold1">Action</div>
  53. </div>
  54. <?php $i= 1;foreach ( $res as $post ) { setup_postdata( $post );
  55. $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
  56. $image_id = get_post_meta( $post->ID, 'custom_featured_image', true );
  57. $image_attributes = wp_get_attachment_image_src($image_id);
  58. $t = wp_get_post_tags($post->ID);
  59. $au = array();
  60. foreach($t as $tag){
  61. $au[] = $tag->name;
  62. }
  63. ?>
  64. <div class="tbl_row">
  65. <div class="tbl_col"><?php echo $i; ?></div>
  66. <div class="tbl_col"><a class="tit" href="<?php the_permalink(); ?>"><?php echo $post->post_title; ?></a></div>
  67. <div class="tbl_col"><img alt="<?php echo $post->post_title; ?>" src="<?php echo $url; ?>" width="75px" /></div>
  68. <div class="tbl_col"><img alt="<?php echo $post->post_title; ?>" src="<?php echo $image_attributes[0]; ?>" width="75px" /></div>
  69. <div class="tbl_col"><?php echo implode(',',$au); ?></div>
  70. <div class="tbl_col"><a class="delt" href="<?php echo get_permalink($or_pid); ?>&p_id=<?php echo $post->ID; ?>">Delete</a></div>
  71. </div>
  72. <?php $i++;} ?>
  73. </div>
  74. </div>
  75. </div>
  76.  
  77. </div>
  78.  
  79. <?php get_footer(); ?>
  80. <style>
  81. .div_tbl{
  82. width:100%;
  83. }
  84. .div_tbl .tbl_row{
  85. height: 75px;
  86. width: 100%;
  87. float: left;
  88. }
  89. .div_tbl .tbl_row .tbl_col{
  90. width:15%;
  91. float:left;
  92. }
  93. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement