Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Press appearances -->
- <?php
- // Count press appearances
- $post_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '" . $curauth->ID . "' AND post_type = 'pressmention' AND post_status = 'publish'");
- ?>
- <h5><?php echo '<span class="label label-primary">'.$post_count.'</span>'; ?> Media appearances:</h5>
- <table class="table table-striped table-sm">
- <tbody>
- <?php // Show custom post list - http://wordpress.stackexchange.com/questions/178739/displaying-custom-post-types-in-author-php
- $args = array(
- 'post_type' => 'pressmention' ,
- 'author' => get_queried_object_id(), // this will be the author ID on the author page
- 'showposts' => 200
- );
- $custom_posts = new WP_Query( $args );
- if ( $custom_posts->have_posts() ): while ( $custom_posts->have_posts() ) : $custom_posts->the_post();?>
- <tr>
- <!-- changed th, removed scope="row", was width="110" and "125" -->
- <td class="col-xs-2"><?php the_time('M d, Y'); ?></td>
- <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>
- <td class="col-xs-7"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></td>
- </tr>
- <?php endwhile; else: ?>
- <!-- changed th, removed scope="row" -->
- <tr><td colspan="2">No posts.</td></tr>
- <?php endif; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement