Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created April 9, 2012 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/2347333 to your computer and use it in GitHub Desktop.
Save billerickson/2347333 to your computer and use it in GitHub Desktop.
<?php
/**
Template Name: Author Page
*/
get_header(); ?>
<div id="container">
<div id="content" class="page">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_front_page() ) { ?>
<?php } else { ?>
<?php } ?>
<div class="entry-content page-content">
<?php
if( get_the_ID() == 82 )
{
$content = get_the_content();
$content = str_replace( '{RECENT_POST_LIST}', '<h2>Recent News and Articles</h2><ul>' . wp_get_archives( array( 'type' => 'postbypost', 'limit' => 3, 'echo' => 0 ) ) . '</ul>', $content );
echo $content;
}
else
{
the_content();
}
?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
<?php //edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<?php endwhile; endif; ?>
<?php
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'advisor_blog',
'author' => 5,
'posts_per_page' => 25,
'paged' => $paged
);
$wp_query = new WP_Query($args);
if ( $wp_query->have_posts() ) : ?>
<div id="author_posts">
<h3>Recent Posts</h3>
<ul>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
<div class="navigation">
<div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
<div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
</div>
<?php wp_reset_query(); ?>
</div><!-- #content -->
</div><!-- #container -->
<?php if( get_the_ID() == 4 || get_the_ID() == 505 ) { get_sidebar( 'secondary' ); } ?>
<?php if( get_the_ID() == 505 ) { echo '<style type="text/css"> #text-6{ display:none; }</style>'; } ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment