mirror of
https://ghproxy.net/https://github.com/AlxMedia/splits.git
synced 2025-08-26 06:20:51 +08:00
Initial commit
This commit is contained in:
commit
9f13aa6240
389 changed files with 84369 additions and 0 deletions
31
inc/featured.php
Normal file
31
inc/featured.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
// Query featured entries
|
||||
$featured = new WP_Query(
|
||||
array(
|
||||
'no_found_rows' => false,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'ignore_sticky_posts' => 1,
|
||||
'posts_per_page' => absint( get_theme_mod('featured-posts-count','3') ),
|
||||
'cat' => absint( get_theme_mod('featured-category','') )
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<?php if ( ( get_theme_mod('featured-posts-count','3') !='0') && $featured->have_posts() ): ?>
|
||||
|
||||
<div id="split-left-top" class="page-title alt group pad">
|
||||
<h2><?php esc_html_e('Featured Today.','split'); ?></h2>
|
||||
<?php if ( get_theme_mod( 'header-social', 'on' ) == 'on' ): ?>
|
||||
<?php split_social_links() ; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php while ( $featured->have_posts() ): $featured->the_post(); ?>
|
||||
<?php get_template_part('content-featured'); ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
17
inc/front-widgets-bottom.php
Normal file
17
inc/front-widgets-bottom.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php if ( is_home() && !is_paged() && get_theme_mod('frontpage-widgets-bottom') == 'on' ): ?>
|
||||
<div class="front-widgets group">
|
||||
|
||||
<div class="front-widget-col">
|
||||
<div class="front-widget-inner">
|
||||
<?php dynamic_sidebar( 'frontpage-bottom-1' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="front-widget-col">
|
||||
<div class="front-widget-inner">
|
||||
<?php dynamic_sidebar( 'frontpage-bottom-2' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!--/.front-widgets-->
|
||||
<?php endif; ?>
|
17
inc/front-widgets-top.php
Normal file
17
inc/front-widgets-top.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php if ( is_home() && !is_paged() && get_theme_mod('frontpage-widgets-top') == 'on' ): ?>
|
||||
<div class="front-widgets group">
|
||||
|
||||
<div class="front-widget-col">
|
||||
<div class="front-widget-inner">
|
||||
<?php dynamic_sidebar( 'frontpage-top-1' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="front-widget-col">
|
||||
<div class="front-widget-inner">
|
||||
<?php dynamic_sidebar( 'frontpage-top-2' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!--/.front-widgets-->
|
||||
<?php endif; ?>
|
25
inc/highlight.php
Normal file
25
inc/highlight.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
// Query highlight entries
|
||||
$highlight = new WP_Query(
|
||||
array(
|
||||
'no_found_rows' => false,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'ignore_sticky_posts' => 1,
|
||||
'posts_per_page' => get_theme_mod('highlight-posts-count','7'),
|
||||
'cat' => get_theme_mod('highlight-category','')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<?php if ( ( get_theme_mod('highlight-posts-count','') !='0') ): ?>
|
||||
<div class="clear"></div>
|
||||
<div id="owl-featured" class="owl-carousel owl-theme">
|
||||
<?php while ( $highlight->have_posts() ): $highlight->the_post(); ?>
|
||||
<?php get_template_part('content-highlight'); ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
52
inc/page-title.php
Normal file
52
inc/page-title.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<div class="page-title">
|
||||
|
||||
<?php if ( is_home() ) : ?>
|
||||
<h2><?php echo split_blog_title(); ?></h2>
|
||||
|
||||
<?php elseif ( is_single() ): ?>
|
||||
<h2><?php the_category(' <span>/</span> '); ?></h2>
|
||||
|
||||
<?php elseif ( is_page() ): ?>
|
||||
<h2><?php the_title(); ?></h2>
|
||||
|
||||
<?php elseif ( is_search() ): ?>
|
||||
<h1>
|
||||
<?php if ( have_posts() ): ?><i class="fas fa-search"></i><?php endif; ?>
|
||||
<?php if ( !have_posts() ): ?><i class="fas fa-exclamation-circle"></i><?php endif; ?>
|
||||
<?php $search_results=$wp_query->found_posts;
|
||||
if ($search_results==1) {
|
||||
echo $search_results.' '.esc_html__('Search result','split');
|
||||
} else {
|
||||
echo $search_results.' '.esc_html__('Search results','split');
|
||||
}
|
||||
?>
|
||||
</h1>
|
||||
|
||||
<?php elseif ( is_404() ): ?>
|
||||
<h1><i class="fas fa-exclamation-circle"></i><?php esc_html_e('Error 404.','split'); ?> <span><?php esc_html_e('Page not found!','split'); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_author() ): ?>
|
||||
<?php $author = get_userdata( get_query_var('author') );?>
|
||||
<h1><i class="far fa-user"></i><?php esc_html_e('Author:','split'); ?> <span><?php echo $author->display_name;?></span></h1>
|
||||
|
||||
<?php elseif ( is_category() ): ?>
|
||||
<h1><?php echo single_cat_title('', false); ?></h1>
|
||||
|
||||
<?php elseif ( is_tag() ): ?>
|
||||
<h1><i class="fas fa-tags"></i><?php esc_html_e('Tagged:','split'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_day() ): ?>
|
||||
<h1><i class="far fa-calendar"></i><?php esc_html_e('Daily Archive:','split'); ?> <span><?php echo esc_html( get_the_time('F j, Y') ); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_month() ): ?>
|
||||
<h1><i class="far fa-calendar"></i><?php esc_html_e('Monthly Archive:','split'); ?> <span><?php echo esc_html( get_the_time('F Y') ); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_year() ): ?>
|
||||
<h1><i class="far fa-calendar"></i><?php esc_html_e('Yearly Archive:','split'); ?> <span><?php echo esc_html( get_the_time('Y') ); ?></span></h1>
|
||||
|
||||
<?php else: ?>
|
||||
<h2><?php the_title(); ?></h2>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!--/.page-title-->
|
10
inc/pagination.php
Normal file
10
inc/pagination.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<nav class="pagination group">
|
||||
<?php if ( function_exists('wp_pagenavi') ): ?>
|
||||
<?php wp_pagenavi(); ?>
|
||||
<?php else: ?>
|
||||
<ul class="group">
|
||||
<li class="prev left"><?php previous_posts_link(); ?></li>
|
||||
<li class="next right"><?php next_posts_link(); ?></li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</nav><!--/.pagination-->
|
102
inc/post-formats.php
Normal file
102
inc/post-formats.php
Normal file
|
@ -0,0 +1,102 @@
|
|||
<?php $format = get_post_format(); ?>
|
||||
<?php $meta = get_post_custom($post->ID); ?>
|
||||
|
||||
<?php if ( has_post_format( 'audio' ) ): // Audio ?>
|
||||
|
||||
<div class="post-format">
|
||||
<?php
|
||||
if ( isset($meta['_audio_url'][0]) && !empty($meta['_audio_url'][0]) ) {
|
||||
global $wp_embed;
|
||||
$audio = $wp_embed->run_shortcode('[embed]'.esc_attr($meta['_audio_url'][0]).'[/embed]');
|
||||
echo $audio;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'gallery' ) ): // Gallery ?>
|
||||
|
||||
<div class="post-format">
|
||||
<?php $images = split_post_images(); if ( !empty($images) ): ?>
|
||||
<script type="text/javascript">
|
||||
// Check if first slider image is loaded, and load flexslider on document ready
|
||||
jQuery(document).ready(function(){
|
||||
var firstImage = jQuery('#flexslider-<?php echo the_ID(); ?>').find('img').filter(':first'),
|
||||
checkforloaded = setInterval(function() {
|
||||
var image = firstImage.get(0);
|
||||
if (image.complete || image.readyState == 'complete' || image.readyState == 4) {
|
||||
clearInterval(checkforloaded);
|
||||
jQuery('#flexslider-<?php echo the_ID(); ?>').flexslider({
|
||||
animation: "fade",
|
||||
slideshow: false,
|
||||
directionNav: true,
|
||||
controlNav: false,
|
||||
pauseOnHover: true,
|
||||
slideshowSpeed: 7000,
|
||||
animationSpeed: 600,
|
||||
smoothHeight: true,
|
||||
touch: false
|
||||
});
|
||||
}
|
||||
}, 20);
|
||||
});
|
||||
</script>
|
||||
<div class="flex-container">
|
||||
<div class="flexslider" id="flexslider-<?php the_ID(); ?>">
|
||||
<ul class="slides">
|
||||
<?php foreach ( $images as $image ): ?>
|
||||
<li>
|
||||
<?php $imageid = wp_get_attachment_image_src($image->ID,'large'); ?>
|
||||
<img src="<?php echo esc_attr( $imageid[0] ); ?>" alt="<?php echo esc_attr( $image->post_title ); ?>">
|
||||
|
||||
<?php if ( $image->post_excerpt ): ?>
|
||||
<div class="image-caption"><?php echo $image->post_excerpt; ?></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'image' ) ): // Image ?>
|
||||
|
||||
<div class="post-format">
|
||||
<?php if ( has_post_thumbnail() ) {
|
||||
the_post_thumbnail('split-large');
|
||||
$caption = get_post(get_post_thumbnail_id())->post_excerpt;
|
||||
if ( isset($caption) && $caption ) echo '<div class="image-caption">'.$caption.'</div>';
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'video' ) ): // Video ?>
|
||||
|
||||
<div class="post-format">
|
||||
<?php
|
||||
if ( isset($meta['_video_url'][0]) && !empty($meta['_video_url'][0]) ) {
|
||||
global $wp_embed;
|
||||
$video = $wp_embed->run_shortcode('[embed]'.esc_attr($meta['_video_url'][0]).'[/embed]');
|
||||
echo $video;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'quote' ) ): // Quote ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'chat' ) ): // Chat ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'link' ) ): // Link ?>
|
||||
|
||||
<?php endif; ?>
|
6
inc/post-nav.php
Normal file
6
inc/post-nav.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php if ( is_single() ): ?>
|
||||
<ul class="post-nav group">
|
||||
<li class="next"><?php next_post_link('%link', '<i class="fas fa-chevron-right"></i><strong>'.esc_html__('Next story', 'split').'</strong> <span>%title</span>'); ?></li>
|
||||
<li class="previous"><?php previous_post_link('%link', '<i class="fas fa-chevron-left"></i><strong>'.esc_html__('Previous story', 'split').'</strong> <span>%title</span>'); ?></li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
47
inc/related-posts.php
Normal file
47
inc/related-posts.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php $related = split_related_posts(); ?>
|
||||
|
||||
<?php if ( $related->have_posts() ): ?>
|
||||
|
||||
<h4 class="heading">
|
||||
<i class="fas fa-hand-point-right"></i><?php esc_html_e('You may also like...','split'); ?>
|
||||
</h4>
|
||||
|
||||
<ul class="related-posts group">
|
||||
|
||||
<?php while ( $related->have_posts() ) : $related->the_post(); ?>
|
||||
<li class="related post-hover">
|
||||
<article <?php post_class(); ?>>
|
||||
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('split-medium'); ?>
|
||||
<?php elseif ( get_theme_mod('placeholder','on') == 'on' ): ?>
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title_attribute(); ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fas fa-play"></i></span>'; ?>
|
||||
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fas fa-volume-up"></i></span>'; ?>
|
||||
<?php if ( is_sticky() ) echo'<span class="thumb-icon small"><i class="fas fa-star"></i></span>'; ?>
|
||||
</a>
|
||||
<?php if ( comments_open() && ( get_theme_mod( 'comment-count','on' ) == 'on' ) ): ?>
|
||||
<a class="post-comments" href="<?php comments_link(); ?>"><span><i class="fas fa-comments"></i><?php comments_number( '0', '1', '%' ); ?></span></a>
|
||||
<?php endif; ?>
|
||||
</div><!--/.post-thumbnail-->
|
||||
|
||||
<div class="related-inner">
|
||||
|
||||
<h4 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
|
||||
</h4><!--/.post-title-->
|
||||
|
||||
</div><!--/.related-inner-->
|
||||
|
||||
</article>
|
||||
</li><!--/.related-->
|
||||
<?php endwhile; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
</ul><!--/.post-related-->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
Loading…
Add table
Add a link
Reference in a new issue