• 1.
    <?php
  • 2.
    /**
  • 3.
     * The Template for displaying all single posts
  • 4.
     *
  • 5.
     * @package DW Focus
  • 6.
     * @since DW Focus 1.2.6
  • 7.
     */
  • 8.
     
  • 9.
    get_header(); ?>
  • 10.
     
  • 11.
    <div class="container">
  • 12.
    	<div class="content-inner">
  • 13.
    		<div class="row">
  • 14.
    			<div class="<?php dw_focus_primary_column_class(); ?>">
  • 15.
    				<div id="primary" class="content-area">
  • 16.
    					<main id="main" class="site-main" role="main">
  • 17.
    					<?php while ( have_posts() ) : the_post(); ?>
  • 18.
    						<?php if ( ! get_post_format() ) : ?>
  • 19.
    						<?php get_template_part( 'content-single', 'none' ); ?>
  • 20.
    						<?php else : ?>
  • 21.
    						<?php get_template_part( 'content-single', get_post_format() ); ?>
  • 22.
    						<?php endif ?>
  • 23.
    						<?php the_post_navigation(); ?>
  • 24.
    						<div class="author-info">
  • 25.
    							<div class="author-avatar">
  • 26.
    								<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'dw_starter_author_bio_avatar_size', 72 ) ); ?>
  • 27.
    							</div>
  • 28.
    							<div class="author-detail">
  • 29.
    								<h4 class="author-title"> <?php the_author_posts_link(); ?></h4>
  • 30.
    								<p class="site-url"><a href="<?php the_author_meta('user_url');?>"><?php the_author_meta('user_url');?></a>
  • 31.
    								</p>
  • 32.
    								<p class="author-description"><?php the_author_meta('description'); ?></p>
  • 33.
    								<ul class="author-icons">
  • 34.
    									<?php 
  • 35.
    										$rss_url = get_the_author_meta( 'rss_url' );
  • 36.
    										if ( $rss_url && $rss_url != '' ) {
  • 37.
    											echo '<li class="rss"><a href="' . esc_url($rss_url) . '"><i class="fa fa-rss"></i></a></li>';
  • 38.
    										}
  • 39.
    														
  • 40.
    										$google_profile = get_the_author_meta( 'google_profile' );
  • 41.
    										if ( $google_profile && $google_profile != '' ) {
  • 42.
    											echo '<li class="google"><a href="' . esc_url($google_profile) . '" rel="author"><i class="fa fa-google"></i></a></li>';
  • 43.
    										}
  • 44.
    														
  • 45.
    										$twitter_profile = get_the_author_meta( 'twitter_profile' );
  • 46.
    										if ( $twitter_profile && $twitter_profile != '' ) {
  • 47.
    											echo '<li class="twitter"><a href="' . esc_url($twitter_profile) . '"><i class="fa fa-twitter"></i></a></li>';
  • 48.
    										}
  • 49.
    														
  • 50.
    										$facebook_profile = get_the_author_meta( 'facebook_profile' );
  • 51.
    										if ( $facebook_profile && $facebook_profile != '' ) {
  • 52.
    											echo '<li class="facebook"><a href="' . esc_url($facebook_profile) . '"><i class="fa fa-facebook"></i></a></li>';
  • 53.
    										}
  • 54.
    														
  • 55.
    										$linkedin_profile = get_the_author_meta( 'linkedin_profile' );
  • 56.
    										if ( $linkedin_profile && $linkedin_profile != '' ) {
  • 57.
    											echo '<li class="linkedin"><a href="' . esc_url($linkedin_profile) . '"><i class="fa fa-linkedin"></i></a></li>';
  • 58.
    										}
  • 59.
    									?>
  • 60.
    								</ul>
  • 61.
     
  • 62.
    							</div>
  • 63.
    						</div>
  • 64.
    						<?php $options = get_option( 'fw_theme_settings_options:default' ); ?>
  • 65.
    						<?php if( $options['enable_related_post'] && true == $options['enable_related_post'] ) : ?>
  • 66.
    						<!-- Related Posts  -->
  • 67.
    						<?php
  • 68.
    							//for use in the loop, list 5 post titles related to first tag on current post
  • 69.
    							$tags = wp_get_post_tags($post->ID);
  • 70.
    							if ($tags) {
  • 71.
    								$first_tag = $tags[0]->term_id;
  • 72.
    								$args=array(
  • 73.
    								'tag__in' => array($first_tag),
  • 74.
    								'post__not_in' => array($post->ID),
  • 75.
    								'posts_per_page'=>5,
  • 76.
    								'caller_get_posts'=>1
  • 77.
    								);
  • 78.
    								$my_query = new WP_Query($args);
  • 79.
    								if( $my_query->have_posts() ) { ?>
  • 80.
    									
  • 81.
    									<div class="related-post">
  • 82.
    										<h3><span><?php _e('Related posts','dw_focus') ?></span></h3>
  • 83.
    										<div class="row-fluid">
  • 84.
    											<div class="content-relate-inner">
  • 85.
    									<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  • 86.
    										<div class="col-md-4 related-col">
  • 87.
    											<?php get_template_part('content', 'related-post'); ?>
  • 88.
    										</div>
  • 89.
    									<?php endwhile; } wp_reset_query(); } ?>
  • 90.
    											</div>
  • 91.
    										</div>
  • 92.
    									</div>
  • 93.
    							<?php endif; ?>
  • 94.
    	
  • 95.
    						<?php
  • 96.
    						if ( comments_open() || get_comments_number() ) :
  • 97.
    							comments_template();
  • 98.
    						endif;
  • 99.
    						?>
  • 100.
    					<?php endwhile; ?>
  • 101.
    					</main>
  • 102.
    				</div>
  • 103.
    			</div>
  • 104.
    			<div class="<?php dw_focus_secondary_column_class(); ?>">
  • 105.
    				<?php get_sidebar(); ?>
  • 106.
    			</div>
  • 107.
    		</div>
  • 108.
    	</div>
  • 109.
    </div>
  • 110.
    <?php get_footer(); ?>
  • 111.
     
