Initial commit

This commit is contained in:
Alexander Agnarson 2021-03-08 18:48:36 +01:00
commit 52198cc0ed
354 changed files with 89079 additions and 0 deletions

View 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>
<?php endif; ?>

17
inc/front-widgets-top.php Normal file
View 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>
<?php endif; ?>

71
inc/page-title.php Normal file
View file

@ -0,0 +1,71 @@
<div class="page-title group">
<div class="page-title-inner group">
<?php if ( is_home() ) : ?>
<h2><?php echo clearwork_blog_title(); ?></h2>
<?php elseif ( is_single() ): ?>
<h2><?php the_category(' / '); ?><span> &middot; <?php the_time( get_option('date_format') ); ?></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','clearwork');
} else {
echo $search_results.' '.esc_html__('Search results','clearwork');
}
?>
</h1>
<div class="notebox">
<?php esc_html_e('For the term','clearwork'); ?> "<span><?php echo get_search_query(); ?></span>".
<?php if ( !have_posts() ): ?>
<?php esc_html_e('Please try another search:','clearwork'); ?>
<?php endif; ?>
<div class="search-again">
<?php get_search_form(); ?>
</div>
</div>
<?php elseif ( is_404() ): ?>
<h1><i class="fas fa-exclamation-circle"></i><?php esc_html_e('Error 404.','clearwork'); ?> <span><?php esc_html_e('Page not found!','clearwork'); ?></span></h1>
<div class="notebox">
<p><?php esc_html_e( 'The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'clearwork' ); ?></p>
<?php get_search_form(); ?>
</div>
<?php elseif ( is_author() ): ?>
<?php $author = get_userdata( get_query_var('author') );?>
<h1><i class="far fa-user"></i><?php echo $author->display_name;?></h1>
<?php elseif ( is_category() ): ?>
<h1><i class="far fa-folder"></i><?php echo single_cat_title('', false); ?></h1>
<?php elseif ( is_tag() ): ?>
<h1><i class="fas fa-tags"></i><?php echo single_tag_title('', false); ?></h1>
<?php elseif ( is_day() ): ?>
<h1><i class="far fa-calendar"></i><?php echo esc_html( get_the_time('F j, Y') ); ?></h1>
<?php elseif ( is_month() ): ?>
<h1><i class="far fa-calendar"></i><?php echo esc_html( get_the_time('F Y') ); ?></h1>
<?php elseif ( is_year() ): ?>
<h1><i class="far fa-calendar"></i><?php echo esc_html( get_the_time('Y') ); ?></h1>
<?php else: ?>
<h2><?php the_title(); ?></h2>
<?php endif; ?>
<?php if ( ! is_paged() ) : ?>
<?php the_archive_description( '<div class="notebox">', '</div>' ); ?>
<?php endif; ?>
</div><!--/.page-title-inner-->
</div><!--/.page-title-->

10
inc/pagination.php Normal file
View 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-->

80
inc/post-formats.php Normal file
View file

@ -0,0 +1,80 @@
<?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 = clearwork_post_images(); if ( !empty($images) ): ?>
<div class="slick-image-slide-wrapper">
<div class="slick-image-slide-nav"></div>
<div class="slick-image-slide" id="slide-<?php the_ID(); ?>">
<?php foreach ( $images as $image ): ?>
<div>
<?php $imageid = wp_get_attachment_image_src($image->ID,'clearwork-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; ?>
</div>
<?php endforeach; ?>
</div>
<div class="slick-image-slide-dots"></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('clearwork-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]'.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
View 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', 'clearwork').'</strong> <span>%title</span>'); ?></li>
<li class="previous"><?php previous_post_link('%link', '<i class="fas fa-chevron-left"></i><strong>'.esc_html__('Previous', 'clearwork').'</strong> <span>%title</span>'); ?></li>
</ul>
<?php endif; ?>

44
inc/related-posts.php Normal file
View file

@ -0,0 +1,44 @@
<?php $related = clearwork_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...','clearwork'); ?>
</h4>
<ul class="related-posts group">
<?php while ( $related->have_posts() ) : $related->the_post(); ?>
<li class="related">
<article class="related-post">
<div class="related-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('clearwork-medium'); ?>
<?php elseif ( get_theme_mod('placeholder') != 'off' ): ?>
<img src="<?php echo esc_url( 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>
</div><!--/.post-thumbnail-->
<div class="related-inner">
<h4 class="related-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(); ?>