Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <!-- Press appearances -->
  2. <?php
  3. // Count press appearances
  4. $post_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '" . $curauth->ID . "' AND post_type = 'pressmention' AND post_status = 'publish'");
  5. ?>
  6. <h5><?php echo '<span class="label label-primary">'.$post_count.'</span>'; ?> Media appearances:</h5>
  7. <table class="table table-striped table-sm">
  8. <tbody>
  9. <?php // Show custom post list - http://wordpress.stackexchange.com/questions/178739/displaying-custom-post-types-in-author-php
  10. $args = array(
  11. 'post_type' => 'pressmention' ,
  12. 'author' => get_queried_object_id(), // this will be the author ID on the author page
  13. 'showposts' => 200
  14. );
  15. $custom_posts = new WP_Query( $args );
  16.  
  17.  
  18.  
  19. if ( $custom_posts->have_posts() ): while ( $custom_posts->have_posts() ) : $custom_posts->the_post();?>
  20. <tr>
  21. <!-- changed th, removed scope="row", was width="110" and "125" -->
  22. <td class="col-xs-2"><?php the_time('M d, Y'); ?></td>
  23. <td class="col-xs-3"><img src="https://plus.google.com/_/favicon?domain=<?php echo get_post_meta( $post->ID,'press_mention_information_publication-url',true); ?>" alt="Publication"> <?php echo get_post_meta( $post->ID,'press_mention_information_publication-name',true); ?></td>
  24. <td class="col-xs-7"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></td>
  25. </tr>
  26. <?php endwhile; else: ?>
  27. <!-- changed th, removed scope="row" -->
  28. <tr><td colspan="2">No posts.</td></tr>
  29. <?php endif; ?>
  30. </tbody>
  31. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement