Initial commit.
19
404.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header() ?>
|
||||
|
||||
<div class="singular">
|
||||
<div class="singular-main">
|
||||
<h1 class="404-title"><?php _e( 'You've reached the edge of the world.', 'minimalistflex' ) ?></h1>
|
||||
<p><?php _e( 'It looks like the page you are looking for doesn't exist.', 'minimalistflex' ) ?></p>
|
||||
<p><?php _e( 'What about a search?', 'minimalistflex' ) ?></p>
|
||||
<?php get_search_form() ?>
|
||||
<p><a href="javascript:history.go(-1)"><?php _e( 'Go back', 'minimalistflex' ) ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php get_footer() ?>
|
||||
51
README.md
Normal file
@ -0,0 +1,51 @@
|
||||
=== MinimalistFlex ===
|
||||
Stable tag: 1.0.0
|
||||
Contributors: frank419
|
||||
Tags: two-columns ,left-sidebar, right-sidebar, custom-colors, custom-logo, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, sticky-post, theme-options, translation-ready, blog
|
||||
Tested up to: 6.6
|
||||
Requires at least: 4.9
|
||||
License: GNU General Public License v3.0 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
MinimalistFlex is an elegant, easy to use theme that aims to
|
||||
provide a smooth user experience.
|
||||
|
||||
== Description ==
|
||||
MinimalistFlex is a well designed theme that provides as
|
||||
many options as possible while not being overwhelming.
|
||||
|
||||
MinimalistFlex supports all the features you love: flexible header
|
||||
images, multiple widget areas, custom layout & colors, and
|
||||
some exclusive features like setting default featured images.
|
||||
|
||||
MinimalistFlex is tested against many WordPress and PHP versions,
|
||||
including the latest version as well as older versions
|
||||
up to WordPress 4.9 and PHP 5.6.
|
||||
|
||||
MinimalistFlex put all kinds of visitors in its heart. MinimalistFlex is
|
||||
fully responsive, and looks good on very small screens.
|
||||
We also tried our best to make the theme as accessible as
|
||||
possible.
|
||||
|
||||
== Frequently Asked Quesions ==
|
||||
|
||||
= How do I set default featured images? =
|
||||
|
||||
The theme provides a new section, called "Default Featured
|
||||
Images", located in the customizer, just below "Colors".
|
||||
|
||||
This new section provided some new controls, including some
|
||||
images from us in case you don't have any good images right
|
||||
now.
|
||||
|
||||
= To what extent can I customize the colors? =
|
||||
|
||||
Almost everything you see on your site can have its color
|
||||
changed.
|
||||
|
||||
As a bonus, we have 4 pre-built color palettes for you.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.0.0 =
|
||||
* Initial release.
|
||||
21
archive.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<div class="minimalistflex-archive">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_archive_title', 'yes' ) == 'yes' ): ?>
|
||||
<h1 class="archive-title panel">
|
||||
<?php the_archive_title() ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
<?php get_template_part( 'templates/loop' ); ?>
|
||||
</div>
|
||||
<?php the_posts_pagination(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
63
author.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<div class="minimalistflex-author">
|
||||
<?php $id = get_the_author_meta( 'ID' ); ?>
|
||||
<h1 class="author-title panel">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_author_title', 'yes' ) == 'yes' ): ?>
|
||||
<?php the_archive_title() ?>
|
||||
<?php endif; ?>
|
||||
<div class="author-page-avatar<?php if ( user_can( $id, 'administrator' ) && get_theme_mod( 'minimalistflex_layout_author_admin', 'yes' ) == 'yes' ) {
|
||||
echo ' author-admin';
|
||||
} ?>" aria-hidden="true">
|
||||
<?php echo get_avatar( $id, 150 ); ?>
|
||||
</div>
|
||||
</h1>
|
||||
<div class="author-details">
|
||||
<?php
|
||||
$titles = Array(
|
||||
esc_html__( 'User description', 'minimalistflex' ),
|
||||
esc_html__( 'Registration time', 'minimalistflex' ),
|
||||
esc_html__( 'Website', 'minimalistflex' ),
|
||||
esc_html__( 'Email', 'minimalistflex' )
|
||||
);
|
||||
$metas = Array(
|
||||
'description',
|
||||
'user_registered',
|
||||
'user_url',
|
||||
'user_email'
|
||||
);
|
||||
$i = 0;
|
||||
?>
|
||||
<?php while ( $i < count( $metas ) ): ?>
|
||||
<?php $meta = get_the_author_meta( $metas[$i] ); ?>
|
||||
<?php if ( strlen( $meta ) && get_theme_mod( 'minimalistflex_layout_author_elements_' . $metas[$i], 'yes' ) == 'yes' ): ?>
|
||||
<div class="author-detail">
|
||||
<h2><?php echo $titles[$i] ?></h2>
|
||||
<?php echo esc_html( $meta ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $i++; ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<h2 class="author-page-all-posts-title">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: The author display name. */
|
||||
esc_html__( 'All posts by %s', 'minimalistflex' ),
|
||||
get_the_author_meta( 'display_name' )
|
||||
)
|
||||
?>
|
||||
</h2>
|
||||
<?php get_template_part( 'templates/loop' ) ?>
|
||||
</div>
|
||||
<?php the_posts_pagination(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
58
comments.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( post_password_required() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="comments-area">
|
||||
<?php if ( have_comments() ) : ?>
|
||||
<h2 class="comments-title">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s: Number of comments. %2$s: Post title. */
|
||||
_nx(
|
||||
'One comment on "%2$s"',
|
||||
'%1$s comments on "%2$s"',
|
||||
get_comments_number(),
|
||||
'comments title',
|
||||
'minimalistflex'
|
||||
),
|
||||
number_format_i18n( get_comments_number() ),
|
||||
'<span>' . get_the_title() . '</span>'
|
||||
);
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<ul class="comment-list">
|
||||
<?php
|
||||
wp_list_comments( array(
|
||||
'style' => 'ul',
|
||||
'short_ping' => true,
|
||||
'avatar_size' => 40,
|
||||
) );
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
<nav class="nav-links navigation comment-navigation" role="navigation">
|
||||
<h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'minimalistflex' ); ?></h1>
|
||||
<div class="previous"><?php previous_comments_link( __( '← Older Comments', 'minimalistflex' ) ); ?></div>
|
||||
<div class="next"><?php next_comments_link( __( 'Newer Comments →', 'minimalistflex' ) ); ?></div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! comments_open() && get_comments_number() ) : ?>
|
||||
<p class="no-comments"><?php _e( 'Comments are closed.', 'minimalistflex' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php comment_form(); ?>
|
||||
|
||||
</div>
|
||||
31
css/autoh2label.css
Normal file
@ -0,0 +1,31 @@
|
||||
:root {
|
||||
counter-reset: headings;
|
||||
}
|
||||
|
||||
.singular-main h2 {
|
||||
position: relative;
|
||||
counter-increment: headings;
|
||||
}
|
||||
|
||||
.singular-main h2::before {
|
||||
content: counter(headings);
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
background-color: var(--minimalistflex-tint);
|
||||
color: var(--minimalistflex-contrast);
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.singular-main h2::after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: calc(100% - 2em);
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--minimalistflex-tint), var(--minimalistflex-tint-alt));
|
||||
}
|
||||
41
css/color-palette.css
Normal file
@ -0,0 +1,41 @@
|
||||
.palettes {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.palette {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
cursor: default;
|
||||
border: solid 1px #c3c4c7;
|
||||
box-sizing: border-box;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.palette > button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: content-box;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
color: inherit;
|
||||
padding: 9px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.palette > button:hover {
|
||||
background-color: #ffffff3f;
|
||||
}
|
||||
|
||||
#minimalistflex-palette-galatic,
|
||||
#minimalistflex-palette-dark {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
53
css/editor.css
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is used to style the editor.
|
||||
*/
|
||||
|
||||
:root :where(body) {
|
||||
line-height: 2em;
|
||||
margin: 0 10%;
|
||||
}
|
||||
|
||||
tt,
|
||||
kbd,
|
||||
code,
|
||||
pre {
|
||||
font-family: Hack, 'Courier New', Courier, monospace;
|
||||
background-color: #111 !important;
|
||||
color: #fff !important;
|
||||
border-radius: 2px;
|
||||
padding: 5px 10px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
code:has(br) {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
blockquote,
|
||||
address {
|
||||
border-left: solid 3px #ffd900;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table thead,
|
||||
table tbody tr:not(:last-child) {
|
||||
border-bottom: solid 1px #000;
|
||||
}
|
||||
|
||||
table thead,
|
||||
table tbody tr:nth-child(2n) {
|
||||
background-color: color-mix(
|
||||
in srgb,
|
||||
#f0f0f0,
|
||||
transparent 25%
|
||||
)
|
||||
}
|
||||
20
css/mobile.css
Normal file
@ -0,0 +1,20 @@
|
||||
@media screen and (max-width: 782px) {
|
||||
.minimalistflex-content {
|
||||
width: 67%;
|
||||
}
|
||||
|
||||
.minimalistflex-sidebar {
|
||||
width: 33%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
.minimalistflex-content,
|
||||
.minimalistflex-sidebar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.minimalistflex-master {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
58
css/multi-image.css
Normal file
@ -0,0 +1,58 @@
|
||||
.placeholder {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
cursor: default;
|
||||
border: 1px dashed #c3c4c7;
|
||||
box-sizing: border-box;
|
||||
padding: 9px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.images:has(.image-item) + .placeholder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.suggested-image-item,
|
||||
.image-item {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
-webkit-box-shadow: inset 0 0 15px rgba(0,0,0,.1), inset 0 0 0 1px rgba(0,0,0,.05);
|
||||
box-shadow: inset 0 0 15px rgba(0,0,0,.1), inset 0 0 0 1px rgba(0,0,0,.05);
|
||||
background: #eee;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.suggested-image-item::before,
|
||||
.image-item::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
box-shadow: 0 0 0 5px #2271b1 inset;
|
||||
}
|
||||
|
||||
.image-item::before {
|
||||
box-shadow: 0 0 0 5px #b12222 inset;
|
||||
}
|
||||
|
||||
.suggested-image-item:hover::before,
|
||||
.image-item:hover::before {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.actions {
|
||||
padding: 1em 0;
|
||||
}
|
||||
BIN
defaults/1.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
defaults/2.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
defaults/3.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
defaults/4.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
defaults/5.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
defaults/6.png
Normal file
|
After Width: | Height: | Size: 418 KiB |
BIN
defaults/header.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
defaults/header2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
defaults/palette.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
defaults/palette2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
defaults/palette3.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
defaults/palette4.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
90
footer.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
</article>
|
||||
|
||||
<?php
|
||||
|
||||
if( is_home() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_home_sidebar', 'right' );
|
||||
} elseif ( is_front_page() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_front_sidebar', 'right' );
|
||||
} elseif ( is_search() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_search_sidebar', 'right' );
|
||||
} elseif ( is_archive() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_archive_sidebar', 'right' );
|
||||
} elseif( is_author() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_author_sidebar', 'right' );
|
||||
} elseif( is_single() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_singular_sidebar', 'right' );
|
||||
} elseif( is_page() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_page_sidebar', 'right' );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $sidebar <> 'no' ): ?>
|
||||
<aside class="minimalistflex-sidebar">
|
||||
<?php get_sidebar(); ?>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
|
||||
</main>
|
||||
|
||||
<ul class="minimalistflex-controls">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_interface_scroll_top', 'yes' ) == 'yes' ): ?>
|
||||
<li><a href="#main-content" aria-label="<?php esc_attr_e( 'Back to top', 'minimalistflex' ) ?>">:D</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<footer class="minimalistflex-footer">
|
||||
<div class="minimalistflex-footer-widgets-container">
|
||||
<?php $sidebars = get_theme_mod( 'minimalistflex_footer_widget_layout', 'one' ); ?>
|
||||
<?php
|
||||
get_sidebar( 'footer' );
|
||||
if ( $sidebars == 'two' || $sidebars == 'three' ) {
|
||||
get_sidebar( 'footer-2' );
|
||||
}
|
||||
if ( $sidebars == 'three' ) {
|
||||
get_sidebar( 'footer-3' );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="minimalistflex-footer-credits">
|
||||
<?php if ( display_header_text() ): ?>
|
||||
<div class="footer-blog-description">
|
||||
<div class="footer-blog-title">
|
||||
<a href="<?php echo esc_url( home_url() ); ?>" class="blog-title-link"><?php echo get_bloginfo( 'name' ) ?></a>
|
||||
</div>
|
||||
<?php if( get_bloginfo( 'description' ) ): ?>
|
||||
<div class="footer-blog-tagline">
|
||||
<?php echo get_bloginfo( 'description' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="footer-credits">
|
||||
<?php $footer_type = get_theme_mod( 'minimalistflex_footer_type', 'both' ); ?>
|
||||
<?php if ( $footer_type == 'both' || $footer_type == 'custom' ): ?>
|
||||
<?php echo wp_kses_data( get_theme_mod( 'minimalistflex_footer_text' ) ) ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( $footer_type == 'both' || $footer_type == 'minimalistflex' ): ?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: Link to theme author website. */
|
||||
__( 'Theme <a href="%s">minimalistflex</a>.', 'minimalistflex' ),
|
||||
esc_url( 'https://onmyodev.com/' )
|
||||
)
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
170
functions.php
Normal file
@ -0,0 +1,170 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
function minimalistflex_add_supports() {
|
||||
add_theme_support( 'custom-background' );
|
||||
add_theme_support( 'title-tag' );
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
add_theme_support( "align-wide" );
|
||||
add_theme_support( "post-thumbnails" );
|
||||
add_theme_support( 'html5', Array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script', 'navigation-widgets' ) );
|
||||
add_theme_support( 'custom-logo', Array(
|
||||
'width' => '80',
|
||||
'height' => '80'
|
||||
) );
|
||||
|
||||
add_theme_support( 'custom-header', Array(
|
||||
'default-text-color' => '#000000',
|
||||
'default-image' => get_template_directory_uri() . '/defaults/header.png',
|
||||
'flex-width' => true,
|
||||
'width' => '1920',
|
||||
'flex-height' => true,
|
||||
'height' => '300'
|
||||
) );
|
||||
register_default_headers( Array(
|
||||
'abstract' => Array(
|
||||
'url' => get_template_directory_uri() . '/defaults/header.png',
|
||||
'thumbnail_url' => get_template_directory_uri() . '/defaults/header.png',
|
||||
'description' => 'An abstract default header image.'
|
||||
),
|
||||
'lines' => Array(
|
||||
'url' => get_template_directory_uri() . '/defaults/header2.png',
|
||||
'thumbnail_url' => get_template_directory_uri() . '/defaults/header2.png',
|
||||
'description' => 'A default header image that contains three lines.'
|
||||
)
|
||||
) );
|
||||
|
||||
add_theme_support( 'editor-styles' );
|
||||
add_editor_style( 'css/editor.css' );
|
||||
|
||||
$content_width = '100%';
|
||||
}
|
||||
add_action( 'after_setup_theme', 'minimalistflex_add_supports' );
|
||||
|
||||
function minimalistflex_enqueue_files() {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
wp_enqueue_style( 'style', get_stylesheet_uri() );
|
||||
wp_enqueue_script( 'minimalistflex-script', get_template_directory_uri() . '/js/menu.js', array('jquery'), null, true);
|
||||
if ( get_theme_mod( 'minimalistflex_interface_autoh2label', 'no' ) == 'yes' ) {
|
||||
wp_enqueue_style( 'minimalistflex-autoh2label-style', get_template_directory_uri() . '/css/autoh2label.css' );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_head', 'minimalistflex_enqueue_files' );
|
||||
|
||||
function minimalistflex_widgets_init() {
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Menu', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'menu',
|
||||
'description' => __( 'Widgets in this area will be shown at the right in the main navigation menu dropdown.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget menu-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title menu-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Menu 2', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'menu-2',
|
||||
'description' => __( 'Widgets in this area will be shown at the middle in the main navigation menu dropdown. Will be hidden when submenu items were shown.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget menu-2-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title menu-2-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Main Sidebar', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'main-sidebar',
|
||||
'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Above Content', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'above-content',
|
||||
'description' => __( 'Widgets in this area will be shown above the main content.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget above-content-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title above-content-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Below Content', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'below-content',
|
||||
'description' => __( 'Widgets in this area will be shown below the main content.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget below-content-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title below-content-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Footer', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'footer',
|
||||
'description' => __( 'Widgets in this area will be shown in the footer. Always shows.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget footer-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title footer-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Footer 2', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'footer-2',
|
||||
'description' => __( 'Widgets in this area will be shown in the footer to construct a multi column footer. Only shows when the footer is set to display it. Also twice as wide as other footer widget areas.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget footer-2-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title footer-2-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => _x( 'Footer 3', 'sidebar name' , 'minimalistflex' ),
|
||||
'id' => 'footer-3',
|
||||
'description' => __( 'Widgets in this area will be shown in the footer to construct a multi column footer. Only shows when the footer is set to display it.', 'minimalistflex' ),
|
||||
'before_widget' => '<li id="%1$s" class="panel widget footer-3-widget %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h2 class="panel-title widget-title footer-3-widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
}
|
||||
add_action( 'widgets_init', 'minimalistflex_widgets_init' );
|
||||
|
||||
function minimalistflex_register_menus() {
|
||||
register_nav_menus(
|
||||
array(
|
||||
'main-menu' => __( 'Main Menu', 'minimalistflex' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'minimalistflex_register_menus' );
|
||||
|
||||
function minimalistflex_dynamic_css() {
|
||||
require_once 'includes/colors.php';
|
||||
require_once 'includes/languages.php';
|
||||
}
|
||||
|
||||
add_action( 'wp_footer', 'minimalistflex_dynamic_css' );
|
||||
|
||||
load_theme_textdomain( 'minimalistflex', get_template_directory() . '/languages' );
|
||||
|
||||
require_once 'includes/customizer.php';
|
||||
|
||||
function minimalistflex_custom_excerpt_length() {
|
||||
return intval( get_theme_mod( 'minimalistflex_interface_excerpt', '55' ) );
|
||||
}
|
||||
add_filter( 'excerpt_length', 'minimalistflex_custom_excerpt_length', 999 );
|
||||
|
||||
function minimalistflex_get_seconds() {
|
||||
return strtotime( get_the_date( 'Y-m-d H:i:s' ) );
|
||||
}
|
||||
|
||||
function minimalistflex_get_first_image( $size = 'large' ) {
|
||||
global $post;
|
||||
$allimages = get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $post->ID );
|
||||
foreach ( $allimages as $img ) {
|
||||
$img_src = wp_get_attachment_image_src( $img->ID, $size );
|
||||
return $img_src[0];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
123
header.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo('charset'); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class( 'loading' ) ?>>
|
||||
|
||||
<?php
|
||||
if ( function_exists( 'wp_body_open' ) ) {
|
||||
wp_body_open();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if( is_home() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_home_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_home_header', 'yes' );
|
||||
} elseif ( is_front_page() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_front_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_front_header', 'yes' );
|
||||
} elseif ( is_search() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_search_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_search_header', 'yes' );
|
||||
} elseif ( is_author() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_author_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_author_header', 'yes' );
|
||||
} elseif ( is_archive() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_archive_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_archive_header', 'yes' );
|
||||
} elseif ( is_single() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_singular_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_singular_header', 'yes' );
|
||||
} elseif ( is_page() ) {
|
||||
$sidebar = get_theme_mod( 'minimalistflex_layout_page_sidebar', 'right' );
|
||||
$header = get_theme_mod( 'minimalistflex_layout_page_header', 'yes' );
|
||||
}
|
||||
|
||||
$link = get_theme_mod( 'minimalistflex_header_link' );
|
||||
$label = get_theme_mod( 'minimalistflex_header_label' );
|
||||
|
||||
?>
|
||||
|
||||
<a class="screen-reader-text" href="#main-content"><?php esc_html_e( 'Skip to main content', 'minimalistflex' ) ?></a>
|
||||
|
||||
<?php if( get_header_image() && $header == 'yes' ): ?>
|
||||
<header class="minimalistflex-header-image">
|
||||
<?php if ( strlen( $link ) ): ?>
|
||||
<a href="<?php echo esc_url( $link ) ?>" aria-label="<?php
|
||||
if ( strlen( $label ) ) {
|
||||
echo esc_attr( $label );
|
||||
} else {
|
||||
esc_attr_e( 'The header image link.', 'minimalistflex' );
|
||||
}
|
||||
?>">
|
||||
<?php endif; ?>
|
||||
<img src="<?php header_image(); ?>" aria-label="<?php
|
||||
if ( strlen( $label ) ) {
|
||||
printf(
|
||||
/* translators: %s: The label of the header image link. */
|
||||
esc_attr__( 'The image of the header image link to "%s".', 'minimalistflex' ),
|
||||
esc_attr( $label )
|
||||
);
|
||||
} else {
|
||||
esc_attr_e( 'The header image.', 'minimalistflex' );
|
||||
}
|
||||
?>">
|
||||
<?php if ( strlen( $link ) ): ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
<?php endif; ?>
|
||||
|
||||
<nav class="minimalistflex-header">
|
||||
<?php if ( has_custom_logo() ): ?>
|
||||
<?php echo get_custom_logo(); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( display_header_text() ): ?>
|
||||
<h1 class="blog-title">
|
||||
<a href="<?php echo esc_url( home_url() ); ?>" class="blog-title-link"><?php echo get_bloginfo( 'name' ) ?></a>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
<div class="spacer"></div>
|
||||
<?php if ( has_nav_menu( 'main-menu' ) || is_active_sidebar( 'menu' ) || is_active_sidebar( 'menu-2' ) ): ?>
|
||||
<button id="menu-toggle" aria-label="<?php esc_attr_e( 'Toggle navigation dropdown', 'minimalistflex' ) ?>">
|
||||
<i id="menu-toggle-icon"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<div class="minimalistflex-menu-container">
|
||||
<div class="minimalistflex-menu">
|
||||
<?php if ( has_nav_menu( 'main-menu' ) ): ?>
|
||||
<div id="minimalistflex-menu-nav-menu">
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="custom-menu-2" id="custom-menu-2">
|
||||
<a id="custom-menu-2-focus" href="#" aria-label="<?php esc_attr_e( 'Here goes the "Menu 2" widget area. This text does not trigger anything.', 'minimalistflex' ) ?>"></a>
|
||||
<div class="custom-menu-2-menu">
|
||||
<?php get_sidebar( 'menu-2' ) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( is_active_sidebar( 'menu' ) || user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<div class="menu-custom" id="menu-custom">
|
||||
<?php get_sidebar( 'menu' ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="minimalistflex-master <?php echo 'minimalistflex-sidebar-layout-' . $sidebar ?>">
|
||||
|
||||
<article class="minimalistflex-content" id="main-content">
|
||||
|
||||
<?php get_sidebar( 'above-content' ); ?>
|
||||
44
includes/class-color-palette-control.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('WP_Customize_Image_Control')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
class MinimalistFlex_Color_Palette_Custom_Control extends WP_Customize_Control
|
||||
{
|
||||
|
||||
public $label;
|
||||
public $description;
|
||||
public $suggest_label;
|
||||
public $suggest_description;
|
||||
public $suggest_images;
|
||||
|
||||
public function enqueue()
|
||||
{
|
||||
wp_enqueue_style('color-palette-style', get_template_directory_uri().'/css/color-palette.css');
|
||||
wp_enqueue_script('color-palette-script', get_template_directory_uri().'/js/color-palette.js', array( 'jquery' ), rand(), true);
|
||||
}
|
||||
|
||||
public function render_content()
|
||||
{
|
||||
$theme_uri = get_template_directory_uri();
|
||||
?>
|
||||
<span class='customize-control-title'>
|
||||
<?php echo esc_html( $this->label ) ?>
|
||||
</span>
|
||||
<span class='description customize-control-description'>
|
||||
<?php echo esc_html( $this->description ) ?>
|
||||
</span>
|
||||
|
||||
<div>
|
||||
<ul class='palettes'>
|
||||
<li class="palette" style="background-image: url('<?php echo esc_attr( $theme_uri . '/defaults/palette.png' ) ?>')"><button id="minimalistflex-palette-light"><?php echo esc_html_x( 'Light', 'color palette', 'minimalistflex' ) ?></li>
|
||||
<li class="palette" style="background-image: url('<?php echo esc_attr( $theme_uri . '/defaults/palette2.png' ) ?>')"><button id="minimalistflex-palette-dark"><?php echo esc_html_x( 'Dark', 'color palette', 'minimalistflex' ) ?></li>
|
||||
<li class="palette" style="background-image: url('<?php echo esc_attr( $theme_uri . '/defaults/palette3.png' ) ?>')"><button id="minimalistflex-palette-galatic"><?php echo esc_html_x( 'Galatic', 'color palette', 'minimalistflex' ) ?></li>
|
||||
<li class="palette" style="background-image: url('<?php echo esc_attr( $theme_uri . '/defaults/palette4.png' ) ?>')"><button id="minimalistflex-palette-spring"><?php echo esc_html_x( 'Spring', 'color palette', 'minimalistflex' ) ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
61
includes/class-multi-image-control.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('WP_Customize_Image_Control')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
class MinimalistFlex_Multi_Image_Custom_Control extends WP_Customize_Control
|
||||
{
|
||||
|
||||
public $label;
|
||||
public $description;
|
||||
public $suggest_label;
|
||||
public $suggest_description;
|
||||
public $suggest_images;
|
||||
|
||||
public function enqueue()
|
||||
{
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_style('multi-image-style', get_template_directory_uri().'/css/multi-image.css');
|
||||
wp_enqueue_script('multi-image-script', get_template_directory_uri().'/js/multi-image.js', array( 'jquery' ), rand(), true);
|
||||
}
|
||||
|
||||
public function render_content()
|
||||
{ ?>
|
||||
<span class='customize-control-title'>
|
||||
<?php echo esc_html( $this->label ) ?>
|
||||
</span>
|
||||
<span class='description customize-control-description'>
|
||||
<?php echo esc_html( $this->description ) ?>
|
||||
</span>
|
||||
|
||||
<div>
|
||||
<ul class='images'></ul>
|
||||
<div class="placeholder"><?php esc_html_e( 'No image set', 'minimalistflex' ) ?></div>
|
||||
</div>
|
||||
<div class='actions'>
|
||||
<a class="button-secondary upload">
|
||||
<?php esc_html_e( 'Add Image', 'minimalistflex' ) ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<input class="wp-editor-area" id="images-input" type="hidden" <?php $this->link(); ?>>
|
||||
|
||||
<span class='customize-control-title'>
|
||||
<?php echo esc_html( $this->suggest_label ) ?>
|
||||
</span>
|
||||
<span class='customize-control-description'>
|
||||
<?php echo esc_html( $this->suggest_description ) ?>
|
||||
</span>
|
||||
|
||||
<div>
|
||||
<ul class='suggested-images'>
|
||||
<?php foreach ( $this->suggest_images as $suggest_image ): ?>
|
||||
<li class="suggested-image-item"><img src="<?php echo esc_attr( get_template_directory_uri() . $suggest_image ) ?>"></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
67
includes/color-definitions.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$colors = Array(
|
||||
'default' => '#000000',
|
||||
'level3-dark' => '#666666',
|
||||
'link' => '#004774',
|
||||
'link-hover' => '#003663',
|
||||
'header-bg' => '#ffffff',
|
||||
'header-text' => '#000000',
|
||||
'header-menu' => '#f7f7f7',
|
||||
'header-sidebar' => '#f0f0f0',
|
||||
'level1' => '#ffffff',
|
||||
'level2' => '#f7f7f7',
|
||||
'tint' => '#ffd900',
|
||||
'tint-dark' => '#c1a400',
|
||||
'tint-alt' => '#0060c1',
|
||||
'tint-contrast' => '#00281d',
|
||||
'contrast' => '#000000',
|
||||
'contrast-dark' => '#ffffff',
|
||||
'footer-text' => '#ffffff',
|
||||
'footer-bg' => '#333333'
|
||||
);
|
||||
|
||||
$labels = Array(
|
||||
'level1' => __( 'Content Background', 'minimalistflex' ),
|
||||
'level2' => __( 'Sidebar Background', 'minimalistflex' ),
|
||||
'level3-dark' => __( 'Secondary Text', 'minimalistflex' ),
|
||||
'default' => __( 'Default', 'minimalistflex' ),
|
||||
'link' => __( 'Link', 'minimalistflex' ),
|
||||
'link-hover' => __( 'Link Hover', 'minimalistflex' ),
|
||||
'tint' => __( 'Tint A', 'minimalistflex' ),
|
||||
'tint-dark' => __( 'Tint A Dark', 'minimalistflex' ),
|
||||
'tint-alt' => __( 'Tint B', 'minimalistflex' ),
|
||||
'tint-contrast' => __( 'Tint C', 'minimalistflex' ),
|
||||
'contrast' => __( 'Contrast (Light)', 'minimalistflex' ),
|
||||
'contrast-dark' => __( 'Contrast (Dark)', 'minimalistflex' ),
|
||||
'footer-text' => __( 'Footer Text', 'minimalistflex' ),
|
||||
'footer-bg' => __( 'Footer Background', 'minimalistflex' ),
|
||||
'header-bg' => __( 'Header Background', 'minimalistflex' ),
|
||||
'header-menu' => __( 'Navigation Menu Background', 'minimalistflex' ),
|
||||
'header-sidebar' => __( 'Navigation Menu Sidebar Background', 'minimalistflex' ),
|
||||
'header-text' => __( 'Navigation Menu', 'minimalistflex' )
|
||||
);
|
||||
|
||||
$desciprtions = Array(
|
||||
'level1' => __( 'The background color of the main content area.', 'minimalistflex' ),
|
||||
'level2' => __( 'The background color of the sidebar.', 'minimalistflex' ),
|
||||
'level3-dark' => __( 'The secondary text color. Should be lighter than the default color.', 'minimalistflex' ),
|
||||
'default' => __( 'The default text color.', 'minimalistflex' ),
|
||||
'link' => __( 'The link color.', 'minimalistflex' ),
|
||||
'link-hover' => __( 'The link color when hovered.', 'minimalistflex' ),
|
||||
'tint' => __( 'Tint color A. Should be a light color.', 'minimalistflex' ),
|
||||
'tint-dark' => __( 'A darker variant of the tint color A. Only used on the scroll bars.', 'minimalistflex' ),
|
||||
'tint-alt' => __( 'Tint color B. Should be a dark color.', 'minimalistflex' ),
|
||||
'tint-contrast' => __( 'Tint color C. Should be a *even darker* color.', 'minimalistflex' ),
|
||||
'contrast' => __( 'Text color on a light background. Better keep it as is.', 'minimalistflex' ),
|
||||
'contrast-dark' => __( 'Text color on a dark background. Better keep it as is.', 'minimalistflex' ),
|
||||
'footer-text' => __( 'The footer text color.', 'minimalistflex' ),
|
||||
'footer-bg' => __( 'The footer background color.', 'minimalistflex' ),
|
||||
'header-bg' => __( 'The background color of the header.', 'minimalistflex' ),
|
||||
'header-menu' => __( 'The background color of the navigation menu dropdown.', 'minimalistflex' ),
|
||||
'header-sidebar' => __( 'The background color of the sidebar of the navigation menu dropdown.', 'minimalistflex' ),
|
||||
'header-text' => __( 'The text color of the navigation menu dropdown.', 'minimalistflex' )
|
||||
);
|
||||
43
includes/colors.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once 'color-definitions.php';
|
||||
global $colors;
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
||||
:root {
|
||||
--minimalistflex-header: <?php
|
||||
$header_textcolor = get_header_textcolor();
|
||||
if ( preg_match( '/#/', $header_textcolor ) ) {
|
||||
echo $header_textcolor;
|
||||
} else {
|
||||
echo '#' . $header_textcolor;
|
||||
}
|
||||
?>;
|
||||
<?php $color_keys = array_keys( $colors ); ?>
|
||||
<?php foreach( $color_keys as $color_key ): ?>
|
||||
--minimalistflex-<?php echo $color_key; ?>: <?php echo esc_html( get_theme_mod( 'minimalistflex_color_' . $color_key, $colors[$color_key] ) ); ?>;
|
||||
<?php endforeach; ?>
|
||||
--minimalistflex-max-height: <?php
|
||||
if ( get_theme_mod( 'minimalistflex_interface_thumbnail_height', 'flexible' ) === 'fixed' ) {
|
||||
echo esc_html( get_theme_mod( 'minimalistflex_interface_thumbnail_height_px', 300 ) ) . 'px;';
|
||||
} else {
|
||||
echo esc_html( 'auto;' );
|
||||
}
|
||||
?>
|
||||
<?php if ( get_theme_mod( 'minimalistflex_color_disable_shadow', 'no' ) == 'yes' ): ?>
|
||||
--minimalistflex-shadow: transparent;
|
||||
--minimalistflex-shadow-light: transparent;
|
||||
<?php else: ?>
|
||||
--minimalistflex-shadow: rgba(0, 0, 0, 0.19);
|
||||
--minimalistflex-shadow-light: rgba(200, 200, 200, 0.19);
|
||||
<?php endif; ?>
|
||||
}
|
||||
|
||||
</style>
|
||||
838
includes/customizer.php
Normal file
@ -0,0 +1,838 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
require_once 'color-definitions.php';
|
||||
require_once 'sanitize-callbacks.php';
|
||||
|
||||
function minimalistflex_customizer_enqueue_scripts() {
|
||||
wp_enqueue_script( 'minimalistflex_color_palette', get_template_directory_uri() . '/js/color-palette.js', Array( 'jquery' ), null, true );
|
||||
}
|
||||
|
||||
add_action( 'customize_controls_enqueue_scripts', 'minimalistflex_customizer_enqueue_scripts' );
|
||||
|
||||
function minimalistflex_default_featured_image_register( $wp_customize ) {
|
||||
require_once 'class-multi-image-control.php';
|
||||
|
||||
$wp_customize -> add_section( 'minimalistflex_default_featured_image', Array(
|
||||
'title' => __( 'Default Featured Images', 'minimalistflex' ),
|
||||
'description' => __( 'The theme can provide the following images as a fallback when there\'s no featured image set for a post. You can also select where to display those images.', 'minimalistflex' ),
|
||||
'priority' => 50,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_default_featured_images', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_default_featured_images_location', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'archive',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_default_featured_images_first_image', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_control( new MinimalistFlex_Multi_Image_Custom_Control( $wp_customize, 'minimalistflex_default_featured_images', Array(
|
||||
'label' => __( 'Default Images', 'minimalistflex' ),
|
||||
'description' => __( 'Click on "Add Image" to add an image. Click on the image to remove it. There\'s no limit on how many images you can add.', 'minimalistflex' ),
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_default_featured_image',
|
||||
'suggest_label' => __( 'Suggested Images', 'minimalistflex' ),
|
||||
'suggest_description' => __( 'We have prepared some pre-built, generic purpose images for you to choose from. Click on an image will add it into the selection.', 'minimalistflex' ),
|
||||
'suggest_images' => Array( '/defaults/1.png', '/defaults/2.png', '/defaults/3.png', '/defaults/4.png', '/defaults/5.png', '/defaults/6.png' )
|
||||
) ) );
|
||||
$wp_customize -> add_control( 'minimalistflex_default_featured_images_location', Array(
|
||||
'label' => __( 'Location', 'minimalistflex' ),
|
||||
'description' => __( 'You may decide if and where should the default image show.', 'minimalistflex' ),
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_default_featured_image',
|
||||
'choices' => Array(
|
||||
'both' => __( 'Always', 'minimalistflex' ),
|
||||
'archive' => __( 'Archive Page Only', 'minimalistflex' ),
|
||||
'single' => __( 'Single Page Only', 'minimalistflex' ),
|
||||
'no' => __( 'Never', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_default_featured_images_first_image', Array(
|
||||
'label' => __( 'Display First Image', 'minimalistflex' ),
|
||||
'description' => __( 'The theme can also retrieve the first image in a post if possible. When no image was found, the theme can fallback to the default images set below.', 'minimalistflex' ),
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_default_featured_image',
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' ),
|
||||
)
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'minimalistflex_default_featured_image_register' );
|
||||
|
||||
function minimalistflex_customize_color_register( $wp_customize ) {
|
||||
require_once 'class-color-palette-control.php';
|
||||
|
||||
$wp_customize -> add_setting( 'minimalistflex_color_placeholder', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_control( new MinimalistFlex_Color_Palette_Custom_Control( $wp_customize, 'minimalistflex_color_placeholder', Array(
|
||||
'priority' => 1,
|
||||
'label' => __( 'Color Palettes', 'minimalistflex' ),
|
||||
'description' => __( 'We had prepared some fine tuned color palettes for you. Select an option and it will automatically apply the palette to your site.', 'minimalistflex' ),
|
||||
'section' => 'colors'
|
||||
) ) );
|
||||
|
||||
global $colors;
|
||||
global $labels;
|
||||
global $desciprtions;
|
||||
$color_keys = array_keys( $colors );
|
||||
foreach( $color_keys as $color_key ) {
|
||||
$wp_customize -> add_setting( 'minimalistflex_color_' . $color_key, Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => $colors[$color_key],
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_color_cb'
|
||||
) );
|
||||
$wp_customize -> add_control( new WP_Customize_Color_Control( $wp_customize, 'minimalistflex_color_' . $color_key, Array(
|
||||
'label' => $labels[$color_key],
|
||||
'description' => $desciprtions[$color_key],
|
||||
'section' => 'colors'
|
||||
) ) );
|
||||
};
|
||||
$wp_customize -> add_setting( 'minimalistflex_color_disable_shadow', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'no',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_color_disable_shadow', Array(
|
||||
'type' => 'radio',
|
||||
'label' => __( 'Disable Shadows', 'minimalistflex' ),
|
||||
'description' => __( 'This option lets you disable the shadow on the site. It should only affect the shadow created by the theme.', 'minimalistflex' ),
|
||||
'priority' => 2,
|
||||
'section' => 'colors',
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> get_control( 'background_color' ) -> description = __( 'The default background setting from the WordPress core. If set, it will blend with the content & sidebar background colors set below.', 'minimalistflex' );
|
||||
$wp_customize -> get_control( 'header_textcolor' ) -> description = __( 'The default header text setting from the WordPress core. Used on the header and the toggle button.', 'minimalistflex' );
|
||||
}
|
||||
|
||||
$metadatas = Array(
|
||||
/* translators: This line is special. The part before <br> is the description of the section, while the rest is the option name.*/
|
||||
'description' => __( 'Below are some metadatas that you may configure whether to display or not.<br>Description', 'minimalistflex' ),
|
||||
'user_registered' => __( 'Registration time', 'minimalistflex' ),
|
||||
'user_url' => __( 'Website', 'minimalistflex' ),
|
||||
'user_email' => __( 'Email address', 'minimalistflex' )
|
||||
);
|
||||
|
||||
function minimalistflex_customize_author_elements_register( $wp_customize ) {
|
||||
global $metadatas;
|
||||
|
||||
$metadata_keys = array_keys( $metadatas );
|
||||
foreach( $metadata_keys as $metadata_key ) {
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_author_elements_' . $metadata_key, Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
if ( $metadata_key == 'description' ) {
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_elements_' . $metadata_key, Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 45,
|
||||
'capability' => 'edit_theme_options',
|
||||
'label' => __( 'Metadatas', 'minimalistflex' ),
|
||||
'description' => $metadatas[$metadata_key],
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
} else {
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_elements_' . $metadata_key, Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 50,
|
||||
'capability' => 'edit_theme_options',
|
||||
'description' => $metadatas[$metadata_key],
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function minimalistflex_customize_register( $wp_customize ) {
|
||||
|
||||
// Start adding panels.
|
||||
$wp_customize -> add_panel( 'minimalistflex_layout', Array(
|
||||
'title' => _x( 'Layout', 'customizer panel' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may configure how different pages on your site looks like.', 'minimalistflex' ),
|
||||
'priority' => 70,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
|
||||
// Start adding sections.
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_home', Array(
|
||||
'title' => _x( 'Blog Page', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your blog page.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 10,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_front', Array(
|
||||
'title' => _x( 'Front Page', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your front page. Only takes effect when using a static front page.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 12,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_archive', Array(
|
||||
'title' => _x( 'Archives', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your archive pages.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 15,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_search', Array(
|
||||
'title' => _x( 'Search Results', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your search result pages.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 17,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_author', Array(
|
||||
'title' => _x( 'Author Pages', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your author pages.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 20,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_singular', Array(
|
||||
'title' => _x( 'Single Posts', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your posts.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 25,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_layout_page', Array(
|
||||
'title' => _x( 'Pages', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'Here you may customize the layout of your pages.', 'minimalistflex' ),
|
||||
'panel' => 'minimalistflex_layout',
|
||||
'priority' => 30,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_interface', Array(
|
||||
'title' => _x( 'Interface & Elements', 'customizer section' , 'minimalistflex' ),
|
||||
'description' => __( 'You may customize your site\'s interface and the elements displayed here.', 'minimalistflex' ),
|
||||
'priority' => 71,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
$wp_customize -> add_section( 'minimalistflex_footer', Array(
|
||||
'title' => _x( 'Footer', 'customizer section', 'minimalistflex' ),
|
||||
'description' => __( 'You may customize how your footer looks like here.', 'minimalistflex' ),
|
||||
'priority' => 140,
|
||||
'capability' => 'edit_theme_options'
|
||||
) );
|
||||
|
||||
// Start adding settings.
|
||||
$wp_customize -> add_setting( 'minimalistflex_header_link', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'sanitize_callback' => 'esc_url_raw'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_header_label', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'sanitize_callback' => 'esc_attr'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_home_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_home_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_front_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_front_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_archive_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_archive_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_archive_title', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_search_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_search_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_search_title', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_search_form', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_author_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_author_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_author_title', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_author_admin', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_singular_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_singular_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_page_sidebar', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_layout_page_header', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_scroll_top', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_excerpt', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 55,
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_int_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_autoh2label', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'no',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_comment_count', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_publisher', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'yes',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_date', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'modify',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_readlink', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => __( 'Read More', 'minimalistflex' ),
|
||||
'sanitize_callback' => 'esc_html'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_thumbnail_height', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'auto',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_interface_thumbnail_height_px', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 300,
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_int_cb'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_footer_type', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'both',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_callback'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_footer_text', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'sanitize_callback' => 'wp_filter_post_kses'
|
||||
) );
|
||||
$wp_customize -> add_setting( 'minimalistflex_footer_widget_layout', Array(
|
||||
'type' => 'theme_mod',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'one',
|
||||
'sanitize_callback' => 'minimalistflex_sanitize_radio_callback'
|
||||
) );
|
||||
|
||||
// Start binding controls (UI).
|
||||
$wp_customize -> add_control( 'minimalistflex_header_link', Array(
|
||||
'type' => 'url',
|
||||
'priority' => 50,
|
||||
'section' => 'header_image',
|
||||
'label' => __( 'Header Image Link', 'minimalistflex' ),
|
||||
'description' => __( 'You may link the header image to a URL. Leave blank if you do not want to do so.', 'minimalistflex' )
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_header_label', Array(
|
||||
'type' => 'text',
|
||||
'priority' => 40,
|
||||
'section' => 'header_image',
|
||||
'label' => __( 'Header Image Label', 'minimalistflex' ),
|
||||
'description' => __( 'You may provide a description of your header image. Also will become the label of the link if set. Should be set for better accessibility.', 'minimalistflex' )
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_home_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_home',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_home_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_home',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_front_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_front',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_front_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_front',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_archive_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_archive',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_archive_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_archive',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_archive_title', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_layout_archive',
|
||||
'label' => _x( 'Title', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the archive title.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_search_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_search',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_search_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_search',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_search_title', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_layout_search',
|
||||
'label' => _x( 'Search Query', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the search query.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_search_form', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_layout_search',
|
||||
'label' => _x( 'Search Form', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to also display the search form.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_title', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'label' => _x( 'Author Name', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the author name.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_author_admin', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 40,
|
||||
'section' => 'minimalistflex_layout_author',
|
||||
'label' => _x( 'Admin Status', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Show an indicator in the bottom-right of the avatar if the author is an admin.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_singular_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_singular',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_singular_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_singular',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_page_sidebar', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_layout_page',
|
||||
'label' => _x( 'Sidebar', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the sidebar, and its location.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'left' => __( 'Left sidebar', 'minimalistflex' ),
|
||||
'right' => __( 'Right sidebar', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_layout_page_header', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_layout_page',
|
||||
'label' => _x( 'Header Image', 'layout' , 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to display the header image.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_scroll_top', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Scroll to top button', 'minimalistflex' ),
|
||||
'description' => __( 'Whether to display a "Scroll to top" button in the bottom-right corner.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_excerpt', Array(
|
||||
'type' => 'number',
|
||||
'priority' => 20,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Excerpt Word Count', 'minimalistflex' ),
|
||||
'description' => __( 'The word count of the excerpts on any archive page and the blog page.', 'minimalistflex' )
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_autoh2label', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 25,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Auto h2 Label', 'minimalistflex' ),
|
||||
'description' => __( 'The theme can automatically theme and label the h2 elements in single posts and pages, providing a better visual. May not work well in all circumstances, use with caution.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_comment_count', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 30,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Comment Count', 'minimalistflex' ),
|
||||
'description' => __( 'Whether to display the comment count of the posts listed in an archive page.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_publisher', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 35,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Publisher', 'minimalistflex' ),
|
||||
'description' => __( 'Whether to display the publisher.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'yes' => __( 'Yes', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_date', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 40,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Publish Date', 'minimalistflex' ),
|
||||
'description' => __( 'Whether to display the published date.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'publish' => __( 'Yes, publish time only.', 'minimalistflex' ),
|
||||
'modify' => __( 'Yes, and display modified time if possible.', 'minimalistflex' ),
|
||||
'no' => __( 'No', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_readlink', Array(
|
||||
'type' => 'text',
|
||||
'priority' => 45,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Read More Link', 'minimalistflex' ),
|
||||
'description' => __( 'The text for the "Read More" links.', 'minimalistflex' )
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_thumbnail_height', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 50,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Thumbnail Images Size', 'minimalistflex' ),
|
||||
'description' => __( 'Select whether to enable flexible height for your thumbnail images, or use a fixed height.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'fixed' => __( 'Fixed', 'minimalistflex' ),
|
||||
'auto' => __( 'Flexible', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_interface_thumbnail_height_px', Array(
|
||||
'type' => 'number',
|
||||
'priority' => 51,
|
||||
'section' => 'minimalistflex_interface',
|
||||
'label' => __( 'Height', 'minimalistflex' ),
|
||||
'description' => __( 'Enter your desired height here. Should be in pixels.', 'minimalistflex' ),
|
||||
) );
|
||||
$wp_customize -> add_control( 'minimalistflex_footer_type', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 9,
|
||||
'section' => 'minimalistflex_footer',
|
||||
'label' => __( 'Footer Options', 'minimalistflex' ),
|
||||
'description' => __( 'Choose what to display in your footer credit section.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'both' => __( 'Both minimalistflex credits and custom footer text.', 'minimalistflex' ),
|
||||
'minimalistflex' => __( 'minimalistflex credits only.', 'minimalistflex' ),
|
||||
'custom' => __( 'Custom footer text only.', 'minimalistflex' ),
|
||||
'none' => __( 'Neither.', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
$wp_customize -> add_control( new WP_Customize_Code_Editor_Control( $wp_customize, 'minimalistflex_footer_text', Array(
|
||||
'code_type' => 'htmlmixed',
|
||||
'priority' => 15,
|
||||
'section' => 'minimalistflex_footer',
|
||||
'label' => __( 'Custom Footer Text', 'minimalistflex' ),
|
||||
'description' => __( 'Here you may set a custom footer text to be displayed in the footer credits. HTML allowed.', 'minimalistflex' )
|
||||
) ) );
|
||||
$wp_customize -> add_control( 'minimalistflex_footer_widget_layout', Array(
|
||||
'type' => 'radio',
|
||||
'priority' => 10,
|
||||
'section' => 'minimalistflex_footer',
|
||||
'label' => __( 'Footer Widget Layout', 'minimalistflex' ),
|
||||
'description' => __( 'Choose the layout of the footer widgets.', 'minimalistflex' ),
|
||||
'choices' => Array(
|
||||
'one' => __( 'One column. Only shows the "Footer" widget area.', 'minimalistflex' ),
|
||||
'two' => __( 'Two columns. Also shows the "Footer 2" widget area.', 'minimalistflex' ),
|
||||
'three' => __( 'Three columns. Also shows the "Footer 3" widget area (aka all areas).', 'minimalistflex' )
|
||||
)
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'minimalistflex_customize_register' );
|
||||
add_action( 'customize_register', 'minimalistflex_customize_color_register' );
|
||||
add_action( 'customize_register', 'minimalistflex_customize_author_elements_register' );
|
||||
15
includes/languages.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
||||
:root {
|
||||
--minimalistflex-featured: "<?php esc_html_e( 'Featured', 'minimalistflex' ) ?>";
|
||||
--minimalistflex-author: "<?php esc_html_e( 'Post Author', 'minimalistflex' ) ?>";
|
||||
--minimalistflex-author-admin: "<?php esc_html_e( 'Admin', 'minimalistflex' ) ?>";
|
||||
}
|
||||
|
||||
</style>
|
||||
29
includes/sanitize-callbacks.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
function minimalistflex_sanitize_radio_cb( $value, $setting ) {
|
||||
$value = sanitize_key( $value );
|
||||
$choices = $setting->manager->get_control( $setting->id )->choices;
|
||||
if ( array_key_exists( $value, $choices ) ) {
|
||||
return $value;
|
||||
} else {
|
||||
return $setting->default;
|
||||
}
|
||||
}
|
||||
|
||||
function minimalistflex_sanitize_color_cb( $value, $setting ) {
|
||||
$value = sanitize_hex_color( $value );
|
||||
if ( isset( $value ) ) {
|
||||
return $value;
|
||||
} else {
|
||||
return $setting->default;
|
||||
}
|
||||
}
|
||||
|
||||
function minimalistflex_sanitize_int_cb( $number, $setting ) {
|
||||
$number = absint( $number );
|
||||
if ( $number ) {
|
||||
return $number;
|
||||
} else {
|
||||
return $setting->default;
|
||||
}
|
||||
}
|
||||
16
index.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<div class="minimalistflex-home">
|
||||
<?php get_template_part( 'templates/loop' ); ?>
|
||||
</div>
|
||||
<?php the_posts_pagination(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
90
js/color-palette.js
Normal file
@ -0,0 +1,90 @@
|
||||
jQuery(document).ready(function($){
|
||||
$("#minimalistflex-palette-light").click(function(e){
|
||||
e.preventDefault()
|
||||
wp.customize("minimalistflex_color_default").set("#000000")
|
||||
wp.customize("minimalistflex_color_level3-dark").set("#666666")
|
||||
wp.customize("minimalistflex_color_link").set("#004774")
|
||||
wp.customize("minimalistflex_color_link-hover").set("#003663")
|
||||
wp.customize("minimalistflex_color_header-bg").set("#ffffff")
|
||||
wp.customize("header_textcolor").set("#000000")
|
||||
wp.customize("minimalistflex_color_header-text").set("#000000")
|
||||
wp.customize("minimalistflex_color_header-menu").set("#f7f7f7")
|
||||
wp.customize("minimalistflex_color_header-sidebar").set("#f0f0f0")
|
||||
wp.customize("minimalistflex_color_level1").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_level2").set("#f7f7f7")
|
||||
wp.customize("minimalistflex_color_tint").set("#ffd900")
|
||||
wp.customize("minimalistflex_color_tint-dark").set("#c1a400")
|
||||
wp.customize("minimalistflex_color_tint-alt").set("#0060c1")
|
||||
wp.customize("minimalistflex_color_tint-contrast").set("#00281d")
|
||||
wp.customize("minimalistflex_color_contrast").set("#000000")
|
||||
wp.customize("minimalistflex_color_contrast-dark").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-bg").set("#333333")
|
||||
})
|
||||
$("#minimalistflex-palette-dark").click(function(e){
|
||||
e.preventDefault()
|
||||
wp.customize("minimalistflex_color_default").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_level3-dark").set("#c0c0c0")
|
||||
wp.customize("minimalistflex_color_link").set("#00cbff")
|
||||
wp.customize("minimalistflex_color_link-hover").set("#00deff")
|
||||
wp.customize("minimalistflex_color_header-bg").set("#000000")
|
||||
wp.customize("header_textcolor").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-menu").set("#222222")
|
||||
wp.customize("minimalistflex_color_header-sidebar").set("#111111")
|
||||
wp.customize("minimalistflex_color_level1").set("#222222")
|
||||
wp.customize("minimalistflex_color_level2").set("#111111")
|
||||
wp.customize("minimalistflex_color_tint").set("#ffd900")
|
||||
wp.customize("minimalistflex_color_tint-dark").set("#c1a400")
|
||||
wp.customize("minimalistflex_color_tint-alt").set("#0060c1")
|
||||
wp.customize("minimalistflex_color_tint-contrast").set("#00281d")
|
||||
wp.customize("minimalistflex_color_contrast").set("#000000")
|
||||
wp.customize("minimalistflex_color_contrast-dark").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-bg").set("#333333")
|
||||
})
|
||||
$("#minimalistflex-palette-galatic").click(function(e){
|
||||
e.preventDefault()
|
||||
wp.customize("minimalistflex_color_default").set("#000000")
|
||||
wp.customize("minimalistflex_color_level3-dark").set("#666666")
|
||||
wp.customize("minimalistflex_color_link").set("#3e2555")
|
||||
wp.customize("minimalistflex_color_link-hover").set("#20152a")
|
||||
wp.customize("minimalistflex_color_header-bg").set("#20152a")
|
||||
wp.customize("header_textcolor").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-menu").set("#3e2555")
|
||||
wp.customize("minimalistflex_color_header-sidebar").set("#663196")
|
||||
wp.customize("minimalistflex_color_level1").set("#e7d2fa")
|
||||
wp.customize("minimalistflex_color_level2").set("#d9c4f2")
|
||||
wp.customize("minimalistflex_color_tint").set("#e7d2fa")
|
||||
wp.customize("minimalistflex_color_tint-dark").set("#3e2555")
|
||||
wp.customize("minimalistflex_color_tint-alt").set("#20152a")
|
||||
wp.customize("minimalistflex_color_tint-contrast").set("#20152a")
|
||||
wp.customize("minimalistflex_color_contrast").set("#000000")
|
||||
wp.customize("minimalistflex_color_contrast-dark").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-bg").set("#20152a")
|
||||
})
|
||||
$("#minimalistflex-palette-spring").click(function(e){
|
||||
e.preventDefault()
|
||||
wp.customize("minimalistflex_color_default").set("#000000")
|
||||
wp.customize("minimalistflex_color_level3-dark").set("#666666")
|
||||
wp.customize("minimalistflex_color_link").set("#355c33")
|
||||
wp.customize("minimalistflex_color_link-hover").set("#004500")
|
||||
wp.customize("minimalistflex_color_header-bg").set("#004500")
|
||||
wp.customize("header_textcolor").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_header-menu").set("#355c33")
|
||||
wp.customize("minimalistflex_color_header-sidebar").set("#487c47")
|
||||
wp.customize("minimalistflex_color_level1").set("#fffdee")
|
||||
wp.customize("minimalistflex_color_level2").set("#eae8b6")
|
||||
wp.customize("minimalistflex_color_tint").set("#daa412")
|
||||
wp.customize("minimalistflex_color_tint-dark").set("#daa412")
|
||||
wp.customize("minimalistflex_color_tint-alt").set("#004500")
|
||||
wp.customize("minimalistflex_color_tint-contrast").set("#004500")
|
||||
wp.customize("minimalistflex_color_contrast").set("#000000")
|
||||
wp.customize("minimalistflex_color_contrast-dark").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-text").set("#ffffff")
|
||||
wp.customize("minimalistflex_color_footer-bg").set("#004500")
|
||||
})
|
||||
})
|
||||
10
js/menu.js
Normal file
@ -0,0 +1,10 @@
|
||||
jQuery(document).ready(function($){
|
||||
$("#menu-toggle").click(function(e){
|
||||
e.preventDefault()
|
||||
$(this).parent().eq(0).toggleClass("active")
|
||||
})
|
||||
$("#custom-menu-2-focus").click(function(e){
|
||||
e.preventDefault()
|
||||
})
|
||||
$("body").removeClass("loading")
|
||||
})
|
||||
76
js/multi-image.js
Normal file
@ -0,0 +1,76 @@
|
||||
jQuery(document).ready(function($) {
|
||||
/*
|
||||
* Show images on load
|
||||
*/
|
||||
let attachment_string = $("#images-input").val();
|
||||
let attachment_array = attachment_string.split(",");
|
||||
|
||||
for (var i = 0; i < attachment_array.length; i++) {
|
||||
if (attachment_array[i] != "") {
|
||||
$(".images").append(
|
||||
'<li class="image-item"><img src="' +
|
||||
attachment_array[i] +
|
||||
'"></li>'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add images
|
||||
*/
|
||||
$(".button-secondary.upload").click(function () {
|
||||
let custom_uploader = (wp.media.frames.file_frame = wp.media({
|
||||
multiple: true,
|
||||
}));
|
||||
|
||||
custom_uploader.on("select", function () {
|
||||
let selection = custom_uploader.state().get("selection");
|
||||
let attachments = [];
|
||||
selection.map(function (attachment) {
|
||||
attachment = attachment.toJSON();
|
||||
$(".images").append(
|
||||
"<li class='image-item'><img src='" +
|
||||
attachment.url +
|
||||
"'></li>"
|
||||
);
|
||||
attachments.push(attachment.url);
|
||||
});
|
||||
let previous = $("#images-input").val() ? "," + $("#images-input").val() : ""; // get rid of trailing commas
|
||||
let attachment_string = attachments.join() + previous;
|
||||
$("#images-input").val(attachment_string).trigger("change");
|
||||
});
|
||||
custom_uploader.open();
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* Remove images when you click on an image
|
||||
*/
|
||||
$(".images").click(function (e) {
|
||||
let img_url = $(e.target).find("img").attr("src");
|
||||
$(e.target).closest("li").remove();
|
||||
let attachment_string = $("#images-input").val();
|
||||
attachment_string = attachment_string.replace(img_url, "");
|
||||
attachment_string = attachment_string.replaceAll(",,", ","); // get rid of duplicate commas
|
||||
attachment_string = attachment_string.replace(/^,+|,+$/g, ""); // get rid of leading or trailing commans
|
||||
$("#images-input").val(attachment_string).trigger("change");
|
||||
});
|
||||
|
||||
/*
|
||||
* Add suggested images when clicked
|
||||
*/
|
||||
$(".suggested-images").click(function(e){
|
||||
let img_url = $(e.target).find("img").attr("src");
|
||||
let attachment_string = $("#images-input").val();
|
||||
attachment_string += ",";
|
||||
attachment_string += img_url;
|
||||
attachment_string = attachment_string.replace(/^,+|,+$/g, ""); // get rid of leading or trailing commans
|
||||
$(".images").append(
|
||||
"<li class='image-item'><img src='" +
|
||||
img_url +
|
||||
"'></li>"
|
||||
);
|
||||
$("#images-input").val(attachment_string).trigger("change");
|
||||
})
|
||||
})
|
||||
1067
languages/crystal.pot
Normal file
BIN
languages/zh_CN.mo
Normal file
1156
languages/zh_CN.po
Normal file
1157
languages/zh_CN.po~
Normal file
36
page.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) :
|
||||
the_post();
|
||||
$id = get_the_ID();
|
||||
?>
|
||||
<div <?php post_class( "singular" ) ?>>
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<div class="singular-image">
|
||||
<?php the_post_thumbnail(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="singular-main">
|
||||
<h1 class="panel-title"><?php the_title(); ?></h1>
|
||||
<div class="panel-main">
|
||||
<?php the_content(); ?>
|
||||
<?php wp_link_pages( Array(
|
||||
'before' => '<p class="panel post-nav-links"><span class="post-nav-links-indicator">' . __('Pages: ', 'minimalistflex') . '</span>'
|
||||
) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( comments_open() || get_comments_number() ) :
|
||||
comments_template();
|
||||
endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
51
readme.txt
Normal file
@ -0,0 +1,51 @@
|
||||
=== MinimalistFlex ===
|
||||
Stable tag: 1.0.0
|
||||
Contributors: frank419
|
||||
Tags: two-columns ,left-sidebar, right-sidebar, custom-colors, custom-logo, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, sticky-post, theme-options, translation-ready, blog
|
||||
Tested up to: 6.6
|
||||
Requires at least: 4.9
|
||||
License: GNU General Public License v3.0 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
MinimalistFlex is an elegant, easy to use theme that aims to
|
||||
provide a smooth user experience.
|
||||
|
||||
== Description ==
|
||||
MinimalistFlex is a well designed theme that provides as
|
||||
many options as possible while not being overwhelming.
|
||||
|
||||
MinimalistFlex supports all the features you love: flexible header
|
||||
images, multiple widget areas, custom layout & colors, and
|
||||
some exclusive features like setting default featured images.
|
||||
|
||||
MinimalistFlex is tested against many WordPress and PHP versions,
|
||||
including the latest version as well as older versions
|
||||
up to WordPress 4.9 and PHP 5.6.
|
||||
|
||||
MinimalistFlex put all kinds of visitors in its heart. MinimalistFlex is
|
||||
fully responsive, and looks good on very small screens.
|
||||
We also tried our best to make the theme as accessible as
|
||||
possible.
|
||||
|
||||
== Frequently Asked Quesions ==
|
||||
|
||||
= How do I set default featured images? =
|
||||
|
||||
The theme provides a new section, called "Default Featured
|
||||
Images", located in the customizer, just below "Colors".
|
||||
|
||||
This new section provided some new controls, including some
|
||||
images from us in case you don't have any good images right
|
||||
now.
|
||||
|
||||
= To what extent can I customize the colors? =
|
||||
|
||||
Almost everything you see on your site can have its color
|
||||
changed.
|
||||
|
||||
As a bonus, we have 4 pre-built color palettes for you.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.0.0 =
|
||||
* Initial release.
|
||||
BIN
screenshot.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
63
search.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<div class="minimalistflex-search">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_search_title', 'yes' ) == 'yes' ): ?>
|
||||
<h1 class="search-title panel">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: The search query. */
|
||||
__( 'You have searched for: "%s"', 'minimalistflex' ),
|
||||
get_search_query()
|
||||
)
|
||||
?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_search_form', 'yes' ) == 'yes' ): ?>
|
||||
<div class="search-form panel">
|
||||
<p>
|
||||
<?php esc_html_e( 'Not finding what you are looking at? You may refine your search below:', 'minimalistflex' ) ?>
|
||||
</p>
|
||||
<?php get_search_form(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php get_template_part( 'templates/loop' ); ?>
|
||||
</div>
|
||||
<?php the_posts_pagination(); ?>
|
||||
<?php else: ?>
|
||||
<div class="minimalistflex-search">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_search_title', 'yes' ) == 'yes' ): ?>
|
||||
<h1 class="search-title panel">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: The search query. */
|
||||
__( 'You have searched for: "%s"', 'minimalistflex' ),
|
||||
get_search_query()
|
||||
)
|
||||
?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
<?php if ( get_theme_mod( 'minimalistflex_layout_search_form', 'yes' ) == 'yes' ): ?>
|
||||
<div class="search-form panel">
|
||||
<p>
|
||||
<?php esc_html_e( 'We are unable to find anything with this query. Try refine your search below:', 'minimalistflex' ) ?>
|
||||
</p>
|
||||
<?php get_search_form(); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="search-form panel">
|
||||
<p>
|
||||
<?php esc_html_e( 'We are unable to find anything with this query.', 'minimalistflex' ) ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
18
sidebar-above-content.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'above-content' ) ): ?>
|
||||
<ul class="above-content-widgets">
|
||||
<?php dynamic_sidebar( 'above-content' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="above-content-widgets">
|
||||
<li class="panel widget above-content-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
18
sidebar-below-content.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'below-content' ) ): ?>
|
||||
<ul class="below-content-widgets">
|
||||
<?php dynamic_sidebar( 'above-content' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="below-content-widgets">
|
||||
<li class="panel widget below-content-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
18
sidebar-footer-2.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'footer-2' ) ): ?>
|
||||
<ul class="footer-2-widgets">
|
||||
<?php dynamic_sidebar( 'footer-2' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="footer-2-widgets">
|
||||
<li class="panel widget footer-2-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
18
sidebar-footer-3.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'footer-3' ) ): ?>
|
||||
<ul class="footer-3-widgets">
|
||||
<?php dynamic_sidebar( 'footer-3' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="footer-3-widgets">
|
||||
<li class="panel widget footer-3-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
18
sidebar-footer.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'footer' ) ): ?>
|
||||
<ul class="footer-widgets">
|
||||
<?php dynamic_sidebar( 'footer' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="footer-widgets">
|
||||
<li class="panel widget footer-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
18
sidebar-menu-2.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'menu-2' ) ): ?>
|
||||
<ul class="menu-2-widgets">
|
||||
<?php dynamic_sidebar( 'menu-2' ); ?>
|
||||
</ul>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<ul class="menu-2-widgets">
|
||||
<li class="panel widget menu-2-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
22
sidebar-menu.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'menu' ) ): ?>
|
||||
<a id="minimalistflex-menu-goto-right" href="#menu-custom" aria-label="<?php esc_attr_e( 'Go to the right of the navigation menu, which conntains an extra widget area.', 'minimalistflex' ) ?>">></a>
|
||||
<ul class="menu-widgets">
|
||||
<?php dynamic_sidebar( 'menu' ); ?>
|
||||
</ul>
|
||||
<a id="minimalistflex-menu-goto-left" href="#minimalistflex-menu-nav-menu" aria-label="<?php esc_attr_e( 'Go to the left of the navigation menu, which is the menu and a menu widget area.', 'minimalistflex' ) ?>"><</a>
|
||||
<?php elseif ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<a id="minimalistflex-menu-goto-right" href="#menu-custom" aria-label="<?php esc_attr_e( 'Go to the right of the navigation menu, which conntains an extra widget area.', 'minimalistflex' ) ?>">></a>
|
||||
<ul class="menu-widgets">
|
||||
<li class="panel widget menu-widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area.', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<a id="minimalistflex-menu-goto-left" href="#minimalistflex-menu-nav-menu" aria-label="<?php esc_attr_e( 'Go to the left of the navigation menu, which is the menu and a menu widget area.', 'minimalistflex' ) ?>"><</a>
|
||||
<?php endif; ?>
|
||||
41
sidebar.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'main-sidebar' ) ): ?>
|
||||
<ul class="sidebar">
|
||||
<?php dynamic_sidebar('main-sidebar'); ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<ul class="sidebar">
|
||||
<?php if ( user_can( get_current_user_id(), 'edit_theme_options' ) ): ?>
|
||||
<li class="panel widget warning">
|
||||
<?php esc_html_e( 'Sorry, but no widgets were found in this area. ', 'minimalistflex' ); ?>
|
||||
<?php esc_html_e( 'Some default widgets had been displayed instead.', 'minimalistflex' ); ?>
|
||||
<br>
|
||||
<?php esc_html_e( 'This message is displayed to administrators only.', 'minimalistflex' ); ?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li id="search" class="panel widget widget_search">
|
||||
<?php get_search_form(); ?>
|
||||
</li>
|
||||
|
||||
<li id="archives" class="panel widget">
|
||||
<h3 class="widget-title"><?php _e( 'Archives', 'minimalistflex' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li id="meta" class="panel widget">
|
||||
<h3 class="widget-title"><?php _e( 'Meta', 'minimalistflex' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_register(); ?>
|
||||
<li><?php wp_loginout(); ?></li>
|
||||
<?php wp_meta(); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
59
singular.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$default_images = explode( ',', get_theme_mod( 'minimalistflex_default_featured_images' ));
|
||||
$default_image_location = get_theme_mod( 'minimalistflex_default_featured_images_location', 'archive' );
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if ( have_posts() ) :
|
||||
the_post();
|
||||
$id = get_the_author_meta( 'ID' );
|
||||
?>
|
||||
<div <?php post_class( "singular" ) ?>>
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<div class="singular-image">
|
||||
<?php the_post_thumbnail( 'large' ); ?>
|
||||
</div>
|
||||
<?php elseif ( ( $default_images[0] <> '' || minimalistflex_get_first_image() ) && $default_image_location <> 'no' && $default_image_location <> 'archive' ): ?>
|
||||
<?php if ( get_theme_mod( 'minimalistflex_default_featured_images_first_image', 'yes' ) == 'yes' && minimalistflex_get_first_image() ): ?>
|
||||
<?php $imgsrc = minimalistflex_get_first_image(); ?>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$key = minimalistflex_get_seconds() % count($default_images);
|
||||
$imgsrc = $default_images[$key];
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<div class="singular-image">
|
||||
<img src="<?php echo esc_attr( $imgsrc ) ?>" aria-label="<?php esc_attr_e( 'The thumbnail image. This is a default image so that it\'s purely decorative.', 'minimalistflex' ) ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="singular-main">
|
||||
<h1 class="panel-title"><?php the_title(); ?></h1>
|
||||
<?php get_template_part( 'templates/publisher' ) ?>
|
||||
<div class="panel-main">
|
||||
<?php the_content(); ?>
|
||||
<?php wp_link_pages( Array(
|
||||
'before' => '<p class="panel post-nav-links"><span class="post-nav-links-indicator">' . __('Pages: ', 'minimalistflex') . '</span>'
|
||||
) ); ?>
|
||||
</div>
|
||||
<?php get_sidebar( 'below-content' ) ?>
|
||||
<?php get_template_part( 'templates/author' ) ?>
|
||||
<?php get_template_part( 'templates/metadata' ) ?>
|
||||
</div>
|
||||
<?php if ( comments_open() || get_comments_number() ) :
|
||||
comments_template();
|
||||
else: ?>
|
||||
<p class="no-comments"><?php _e( 'Comments are closed.', 'minimalistflex' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php get_template_part( 'templates/empty' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
18
templates/author.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php $userid = get_the_author_meta( 'ID' ) ?>
|
||||
<div class="singular-author">
|
||||
<div class="author-card">
|
||||
<div class="author-avatar">
|
||||
<?php echo get_avatar( $userid, 80 ); ?>
|
||||
</div>
|
||||
<div class="author-description">
|
||||
<a class="author-link" href="<?php echo get_author_posts_url( $userid ) ?>"><?php the_author() ?></a>
|
||||
<p class="author-tagline"><?php the_author_meta( 'description' ) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
5
templates/empty.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div class="empty">
|
||||
<p>
|
||||
<?php esc_html_e( 'Sorry, but nothing was found at this place.', 'minimalistflex' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
4
templates/index.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
110
templates/loop.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$default_images = explode( ',', get_theme_mod( 'minimalistflex_default_featured_images' ));
|
||||
$default_image_location = get_theme_mod( 'minimalistflex_default_featured_images_location', 'archive' );
|
||||
?>
|
||||
|
||||
<?php while ( have_posts() ) :
|
||||
the_post();
|
||||
$id = get_the_author_meta('ID');
|
||||
$post_id = get_the_ID();
|
||||
?>
|
||||
<div <?php post_class("panel"); ?>>
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<a class="panel-image" href="<?php the_permalink() ?>" aria-label="<?php
|
||||
printf(
|
||||
/* translators: %s: Post title associated with the thumbnail image. */
|
||||
__( 'Thumbnail image of %s. Also a link that navigates to it.', 'minimalistflex' ),
|
||||
get_the_title()
|
||||
) ?>">
|
||||
<?php the_post_thumbnail( 'large' ); ?>
|
||||
</a>
|
||||
<?php elseif ( ( $default_images[0] <> '' || minimalistflex_get_first_image() ) && $default_image_location <> 'no' && $default_image_location <> 'single' ): ?>
|
||||
<?php if ( get_theme_mod( 'minimalistflex_default_featured_images_first_image', 'yes' ) == 'yes' && minimalistflex_get_first_image() ): ?>
|
||||
<?php $imgsrc = minimalistflex_get_first_image(); ?>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$key = minimalistflex_get_seconds() % count($default_images);
|
||||
$imgsrc = $default_images[$key];
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<a class="panel-image" href="<?php the_permalink() ?>" aria-label="<?php
|
||||
printf(
|
||||
/* translators: %s: Post title associated with the thumbnail image. */
|
||||
__( 'Thumbnail image of %s. Also a link that navigates to it.', 'minimalistflex' ),
|
||||
get_the_title()
|
||||
) ?>">
|
||||
<img src="<?php echo esc_url( $imgsrc );?>" aria-label="<?php esc_attr_e( 'The thumbnail image. This is a default image so that it\'s purely decorative.', 'minimalistflex' ) ?>">
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<div class="panel-content">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_interface_comment_count', 'yes' ) == 'yes' ): ?>
|
||||
<div class="panel-comment-count">
|
||||
<?php
|
||||
printf(
|
||||
_nx(
|
||||
'1 Comment',
|
||||
'%d Comments',
|
||||
get_comments_number(),
|
||||
'comment count',
|
||||
'minimalistflex'
|
||||
),
|
||||
number_format_i18n( get_comments_number() )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<h1 class="panel-title"><?php the_title(); ?></h1>
|
||||
<div class="panel-main">
|
||||
<?php the_excerpt(); ?>
|
||||
<?php wp_link_pages( Array(
|
||||
'before' => '<p class="panel post-nav-links"><span class="post-nav-links-indicator">' . __('Pages: ', 'minimalistflex') . '</span>'
|
||||
) ); ?>
|
||||
</div>
|
||||
<div class="panel-meta">
|
||||
<?php if ( get_theme_mod( 'minimalistflex_interface_publisher', 'yes' ) == 'yes' ): ?>
|
||||
<a class="panel-author" href="<?php echo esc_attr( get_author_posts_url($id) ) ?>">
|
||||
<span aria-hidden="true"><?php echo get_avatar( $id, 80 ) ?></span>
|
||||
<?php the_author() ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php $datemode = get_theme_mod( 'minimalistflex_interface_date', 'modify' ); ?>
|
||||
<?php if ( $datemode <> 'no' ): ?>
|
||||
<div class="panel-author">
|
||||
<?php if ( $datemode == 'publish' || get_the_modified_date() <> get_the_date() ): ?>
|
||||
<?php printf(
|
||||
/* translators: %s: Post publish time. */
|
||||
__( 'Published on %s', 'minimalistflex' ),
|
||||
get_the_date()
|
||||
) ?>
|
||||
<?php else: ?>
|
||||
<?php printf(
|
||||
/* translators: %s: Post last modified time. */
|
||||
__( 'Last modified on %s', 'minimalistflex' ),
|
||||
get_the_modified_date()
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a class="panel panel-link" href="<?php the_permalink(); ?>">
|
||||
<span aria-hidden="true">
|
||||
<?php echo esc_html( get_theme_mod( 'minimalistflex_interface_readlink', __( 'Read More', 'minimalistflex' ) ) ); ?>
|
||||
</span>
|
||||
<span class="screen-reader-text">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: Post title. */
|
||||
__( 'Read more of %s', 'minimalistflex' ),
|
||||
get_the_title()
|
||||
) ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
38
templates/metadata.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="singular-meta">
|
||||
<?php $tags = get_the_category(); ?>
|
||||
<?php if( $tags ): ?>
|
||||
<div class="singular-categories">
|
||||
<div class="categories-indicator">
|
||||
<?php esc_html_e( 'Categories:', 'minimalistflex' ) ?>
|
||||
</div>
|
||||
<?php foreach( $tags as $tag ) { ?>
|
||||
<div class="singular-category">
|
||||
<a href="<?php echo esc_attr( get_category_link( $tag ) ) ?>">
|
||||
<?php echo $tag->name; ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $tags = get_the_tags(); ?>
|
||||
<?php if( $tags ): ?>
|
||||
<div class="singular-categories singular-tags">
|
||||
<div class="categories-indicator tags-indicator">
|
||||
<?php esc_html_e( 'Tags:', 'minimalistflex' ) ?>
|
||||
</div>
|
||||
<?php foreach( $tags as $tag ) { ?>
|
||||
<div class="singular-category singular-tag">
|
||||
<a href="<?php echo esc_attr( get_tag_link( $tag ) ) ?>">
|
||||
<?php echo $tag->name; ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
32
templates/publisher.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if ( !defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="publisher">
|
||||
|
||||
<a class="publisher-link" href="<?php echo esc_attr( get_author_posts_url($id) ) ?>">
|
||||
<?php echo get_avatar( $id, 32 ) ?>
|
||||
<span><?php the_author() ?></span>
|
||||
</a>
|
||||
<div class="publisher-datetime">
|
||||
<?php $datemode = get_theme_mod( 'minimalistflex_interface_date', 'modify' ); ?>
|
||||
<?php if ( $datemode <> 'no' ): ?>
|
||||
<?php if ( $datemode == 'publish' || get_the_modified_date() <> get_the_date() ): ?>
|
||||
<?php printf(
|
||||
/* translators: %s: Post publish time. */
|
||||
__( 'Published on %s', 'minimalistflex' ),
|
||||
get_the_date()
|
||||
) ?>
|
||||
<?php else: ?>
|
||||
<?php printf(
|
||||
/* translators: %s: Post last modified time. */
|
||||
__( 'Last modified on %s', 'minimalistflex' ),
|
||||
get_the_modified_date()
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
60
theme.json
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/theme.json",
|
||||
"version": 2,
|
||||
"settings": {
|
||||
"color": {
|
||||
"palette": [
|
||||
{
|
||||
"color": "#00aaff",
|
||||
"name": "Crystal Primary",
|
||||
"slug": "crystal-primary"
|
||||
},
|
||||
{
|
||||
"color": "#666666",
|
||||
"name": "Crystal Secondary",
|
||||
"slug": "crystal-secondary"
|
||||
},
|
||||
{
|
||||
"color": "#00dc37",
|
||||
"name": "Crystal Success",
|
||||
"slug": "crystal-success"
|
||||
},
|
||||
{
|
||||
"color": "#ebb400",
|
||||
"name": "Crystal Warning",
|
||||
"slug": "crystal-warning"
|
||||
},
|
||||
{
|
||||
"color": "#ff5500",
|
||||
"name": "Crystal Danger",
|
||||
"slug": "crystal-danger"
|
||||
},
|
||||
{
|
||||
"color": "#ffd900",
|
||||
"name": "Crystal Tint",
|
||||
"slug": "crystal-tint"
|
||||
},
|
||||
{
|
||||
"color": "#5b9cff",
|
||||
"name": "Crystal Tint Alt",
|
||||
"slug": "crystal-tint-alt"
|
||||
},
|
||||
{
|
||||
"color": "#000000",
|
||||
"name": "Crystal Default",
|
||||
"slug": "crystal-default"
|
||||
},
|
||||
{
|
||||
"color": "#333333",
|
||||
"name": "Crystal Dark Background",
|
||||
"slug": "crystal-dark-bg"
|
||||
},
|
||||
{
|
||||
"color": "#ffffff",
|
||||
"name": "Crystal White",
|
||||
"slug": "crystal-white"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||