<?php /** * The Template for displaying all single posts * * @package DW Focus * @since DW Focus 1.2.6 */ get_header(); ?> <div class="container"> <div class="content-inner"> <div class="row"> <div class="<?php dw_focus_primary_column_class(); ?>"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php if ( ! get_post_format() ) : ?> <?php get_template_part( 'content-single', 'none' ); ?> <?php else : ?> <?php get_template_part( 'content-single', get_post_format() ); ?> <?php endif ?> <?php the_post_navigation(); ?> <div class="author-info"> <div class="author-avatar"> <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'dw_starter_author_bio_avatar_size', 72 ) ); ?> </div> <div class="author-detail"> <h4 class="author-title"> <?php the_author_posts_link(); ?></h4> <p class="site-url"><a href="<?php the_author_meta('user_url');?>"><?php the_author_meta('user_url');?></a> </p> <p class="author-description"><?php the_author_meta('description'); ?></p> <ul class="author-icons"> <?php $rss_url = get_the_author_meta( 'rss_url' ); if ( $rss_url && $rss_url != '' ) { echo '<li class="rss"><a href="' . esc_url($rss_url) . '"><i class="fa fa-rss"></i></a></li>'; } $google_profile = get_the_author_meta( 'google_profile' ); if ( $google_profile && $google_profile != '' ) { echo '<li class="google"><a href="' . esc_url($google_profile) . '" rel="author"><i class="fa fa-google"></i></a></li>'; } $twitter_profile = get_the_author_meta( 'twitter_profile' ); if ( $twitter_profile && $twitter_profile != '' ) { echo '<li class="twitter"><a href="' . esc_url($twitter_profile) . '"><i class="fa fa-twitter"></i></a></li>'; } $facebook_profile = get_the_author_meta( 'facebook_profile' ); if ( $facebook_profile && $facebook_profile != '' ) { echo '<li class="facebook"><a href="' . esc_url($facebook_profile) . '"><i class="fa fa-facebook"></i></a></li>'; } $linkedin_profile = get_the_author_meta( 'linkedin_profile' ); if ( $linkedin_profile && $linkedin_profile != '' ) { echo '<li class="linkedin"><a href="' . esc_url($linkedin_profile) . '"><i class="fa fa-linkedin"></i></a></li>'; } ?> </ul> </div> </div> <?php $options = get_option( 'fw_theme_settings_options:default' ); ?> <?php if( $options['enable_related_post'] && true == $options['enable_related_post'] ) : ?> <!-- Related Posts --> <?php //for use in the loop, list 5 post titles related to first tag on current post $tags = wp_get_post_tags($post->ID); if ($tags) { $first_tag = $tags[0]->term_id; $args=array( 'tag__in' => array($first_tag), 'post__not_in' => array($post->ID), 'posts_per_page'=>5, 'caller_get_posts'=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { ?> <div class="related-post"> <h3><span><?php _e('Related posts','dw_focus') ?></span></h3> <div class="row-fluid"> <div class="content-relate-inner"> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="col-md-4 related-col"> <?php get_template_part('content', 'related-post'); ?> </div> <?php endwhile; } wp_reset_query(); } ?> </div> </div> </div> <?php endif; ?> <?php if ( comments_open() || get_comments_number() ) : comments_template(); endif; ?> <?php endwhile; ?> </main> </div> </div> <div class="<?php dw_focus_secondary_column_class(); ?>"> <?php get_sidebar(); ?> </div> </div> </div> </div> <?php get_footer(); ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter