Commit 614cf564 by Jonatan Jalle Steller

Added option to display article lists as excerpts or full posts, changed catoegory titles

parent f1f8b143
......@@ -41,6 +41,8 @@ The theme bundles the following third-party resources:
Planned for version 1.0:
- Change Karla font for German ß
- Fix logo colour in print layout
- Identify a best practice for footnotes in posts
Ideas for potential improvements:
......
......@@ -53,7 +53,7 @@ function chaoticneutral_customize($wp_customize) {
'title' => __( 'Site Layout', 'chaoticneutral' ),
'priority' => 40,
'capability' => 'edit_theme_options',
'description' => __( 'Set up the general layout you want the current theme Chaotic Neutral to use.', 'chaoticneutral' )
'description' => __( 'Set up the general layout of the current theme.', 'chaoticneutral' )
));
$wp_customize->add_section( 'svg_logo', array(
'title' => __( 'SVG Logo', 'chaoticneutral' ),
......@@ -69,6 +69,13 @@ function chaoticneutral_customize($wp_customize) {
'capability' => 'edit_theme_options',
'transport' => 'refresh'
));
$wp_customize->add_setting( 'article_lists', array(
'default' => 'content',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_key'
));
$wp_customize->add_setting( 'home_category', array(
'default' => false,
'type' => 'theme_mod',
......@@ -149,6 +156,19 @@ function chaoticneutral_customize($wp_customize) {
'priority' => 10,
'description' => __( 'Show author avatar and description below posts next to publishing date and tags', 'chaoticneutral' )
));
$wp_customize->add_control( 'chaoticneutral_article_lists', array(
'label' => __( 'Article Lists', 'chaoticneutral' ),
'type' => 'radio',
'settings' => 'article_lists',
'section' => 'site_layout',
'priority' => 15,
'description' => __( 'Define how lists of articles such as category pages should be displayed.' ),
'choices' => array(
'content' => __( 'Show all content', 'chaoticneutral' ),
'excerpt' => __( 'Show excerpts only', 'chaoticneutral' ),
//'boxes' => __( 'Show excerpt boxes', 'chaoticneutral' )
)
));
$wp_customize->add_control( 'chaoticneutral_home_category', array(
'label' => __( 'Home Category', 'chaoticneutral' ),
'type' => 'number',
......
......@@ -7,7 +7,10 @@
<?php if ( is_home() && ! is_front_page() ) : ?>
<h1 class="index-title redundant"><?php single_post_title(); ?></h1>
<?php elseif ( is_archive() ) :
<?php elseif ( is_category() ) : ?>
<h1 class="index-title"><?php single_cat_title( '', true ); ?></h1>
<?php the_archive_description( '<p>', '</p>' );
elseif ( is_archive() ) :
the_archive_title( '<h1 class="index-title">', '</h1>' );
the_archive_description( '<p>', '</p>' );
elseif ( is_search() ) : ?>
......@@ -26,14 +29,14 @@
<p class="meta-top"><?php chaoticneutral_meta_top(); ?></p>
<?php endif; ?>
<?php if ( has_post_thumbnail() && ! is_singular() && ! is_home() ) : ?>
<div class="post-thumbnail"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'medium' ); ?></a></div>
<?php endif; ?>
<?php if ( is_singular() || is_home() ) {
the_content( sprintf( __( 'Continue reading <span class="redundant">"%s"</span>', 'chaoticneutral' ), the_title( '', '', false ) ) );
} else {
<?php $article_lists = get_theme_mod( 'article_lists' );
if ( ! is_singular() && ( is_search() || $article_lists == 'excerpt' ) ) {
if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'medium' ); ?></a></div>
<?php endif;
the_excerpt();
} else {
the_content( sprintf( __( 'Continue reading <span class="redundant">"%s"</span>', 'chaoticneutral' ), the_title( '', '', false ) ) );
} ?>
<?php wp_link_pages( array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment