File: /home/dtptviut/domains/morsunivers.dk/private_html/wp-content/themes/mts_dropshipping/single.php
<?php
/**
* The template for displaying all single posts.
*
* @package Dropshipping
*/
$mts_options = get_option( MTS_THEME_NAME );
get_header(); ?>
<div class="blog-background page-title">
<div class="container">
<div class="title"><?php esc_html_e( 'Blog', 'dropshipping' ); ?></div>
<?php
if ( '1' == $mts_options['mts_breadcrumb'] ) {
mts_the_breadcrumb();
}
?>
</div>
</div>
<div id="page" class="<?php mts_single_page_class(); ?>">
<article class="<?php mts_article_class(); ?>">
<div id="content_box" >
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'g post' ); ?>>
<?php
// Single post parts ordering.
if ( isset( $mts_options['mts_single_post_layout'] ) && is_array( $mts_options['mts_single_post_layout'] ) && array_key_exists( 'enabled', $mts_options['mts_single_post_layout'] ) ) {
$single_post_parts = $mts_options['mts_single_post_layout']['enabled'];
} else {
$single_post_parts = array( 'content' => 'content', 'author' => 'author', 'social-share' => 'social-share', 'previous-next' => 'previous-next', 'related' => 'related' );
}
foreach ( $single_post_parts as $part => $label ) {
switch ( $part ) {
case 'content':
?>
<div class="single_post">
<?php
$header_animation = mts_get_post_header_effect();
if ( 'parallax' !== $header_animation && 'zoomout' !== $header_animation ) {
?>
<header>
<?php get_post_category_meta(); ?>
<h1 class="title single-title entry-title"><?php the_title(); ?></h1>
</header><!--.headline_area-->
<?php get_blog_post_meta(); ?>
<?php
}
if ( 'parallax' === $header_animation ) {
if ( mts_get_thumbnail_url() ) :
?>
<div id="parallax" <?php echo 'style="background-image: url(' . mts_get_thumbnail_url() . ');"'; ?>>
<?php get_post_date_meta(); ?>
</div>
<header>
<?php get_post_category_meta(); ?>
<h1 class="title single-title entry-title"><?php the_title(); ?></h1>
</header><!--.headline_area-->
<?php get_blog_post_meta(); ?>
<?php
endif;
} elseif ( 'zoomout' === $header_animation ) {
if ( mts_get_thumbnail_url() ) :
?>
<div id="zoom-out-effect">
<div id="zoom-out-bg" <?php echo 'style="background-image: url(' . mts_get_thumbnail_url().');"'; ?>>
<?php get_post_date_meta(); ?>
</div>
</div>
<header>
<?php get_post_category_meta(); ?>
<h1 class="title single-title entry-title"><?php the_title(); ?></h1>
</header><!--.headline_area-->
<?php get_blog_post_meta(); ?>
<?php endif;
} else if ( has_post_thumbnail() && $mts_options['mts_single_featured_image'] == 1 ) :
?>
<div class="featured-thumbnail">
<?php
$attr = [
'title' => esc_attr( get_the_title() ),
'alt' => esc_attr( get_the_title() ),
];
the_post_thumbnail( 'dropshipping-featuredfull', $attr );
get_post_date_meta();
?>
</div>
<?php endif; ?>
<div class="post-single-content box mark-links entry-content">
<?php // Top Ad Code ?>
<?php
if ( $mts_options['mts_posttop_adcode'] != '' ) {
$toptime = $mts_options['mts_posttop_adcode_time'];
if ( strcmp( date("Y-m-d", strtotime( "-$toptime day")), get_the_time("Y-m-d") ) >= 0 ) {
?>
<div class="topad">
<?php echo do_shortcode($mts_options['mts_posttop_adcode']); ?>
</div>
<?php
}
}
?>
<?php // Top Social Share ?>
<?php // Content ?>
<div class="thecontent">
<?php the_content(); ?>
</div>
<?php // Single Pagination ?>
<?php wp_link_pages(array('before' => '<div class="pagination">', 'after' => '</div>', 'link_before' => '<span class="current"><span class="currenttext">', 'link_after' => '</span></span>', 'next_or_number' => 'next_and_number', 'nextpagelink' => __('Next', 'dropshipping' ), 'previouspagelink' => __('Previous', 'dropshipping' ), 'pagelink' => '%','echo' => 1 )); ?>
<!-- Bottom Ad Code -->
<?php
if ( $mts_options['mts_postend_adcode'] != '' ) {
$endtime = $mts_options['mts_postend_adcode_time'];
if ( strcmp( date("Y-m-d", strtotime( "-$endtime day")), get_the_time("Y-m-d") ) >= 0 ) {
?>
<div class="bottomad">
<?php echo do_shortcode($mts_options['mts_postend_adcode']); ?>
</div>
<?php
}
}
?>
<?php // Bottom Social Share ?>
</div><!--.post-single-content-->
</div><!--.single_post-->
<?php
break;
case 'author':
?>
<div class="postauthor">
<div class="author-avatar">
<?php
if ( function_exists( 'get_avatar' ) ) {
echo get_avatar( get_the_author_meta('email'), '74' );
}
?>
</div>
<div class="author-description">
<h4><?php printf( esc_html__( 'About %s', 'dropshipping' ), get_the_author() ); ?></h4>
<div class="author-bio">
<p><?php the_author_meta( 'description' ) ?></p>
<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( esc_html__( 'View all posts by %s', 'dropshipping' ), get_the_author() ); ?>
</a>
</div>
</div>
</div>
<?php
break;
case 'social-share':
?>
<div class="social-share">
<?php
if ( ! empty( $mts_options['mts_tags'] ) ) {
mts_the_tags( '<div class="tags"></span>', '' );
}
?>
<?php mts_social_buttons(); ?>
</div>
<?php
break;
case 'previous-next':
$next_post = get_next_post();
$previous_post = get_previous_post();
if ( $next_post || $previous_post ) : ?>
<div class="single-prev-next">
<?php if( $previous_post ) {
?>
<div class="previous-post">
<a class="previous-full-post" href="<?php echo esc_url( get_permalink($previous_post->ID) ); ?>" title="<?php echo $previous_post->post_title; ?>" <?php if(empty($next_post)) ?>>
<header>
<div class="prev"><?php esc_html_e( 'Newer', 'dropshipping' ); ?></div>
<h3 class="title front-view-title"><?php echo $previous_post->post_title; ?></h3>
</header>
<div class="prev-icon"><i class="fa fa-angle-left"></i></div>
</a>
</div>
<?php } ?>
<div class="back-to-archive"><?php echo '<a href="' . esc_url( trailingslashit( home_url() ) ) . 'blog"><i class="fa fa-th-large"></i></a>'; ?></div>
<?php if($next_post) { ?>
<div class="next-post">
<a class="next-full-post" href="<?php echo esc_url( get_permalink($next_post->ID) ); ?>" title="<?php echo $next_post->post_title; ?>">
<header>
<div class="next"><?php _e('Older', 'dropshipping'); ?></div>
<h3 class="title front-view-title"><?php echo $next_post->post_title; ?></h3>
</header>
<div class="next-icon"><i class="fa fa-angle-right"></i></div>
</a>
</div>
<?php } ?>
</div>
<?php endif;
break;
case 'related':
mts_related_posts();
break;
}
}
?>
</div><!--.g post-->
<?php comments_template( '', true ); ?>
<?php endwhile; /* end loop */ ?>
</div>
</article>
<?php get_sidebar(); ?>
<?php get_footer(); ?>