mirror of
https://ghproxy.net/https://github.com/AlxMedia/blogrow.git
synced 2025-08-27 01:46:10 +08:00
Initial commit
This commit is contained in:
commit
e40facb023
147 changed files with 49311 additions and 0 deletions
24
inc/featured.php
Normal file
24
inc/featured.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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' => ot_get_option('featured-posts-count'),
|
||||
'cat' => ot_get_option('featured-category')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<?php if ( is_home() && !is_paged() && ( ot_get_option('featured-posts-count') !='0') || is_page_template( 'page-templates/frontpage.php' ) ): ?>
|
||||
|
||||
<div id="owl-featured" class="owl-carousel owl-theme">
|
||||
<?php while ( $featured->have_posts() ): $featured->the_post(); ?>
|
||||
<?php get_template_part('content-featured'); ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
24
inc/frontpage-top.php
Normal file
24
inc/frontpage-top.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<div class="frontpage-top pad">
|
||||
|
||||
<?php if ( ot_get_option('front-picture') ): ?>
|
||||
<div class="front-picture">
|
||||
<img src="<?php echo ot_get_option('front-picture'); ?>" alt="" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_template_part('inc/page-title'); ?>
|
||||
|
||||
<?php while ( have_posts() ): the_post(); ?>
|
||||
<?php the_content(); ?>
|
||||
<div class="clear"></div>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php if ( ot_get_option('front-button-text') && ot_get_option('front-button-link') ): ?>
|
||||
<div class="front-button">
|
||||
<a href="<?php echo esc_attr( ot_get_option('front-button-link') ); ?>">
|
||||
<span><?php echo esc_attr( ot_get_option('front-button-text') ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
15
inc/page-image.php
Normal file
15
inc/page-image.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<div class="page-image">
|
||||
<div class="image-container">
|
||||
<?php the_post_thumbnail('thumb-large'); ?>
|
||||
<?php
|
||||
$caption = get_post(get_post_thumbnail_id())->post_excerpt;
|
||||
$description = get_post(get_post_thumbnail_id())->post_content;
|
||||
echo '<div class="page-image-text">';
|
||||
if ( isset($caption) && $caption ) echo '<div class="caption">'.$caption.'</div>';
|
||||
if ( isset($description) && $description ) echo '<div class="description"><i>'.$description.'</i></div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
</div>
|
||||
</div><!--/.page-image-->
|
||||
<?php endif; ?>
|
70
inc/page-title.php
Normal file
70
inc/page-title.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<div class="page-title">
|
||||
|
||||
<?php if ( is_home() ) : ?>
|
||||
<h2><?php echo alx_blog_title(); ?></h2>
|
||||
|
||||
<?php elseif ( is_single() ): ?>
|
||||
|
||||
<?php elseif ( is_page() ): ?>
|
||||
<h2><?php echo alx_page_title(); ?></h2>
|
||||
|
||||
<?php elseif ( is_search() ): ?>
|
||||
<h1>
|
||||
<?php if ( have_posts() ): ?><i class="fa fa-search"></i><?php endif; ?>
|
||||
<?php if ( !have_posts() ): ?><i class="fa fa-exclamation-circle"></i><?php endif; ?>
|
||||
<?php $search_results=$wp_query->found_posts;
|
||||
if ($search_results==1) {
|
||||
echo $search_results.' '.__('Search result','blogrow');
|
||||
} else {
|
||||
echo $search_results.' '.__('Search results','blogrow');
|
||||
}
|
||||
?>
|
||||
</h1>
|
||||
|
||||
<?php elseif ( is_404() ): ?>
|
||||
<h1><i class="fa fa-exclamation-circle"></i><?php _e('Error 404.','blogrow'); ?> <span><?php _e('Page not found!','blogrow'); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_author() ): ?>
|
||||
<?php $author = get_userdata( get_query_var('author') );?>
|
||||
<h1><i class="fa fa-user"></i><?php _e('Author:','blogrow'); ?> <span><?php echo $author->display_name;?></span></h1>
|
||||
|
||||
<?php elseif ( is_category() ): ?>
|
||||
<h1><i class="fa fa-folder-open"></i><?php _e('Category:','blogrow'); ?> <span><?php echo single_cat_title('', false); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_tag() ): ?>
|
||||
<h1><i class="fa fa-tags"></i><?php _e('Tagged:','blogrow'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_day() ): ?>
|
||||
<h1><i class="fa fa-calendar"></i><?php _e('Daily Archive:','blogrow'); ?> <span><?php echo get_the_time('F j, Y'); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_month() ): ?>
|
||||
<h1><i class="fa fa-calendar"></i><?php _e('Monthly Archive:','blogrow'); ?> <span><?php echo get_the_time('F Y'); ?></span></h1>
|
||||
|
||||
<?php elseif ( is_year() ): ?>
|
||||
<h1><i class="fa fa-calendar"></i><?php _e('Yearly Archive:','blogrow'); ?> <span><?php echo get_the_time('Y'); ?></span></h1>
|
||||
|
||||
<?php elseif ( has_post_format('audio') ): ?>
|
||||
<h1><i class="fa fa-volume-up"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Audio','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('aside') ): ?>
|
||||
<h1><i class="fa fa-pen"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Aside','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('chat') ): ?>
|
||||
<h1><i class="fa fa-comments-o"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Chat','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('gallery') ): ?>
|
||||
<h1><i class="fa fa-picture-o"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Gallery','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('image') ): ?>
|
||||
<h1><i class="fa fa-camera"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Image','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('link') ): ?>
|
||||
<h1><i class="fa fa-link"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Link','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('quote') ): ?>
|
||||
<h1><i class="fa fa-quote-left"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Quote','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('status') ): ?>
|
||||
<h1><i class="fa fa-bullhorn"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Status','blogrow'); ?></span></h1>
|
||||
<?php elseif ( has_post_format('video') ): ?>
|
||||
<h1><i class="fa fa-video-camera"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Video','blogrow'); ?></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-->
|
103
inc/post-formats.php
Normal file
103
inc/post-formats.php
Normal file
|
@ -0,0 +1,103 @@
|
|||
<?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]'.$meta['_audio_url'][0].'[/embed]');
|
||||
echo $audio;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'gallery' ) ): // Gallery ?>
|
||||
|
||||
<div class="post-format">
|
||||
<?php $images = alx_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">
|
||||
<div class="image-container">
|
||||
<?php if ( has_post_thumbnail() ) {
|
||||
the_post_thumbnail('thumb-large');
|
||||
$caption = get_post(get_post_thumbnail_id())->post_excerpt;
|
||||
if ( isset($caption) && $caption ) echo '<div class="image-caption">'.$caption.'</div>';
|
||||
} ?>
|
||||
</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]'.$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="fa fa-chevron-right"></i><strong>'.__('Next post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
|
||||
<li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.__('Previous post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
46
inc/related-posts.php
Normal file
46
inc/related-posts.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php $related = alx_related_posts(); ?>
|
||||
|
||||
<?php if ( $related->have_posts() ): ?>
|
||||
|
||||
<div class="pad">
|
||||
<h4 class="heading"><?php _e('You may also like','blogrow'); ?></h4>
|
||||
<ul class="related-posts group">
|
||||
|
||||
<?php while ( $related->have_posts() ) : $related->the_post(); ?>
|
||||
<li class="related">
|
||||
<article <?php post_class(); ?>>
|
||||
|
||||
<div class="related-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-medium'); ?>
|
||||
<?php else: ?>
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title(); ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-play"></i></span>'; ?>
|
||||
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-volume-up"></i></span>'; ?>
|
||||
<?php if ( is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-star"></i></span>'; ?>
|
||||
</a>
|
||||
</div><!--/.related-thumbnail-->
|
||||
|
||||
<div class="related-inner">
|
||||
|
||||
<h4 class="related-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
</h4><!--/.related-title-->
|
||||
|
||||
<div class="related-date"><?php the_time('j M, Y'); ?></div>
|
||||
|
||||
</div><!--/.related-inner-->
|
||||
|
||||
</article>
|
||||
</li><!--/.related-->
|
||||
<?php endwhile; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
</ul><!--/.related-posts-->
|
||||
</div><!--/.pad-->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_query(); ?>
|
67
inc/sharrre.php
Normal file
67
inc/sharrre.php
Normal file
|
@ -0,0 +1,67 @@
|
|||
<div class="sharrre-container group">
|
||||
<div id="twitter" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="Tweet"><a class="box group" href="#"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fa fa-twitter"></i></div></a></div>
|
||||
<div id="facebook" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="Like"></div>
|
||||
<div id="googleplus" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="+1"></div>
|
||||
<div id="pinterest" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="Pin It"></div>
|
||||
</div><!--/.sharrre-container-->
|
||||
|
||||
<script type="text/javascript">
|
||||
// Sharrre
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('#twitter').sharrre({
|
||||
share: {
|
||||
twitter: true
|
||||
},
|
||||
template: '<a class="box group" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-twitter"></i></div></a>',
|
||||
enableHover: false,
|
||||
enableTracking: true,
|
||||
buttons: { twitter: {via: '<?php echo esc_attr( ot_get_option('twitter-username') ); ?>'}},
|
||||
click: function(api, options){
|
||||
api.simulateClick();
|
||||
api.openPopup('twitter');
|
||||
}
|
||||
});
|
||||
jQuery('#facebook').sharrre({
|
||||
share: {
|
||||
facebook: true
|
||||
},
|
||||
template: '<a class="box group" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-facebook-square"></i></div></a>',
|
||||
enableHover: false,
|
||||
enableTracking: true,
|
||||
click: function(api, options){
|
||||
api.simulateClick();
|
||||
api.openPopup('facebook');
|
||||
}
|
||||
});
|
||||
jQuery('#googleplus').sharrre({
|
||||
share: {
|
||||
googlePlus: true
|
||||
},
|
||||
template: '<a class="box group" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-google-plus-square"></i></div></a>',
|
||||
enableHover: false,
|
||||
enableTracking: true,
|
||||
urlCurl: '<?php echo get_template_directory_uri() .'/js/sharrre.php'; ?>',
|
||||
click: function(api, options){
|
||||
api.simulateClick();
|
||||
api.openPopup('googlePlus');
|
||||
}
|
||||
});
|
||||
jQuery('#pinterest').sharrre({
|
||||
share: {
|
||||
pinterest: true
|
||||
},
|
||||
template: '<a class="box group" href="#" rel="nofollow"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-pinterest"></i></div></a>',
|
||||
enableHover: false,
|
||||
enableTracking: true,
|
||||
buttons: {
|
||||
pinterest: {
|
||||
description: '<?php echo the_title(); ?>'<?php if( has_post_thumbnail() ){ ?>,media: '<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>'<?php } ?>
|
||||
}
|
||||
},
|
||||
click: function(api, options){
|
||||
api.simulateClick();
|
||||
api.openPopup('pinterest');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue