1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php  // show related posts of current post by tags
					$backup = $post;  // backup the current object
					$tags = wp_get_post_tags($post->ID);
					$tagIDs = array();
					
					if ($tags) :
						$tagcount = count($tags);
					
						for ($i = 0; $i < $tagcount; $i++) {
							$tagIDs[$i] = $tags[$i]->term_id;
						}
						
						$args = array(
							'tag__in' => $tagIDs,
							'post__not_in' => array($post->ID),
							'showposts' => 3,
							'caller_get_posts'=>1
						);
						
						$my_query = new WP_Query($args);
						if( $my_query->have_posts() ) : ?>
                        	<h3><?php _e( 'Related Posts', 'unisphere' ); ?></h3>
                            <div class="related-posts clearfix">
                            	<ul class="portfolio-4-columns-list clearfix">
									<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
										<li class="portfolio-item">
											<a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php echo unisphere_get_post_image("portfolio4"); ?></a>
											<div class="portfolio-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
										</li>
									<?php endwhile; ?>
								</ul>
							</div>
							<div class="hr2"><hr /></div>
							
							<style>
								.portfolio-4-columns-list li { margin-bottom: 0; }
							</style>
					
						<?php endif; ?>
					<?php endif; 

					$post = $backup;  // copy it back
					wp_reset_query(); // to use the original query again
?>

<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries  ?>
					<h3 id="author-title"><?php printf( esc_attr__( 'About %s', 'unisphere' ), get_the_author() ); ?></h3>
					<div id="author-info" class="rounded-all">	
						<div id="author-avatar">
							<?php echo get_avatar( get_the_author_meta( 'user_email' ), 60 ); ?>
						</div>
						<div id="author-description">
							<?php the_author_meta( 'description' ); ?>
                            <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
								<?php printf( __( 'View all posts by %s', 'unisphere' ), get_the_author() ); ?>
							</a>
						</div>

					</div>

                    <div class="clearfix"></div>

					<div class="hr2"><hr /></div>
					
					<style>
						#author-avatar { position: relative; }
						#author-description { margin-left: 80px; }
					</style>
<?php endif; ?>

				<?php comments_template( '', true ); ?>