init commit

This commit is contained in:
Sophia Atkinson 2023-07-04 11:21:47 -07:00
commit ce48e96737
105 changed files with 28651 additions and 0 deletions

64
404.php Normal file
View File

@ -0,0 +1,64 @@
<?php
/**
* The template for displaying 404 pages (not found)
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Pag
*
* @package Sophia After Dark
* @since 1.0.0
*/
get_header();
$sophia_after_dark_pnf_latest_posts = get_theme_mod( 'sophia_after_dark_enable_pnf_latest_posts', true );
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<section class="error-404 not-found">
<div class="error-num"><span><?php esc_html_e( 'Error', 'sophia-after-dark' );?>&nbsp;</span><?php esc_html_e( '404', 'sophia-after-dark' ); ?></div>
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'sophia-after-dark' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'sophia-after-dark' ); ?></p>
</section><!-- .error-404 -->
<?php if ( true === $sophia_after_dark_pnf_latest_posts ) { ?>
<div class="page-extra-content mt-404-latest-posts-wrapper">
<?php
$sophia_after_dark_pnf_latest_post_count = get_theme_mod( 'sophia_after_dark_pnf_latest_post_count', 3 );
$sophia_after_dark_pnf_args = array(
'post_type' => 'post',
'posts_per_page' => absint( $sophia_after_dark_pnf_latest_post_count ),
'ignore_sticky_posts' => 1,
);
$sophia_after_dark_pnf_query = new WP_Query( $sophia_after_dark_pnf_args );
if ( $sophia_after_dark_pnf_query->have_posts() ) {
echo '<div class="mt-pnf-latest-posts-wrapper mt-related-posts-wrapper">';
$sophia_after_dark_404_latest_title = get_theme_mod( 'sophia_after_dark_pnf_latest_title', __( 'You May Like' ,'sophia-after-dark' ) );
echo '<h2 class="section-title mt-related-post-title">'. esc_html( $sophia_after_dark_404_latest_title ) .'</h2>';
while ( $sophia_after_dark_pnf_query->have_posts() ) {
$sophia_after_dark_pnf_query->the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'related' );
}
echo '</div><!-- .mt-pnf-latest-posts-wrapper -->';
}
wp_reset_postdata();
?>
</div><!-- .page-extra-content -->
<?php } ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();

63
archive.php Normal file
View File

@ -0,0 +1,63 @@
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
get_header();
?>
<div class="mt-page-content-wrapper">
<div itemscope id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '<div class="archive-grid-post-wrapper">';
}
if ( have_posts() ) :
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
<div class="sophia-after-dark-content-masonry">
<div id="mt-masonry">
<?php
}
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_type() );
endwhile;
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
</div><!-- #mt-masonry -->
</div><!-- .sophia-after-dark-content-masonry -->
<?php
}
the_posts_pagination();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '</div><!-- .archive-grid-post-wrapper -->';
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .mt-page-content-wrapper -->
<?php
get_footer();

5
assets/css/jquery-ui.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,60 @@
.mt-meta-options-wrap .ui-button {
margin: 0;
border-radius: 0;
border: none;
background: 0 0;
height: auto;
box-shadow: none
}
.mt-meta-options-wrap .ui-button-text {
padding: 0
}
.mt-meta-options-wrap img {
box-sizing: border-box;
max-width: 100%;
height: auto;
padding: 1px;
border: 4px solid transparent
}
.mt-meta-options-wrap img:focus,
.mt-meta-options-wrap img:hover {
border-color: #ddd
}
.mt-meta-options-wrap .ui-state-active img {
border-color: #00a0d2
}
.mt-clearfix:after,
.mt-clearfix:before {
content: '';
display: table
}
.mt-clearfix:after {
clear: both
}
.widget-content .attachment-media-view {
font-size: 13px;
line-height: 1.5;
margin: 1em 0
}
.widget-content .placeholder {
width: 100%;
position: relative;
text-align: center;
cursor: default;
border: 1px dashed #b4b9be;
box-sizing: border-box;
padding: 9px 0;
line-height: 20px
}
.widget-content .actions {
margin-top: 8px
}

View File

@ -0,0 +1,391 @@
/**
* Customizer styles
*
*/
.customize-control-mt-toggle label {
display: flex;
flex-wrap: wrap;
}
.customize-control-mt-toggle label .customize-control-title {
width: calc(100% - 55px);
}
.customize-control-mt-toggle label .description {
order: 99;
}
.customize-control-mt-toggle input[type=checkbox] {
display: none;
}
.customize-control-mt-toggle .switch {
border: 1px solid rgba(0, 0, 0, .1);
display: inline-block;
width: 35px;
height: 12px;
border-radius: 8px;
background: #ccc;
vertical-align: middle;
position: relative;
cursor: pointer;
user-select: none;
transition: background 350ms ease;
}
.customize-control-mt-toggle .switch:after,
.customize-control-mt-toggle .switch:before {
content: "";
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
position: absolute;
top: 50%;
left: -3px;
transition: all 350ms cubic-bezier(0, .95, .38, .98), background 150ms ease;
}
.customize-control-mt-toggle .switch:before {
background: rgba(0, 0, 0, .2);
transform: translate3d(0, -50%, 0) scale(0);
}
.customize-control-mt-toggle .switch:after {
background: #999;
border: 1px solid rgba(0, 0, 0, .1);
transform: translate3d(0, -50%, 0);
}
.customize-control-mt-toggle .switch:active:before {
transform: translate3d(0, -50%, 0) scale(3);
}
.customize-control-mt-toggle input:checked+.switch {
background: rgba(52, 152, 222, .3);
}
.customize-control-mt-toggle input:checked+.switch:before {
background: rgba(52, 152, 222, .075);
transform: translate3d(100%, -50%, 0) scale(1);
}
.customize-control-mt-toggle input:checked+.switch:after {
background: #3498de;
transform: translate3d(100%, -50%, 0);
}
.customize-control-mt-toggle input:checked+.switch:active:before {
background: rgba(52, 152, 222, .075);
transform: translate3d(100%, -50%, 0) scale(3);
}
.customize-control-mt-radio-image>.image {
display: flex;
flex-wrap: wrap;
}
.customize-control-mt-radio-image label {
position: relative;
display: inline-block;
}
.customize-control-mt-radio-image label .image-label {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, .7);
font-weight: 700;
}
.customize-control-mt-radio-image label .image-label .inner {
width: 100%;
height: 100%;
text-align: center;
padding: .5em;
vertical-align: middle;
}
.customize-control-mt-radio-image label:hover .image-label {
display: block;
}
.customize-control-mt-radio-image input {
display: none;
}
.customize-control-mt-radio-image input img {
border: 1px solid transparent;
}
.customize-control-mt-radio-image input:checked+label img {
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
border: 1px solid #3498db;
}
.customize-control-mt-radio-image input+label .image-clickable {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
}
.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input {
display: none;
}
.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img {
border: 1px solid transparent;
}
.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked+label img {
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
border: 1px solid #3498db;
}
.customize-control-mt-radio-image input+label .image-clickable {
margin: 0;
border-radius: 0;
border: none;
background: 0 0;
}
.customize-control-mt-radio-image input+label .image-clickable,
.customize-control-mt-radio-image input:checked+label img {
box-sizing: border-box;
max-width: 100%;
height: auto;
padding: 2px;
border: 3px solid transparent;
}
.customize-control-mt-radio-image input+label .image-clickable:focus,
.customize-control-mt-radio-image input+label .image-clickable:hover {
border-color: #ddd;
}
.customize-control-mt-radio-image input:checked+label img {
border-color: #00a0d2;
display: block
}
.customize-control-mt-radio-image .image label {
margin-right: 10px;
}
.customize-control-mt-radio-image input:checked+label img {
box-shadow: none;
}
.customize-control-mt-radio-image>.image {
display: block;
}
.mt-clearfix:after,
.mt-clearfix:before {
content: "";
display: table;
}
.mt-clearfix:after {
clear: both;
}
.mt-repeater-field-control {
background: #fff;
margin-bottom: 12px;
display: block;
}
.mt-repeater-footer {
margin-top: 15px;
text-align: right;
}
.mt-repeater-field-control:first-child .mt-repeater-footer {
display: none;
}
.mt-repeater-field-title {
padding: 13px 15px;
line-height: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 0;
font-size: 1em;
border: 1px solid #e5e5e5;
cursor: move;
position: relative;
border-bottom: 0;
}
.mt-repeater-field-title:after {
content: "\f142";
font: 400 20px/1 dashicons;
position: absolute;
right: 0;
top: 0;
padding: 1px 2px 1px 0;
margin-top: 10px;
margin-right: 10px;
-webkit-border-radius: 50%;
border-radius: 50%;
cursor: pointer;
}
.mt-repeater-field-control.expanded .mt-repeater-field-title:after {
content: "\f140"
}
.mt-repeater-fields {
padding: 0 10px 10px;
border-top: none;
line-height: 16px;
border: 1px solid #e5e5e5;
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
display: none;
}
.mt-repeater-fields .customize-control-title {
margin-top: 10px
}
.mt-repeater-field-control.expanded .mt-repeater-fields {
display: block;
}
.mt-reapeater-add-control-field {
float: right;
}
.mt-reapeater-add-add-control-field:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 18px/1 dashicons;
vertical-align: middle;
}
.mt-repeater-type-icon {
overflow: hidden;
}
.mt-repeater-selected-icon {
background: #f6f6f6;
height: 45px;
line-height: 45px;
text-align: center;
border: 1px solid #eee;
position: relative;
margin-right: 45px;
cursor: pointer;
font-size: 28px;
}
.mt-repeater-selected-icon span {
position: absolute;
background: #f6f6f6;
right: -45px;
top: -1px;
height: 45px;
width: 45px;
border: 1px solid #eee;
font-size: 20px;
}
.mt-repeater-selected-icon i {
margin-top: 3%;
}
.mt-repeater-selected-icon span i {
margin-top: 24%;
}
.mt-repeater-icon-list {
height: 215px;
overflow-y: scroll;
font-size: 18px;
border: 1px solid #eee;
border-right: 0;
border-top: 0;
padding-bottom: 4%;
display: none;
cursor: pointer;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.mt-repeater-icon-list li {
float: left;
margin: 4% 3% 0;
height: 40px;
width: 16%;
text-align: center;
line-height: 40px;
border: 1px solid #eee;
}
.mt-repeater-icon-list li:hover {
background: #333;
border: 1px solid #333;
color: #fff;
}
.mt-repeater-icon-list li.icon-active {
background: #0073aa;
border: 1px solid #0073aa;
color: #fff;
}
.customize-control-mt-repeater .mt-limit-msg {
display: none;
}
.customize-control-mt-repeater span.mt-limit-msg:nth-of-type(2) {
display: block;
background: #fff;
padding: 10px 15px;
margin: 10px 0 10px;
border-left: 3px solid #ffb900;
}
.customize-control textarea {
width: 100%;
}
/**---------------------------------------------
Upsell section
---------------------------------------------*/
#customize-controls .control-section-mt-upsell .accordion-section-title:hover,
#customize-controls .control-section-mt-upsell .accordion-section-title:focus {
background-color: #fff;
}
.control-section-mt-upsell .accordion-section-title .button {
margin-top: -4px;
font-weight: 700;
margin-left: 8px;
background: #00d2ff;
background: -webkit-linear-gradient(to right, #3a7bd5, #00d2ff);
background: linear-gradient(to right, #3a7bd5, #00d2ff);
color: #fff;
border:none;
}
.control-section-mt-upsell .accordion-section-title .button:hover {
background: #1FA3E8;
background:linear-gradient(#1FA3E8,#1FA3E8);
}

View File

@ -0,0 +1,558 @@
body {
color: #363b40
}
body,
button,
input,
select,
textarea {
font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif;
font-size: 16px;
font-size: 1rem;
font-weight: 400;
line-height: 1.66
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: Catamaran, helvetica, arial, sans-serif;
color: #16181a;
font-weight: 700;
clear: both;
line-height: 1.4;
margin: 0 0 .75em;
padding: 1.5em 0 0
}
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
padding-top: 0
}
h1 {
font-size: 24px;
font-size: 1.5rem;
font-weight: 300
}
h2 {
color: #666;
font-size: 20px;
font-size: 1.25rem;
font-weight: 300
}
h3 {
color: #333;
font-size: 18px;
font-size: 1.125rem;
font-weight: 300
}
h4 {
color: #333;
font-size: 16px;
font-size: 1rem;
font-weight: 800
}
h5 {
color: #767676;
font-size: 13px;
font-size: .8125rem;
font-weight: 800;
letter-spacing: .15em;
text-transform: uppercase
}
h6 {
color: #333;
font-size: 15px;
font-size: .9375rem;
font-weight: 800
}
p {
margin: 0 0 1.5em;
padding: 0
}
cite,
dfn,
em,
i {
font-style: italic
}
blockquote {
color: #666;
font-size: 18px;
font-size: 1.125rem;
font-style: italic;
line-height: 1.7;
margin: 0;
overflow: hidden;
padding: 20px 40px;
background: #fff9f5;
text-align: center
}
blockquote.alignleft,
blockquote.alignright {
font-size: 14px;
font-size: .875rem;
width: 34%
}
blockquote cite {
position: relative;
display: inline-block;
padding: 0 20px;
font-size: 14px;
margin-top: 20px
}
blockquote cite::before {
content: "";
background-color: #363b40;
width: 10px;
height: 1px;
display: block;
position: absolute;
top: 10px;
left: 0
}
address {
margin: 0 0 1.5em
}
pre {
background: #eee;
font-family: "Courier 10 Pitch", Courier, monospace;
font-size: 15px;
font-size: .9375rem;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1.6em
}
code,
kbd,
tt,
var {
font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
font-size: 15px;
font-size: .9375rem
}
abbr,
acronym {
border-bottom: 1px dotted #666;
cursor: help
}
ins,
mark {
background: #eee;
text-decoration: none
}
big {
font-size: 125%
}
blockquote,
q {
quotes: """"
}
blockquote:after,
blockquote:before,
q:after,
q:before {
content: ""
}
html[lang=th] h1,
html[lang=th] h2,
html[lang=th] h3,
html[lang=th] h4,
html[lang=th] h5,
html[lang=th] h6 {
letter-spacing: 0;
line-height: 1.65
}
html[lang=th] body,
html[lang=th] button,
html[lang=th] input,
html[lang=th] select,
html[lang=th] textarea {
line-height: 1.8
}
hr {
background-color: #bbb;
border: 0;
height: 1px;
margin-bottom: 1.5em
}
ol,
ul {
margin: 0 0 1.5em;
padding: 0
}
ul {
list-style: disc
}
ol {
counter-reset: item
}
ol li {
display: block;
position: relative
}
ol li:before {
content: counter(item);
counter-increment: item;
font-weight: 800;
left: -1.5em;
position: absolute
}
li>ol,
li>ul {
margin-bottom: 0;
margin-left: 1.5em
}
dt {
font-weight: 700
}
dd {
margin: 0 1.5em 1.5em
}
table {
border-collapse: collapse;
margin: 0 0 1.5em;
width: 100%
}
thead th {
border-bottom: 2px solid #bbb;
padding-bottom: .5em
}
th {
padding: .4em;
text-align: left
}
tr {
border-bottom: 1px solid #eee
}
td {
padding: .4em
}
td:first-child,
th:first-child {
padding-left: 0
}
td:last-child,
th:last-child {
padding-right: 0
}
a {
-webkit-box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1);
box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1);
color: #222;
text-decoration: none;
-webkit-transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out;
transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out;
transition: color 80ms ease-in, box-shadow 130ms ease-in-out;
transition: color 80ms ease-in, box-shadow 130ms ease-in-out, -webkit-box-shadow 130ms ease-in-out
}
a:focus {
outline: thin dotted
}
a:focus,
a:hover {
color: #000;
-webkit-box-shadow: inset 0 0 0 transparent, 0 3px 0 rgba(0, 0, 0, 1);
box-shadow: inset 0 0 0 transparent, 0 3px 0 rgba(0, 0, 0, 1)
}
a img {
background: #fff;
-webkit-box-shadow: 0 0 0 6px #fff;
box-shadow: 0 0 0 6px #fff
}
img {
height: auto;
width: inherit;
max-width: 100%
}
embed,
iframe,
object {
margin-bottom: 1.5em;
max-width: 100%
}
.wp-caption {
color: #666;
font-size: 13px;
font-size: .8125rem;
font-style: italic;
margin-bottom: 1.5em;
max-width: 100%
}
.wp-caption img[class*=wp-image-] {
display: block;
margin-left: auto;
margin-right: auto
}
.wp-caption .wp-caption-text {
margin: .8075em 0
}
.gallery {
margin-bottom: 1.5em
}
.gallery-item {
display: inline-block;
text-align: center;
vertical-align: top;
width: 100%
}
.gallery-item a,
.gallery-item a:focus,
.gallery-item a:hover {
-webkit-box-shadow: none;
box-shadow: none;
background: 0 0;
display: inline-block
}
.gallery-columns-2 .gallery-item {
max-width: 50%
}
.gallery-columns-3 .gallery-item {
max-width: 33.33%
}
.gallery-columns-4 .gallery-item {
max-width: 25%
}
.gallery-columns-5 .gallery-item {
max-width: 20%
}
.gallery-columns-6 .gallery-item {
max-width: 16.66%
}
.gallery-columns-7 .gallery-item {
max-width: 14.28%
}
.gallery-columns-8 .gallery-item {
max-width: 12.5%
}
.gallery-columns-9 .gallery-item {
max-width: 11.11%
}
.gallery-caption {
display: block
}
.mejs-container {
margin-bottom: 1.5em
}
.mejs-controls a.mejs-horizontal-volume-slider,
.mejs-controls a.mejs-horizontal-volume-slider:focus,
.mejs-controls a.mejs-horizontal-volume-slider:hover {
background: 0 0;
border: 0
}
.wp-playlist-light {
border-color: #eee;
color: #222
}
.wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album {
color: #333
}
.wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist {
color: #767676
}
.wp-playlist-light .wp-playlist-item {
border-bottom: 1px dotted #eee;
-webkit-transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .3s ease-in-out;
transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .3s ease-in-out
}
.wp-playlist-light .wp-playlist-item:focus,
.wp-playlist-light .wp-playlist-item:hover {
border-bottom-color: transparent;
background-color: #767676;
color: #fff
}
.wp-playlist-light .wp-playlist-item:focus a,
.wp-playlist-light .wp-playlist-item:hover a,
.wp-playlist-light a.wp-playlist-caption:hover {
color: #fff
}
.wp-playlist-dark {
background: #222;
border-color: #333
}
.wp-playlist-dark .mejs-container .mejs-controls {
background-color: #333
}
.wp-playlist-dark .wp-playlist-caption {
color: #fff
}
.wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-album {
color: #eee
}
.wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-artist {
color: #aaa
}
.wp-playlist-dark .wp-playlist-playing {
background-color: #333
}
.wp-playlist-dark .wp-playlist-item {
border-bottom: 1px dotted #555;
-webkit-transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .3s ease-in-out;
transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .3s ease-in-out
}
.wp-playlist-dark .wp-playlist-item:focus,
.wp-playlist-dark .wp-playlist-item:hover {
border-bottom-color: transparent;
background-color: #aaa;
color: #222
}
.wp-playlist-dark .wp-playlist-item:focus a,
.wp-playlist-dark .wp-playlist-item:hover a,
.wp-playlist-dark a.wp-playlist-caption:hover {
color: #222
}
.wp-playlist {
padding: .625em .625em .3125em
}
.wp-playlist-current-item .wp-playlist-item-title {
font-weight: 700
}
.wp-playlist-current-item .wp-playlist-item-album {
font-style: normal
}
.wp-playlist-current-item .wp-playlist-item-artist {
font-size: 10px;
font-size: .625rem;
font-weight: 800;
letter-spacing: .1818em;
text-transform: uppercase
}
.wp-playlist-item {
padding: 0 .3125em;
cursor: pointer
}
.wp-playlist-item:last-of-type {
border-bottom: none
}
.wp-playlist-item a {
padding: .3125em 0;
border-bottom: none
}
.wp-playlist-item a,
.wp-playlist-item a:focus,
.wp-playlist-item a:hover {
-webkit-box-shadow: none;
box-shadow: none;
background: 0 0
}
.wp-playlist-item-length {
top: 5px
}
.rtl th {
text-align: right
}
.rtl ol {
counter-reset: item
}
.rtl ol li:before {
left: auto;
right: -1.5em
}
.rtl li>ol,
.rtl li>ul {
margin-left: 0;
margin-right: 1.5em
}
.rtl .mejs-offscreen {
right: -10000px
}

View File

@ -0,0 +1,56 @@
#preloader-background {
background: #fff none repeat scroll 0 0;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 99999
}
#preloader-background .preloader-wrapper {
left: 50%;
position: absolute;
top: 50%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%)
}
.sk-spinner-pulse {
width: 40px;
height: 40px;
margin: 40px auto;
background-color: #333;
border-radius: 100%;
-webkit-animation: sk-pulseScaleOut 1s infinite ease-in-out;
animation: sk-pulseScaleOut 1s infinite ease-in-out
}
@-webkit-keyframes sk-pulseScaleOut {
0% {
-webkit-transform: scale(0);
transform: scale(0)
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0
}
}
@keyframes sk-pulseScaleOut {
0% {
-webkit-transform: scale(0);
transform: scale(0)
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0
}
}

View File

@ -0,0 +1,722 @@
@media (max-width:1400px) {
.mt-container,
.site-layout--boxed #page {
width: 1200px
}
.top-featured-post-wrap .entry-header .entry-title {
font-size: 16px
}
.entry-title {
font-size: 18px
}
#colophon .widget .widget-title,
#secondary .widget .widget-title,
.mt-related-post-title {
font-size: 17px
}
.single article .post-thumbnail {
margin-bottom: 0
}
.single .mt-related-posts-wrapper .entry-title {
font-size: 19px
}
.mt-form-close {
font-size: 50px
}
}
@media (max-width:1200px) {
.mt-container,
.site-layout--boxed #page {
width: auto;
margin: 0 2%
}
.site-layout--boxed .mt-container {
padding: 0 10px
}
#top-header {
position: relative
}
.mt-follow-title {
display: none
}
.tags-wrapper {
margin: 0;
background: #212121;
opacity: 0;
position: absolute;
visibility: hidden;
top: 50%;
left: 0;
padding: 4px;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-transition: all .8s;
-o-transition: all .8s;
transition: all .8s;
width: 100%
}
.trending-wrapper:hover .tags-wrapper {
opacity: 1;
visibility: visible;
left: 30%
}
.top-featured-post-wrap .post-thumbnail .post-number {
width: 20px;
height: 20px;
line-height: 21px;
font-size: 12px
}
.top-featured-post-wrap .post-thumbnail {
width: 30%
}
.top-featured-post-wrap .mt-post-content {
width: 66%
}
.top-featured-post-wrap .entry-header .entry-title {
font-size: 14px
}
.posted-on a::before {
width: 18px;
right: -24px
}
.posted-on a {
margin-right: 28px
}
#mt-scrollup {
right: 10px
}
#colophon .widget .widget-title,
#secondary .widget .widget-title,
.mt-related-post-title {
font-size: 14px
}
#colophon .widget .widget-title::before,
#secondary .widget .widget-title::before,
.features-post-title::before,
.mt-related-post-title::before {
height: 2px;
top: 7px
}
.custom-header .entry-title,
.custom-header .page-title {
font-size: 32px
}
.single .entry-title {
font-size: 25px
}
.single.post-cat,
.single.post-cats-list {
margin-bottom: 0
}
.mt-menu-search .mt-form-wrap .search-form .search-field {
height: 54px;
font-size: 20px
}
.error-num {
font-size: 70px;
line-height: 90px
}
.error-num span {
font-size: 36px
}
h1 {
font-size: 28px
}
#footer-menu li a {
padding: 0 10px
}
.widget {
padding: 14px
}
.custom-header {
padding: 54px 0
}
}
@media (max-width:979px) {
.top-header-nav {
float: none;
display: block;
text-align: center
}
.site-branding {
float: none;
text-align: center;
display: block;
margin-bottom: 20px;
margin-top: 0
}
.logo-ads-wrap {
padding: 20px 0 30px
}
.menu-toggle {
display: block
}
.mt-social-menu-wrapper {
position: relative
}
.header-widget-wrapper {
text-align: center;
float: none
}
#site-navigation {
display: none;
position: absolute;
top: 90%;
left: 0;
width: 100%;
background: #0B0B0B;
float: none;
z-index: 9999
}
#site-navigation .mt-container {
border: none;
padding: 0
}
#site-navigation ul {
display: block
}
#masthead #site-navigation ul li {
border-bottom: none;
display: block
}
#site-navigation ul#primary-menu>li.menu-item-has-children>a,
#site-navigation #primary-menu ul>li.page_item_has_children>a {
padding-right: 0;
}
#site-navigation ul li .sub-menu li a,
#site-navigation ul li .children li a {
padding: 10px 0;
}
.trending-wrapper .wrap-label {
width: 100%;
text-align: center;
float: none;
margin: 0;
}
#site-navigation ul li a,
.is-sticky #site-navigation ul li a {
line-height: 44px;
padding: 0;
border-bottom: 1px solid rgba(255,255,255,0.3);
}
#site-navigation ul li a::after {
display: none
}
#site-navigation ul li .children,
#site-navigation ul li .sub-menu {
position: static;
min-width: 100%;
opacity: 1;
top: 0;
left: 0;
visibility: visible;
display: none;
background: 0 0;
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
box-shadow: none;
transform: scaley(1);
-webkit-transform: scaley(1);
-ms-transform: scaley(1);
transform-origin: 0 0;
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0
}
#site-navigation ul>li:hover>.children,
#site-navigation ul>li:hover>.sub-menu {
top: 0
}
#site-navigation ul li a.sub-toggle,
#site-navigation ul li a.sub-toggle:hover {
background: #fff none repeat scroll 0 0;
color: #333;
cursor: pointer;
display: block !important;
height: 24px;
line-height: 25px;
position: absolute !important;
right: 15px;
text-align: center;
top: 12px;
width: 24px;
padding: 0 !important;
}
#site-navigation ul li .sub-menu li a.sub-toggle,
#site-navigation ul li .children li a.sub-toggle {
padding: 0;
line-height: 25px;
}
#site-navigation ul>li.current-menu-ancestor .sub-toggle,
#site-navigation ul>li.current-menu-item .sub-toggle,
#site-navigation ul>li:hover>.sub-toggle {
background: #666
}
#site-navigation li.current-menu-item>.sub-toggle {
background: #fff none repeat scroll 0 0
}
#site-navigation li.current-menu-item>.sub-toggle i {
color: #d40234
}
#site-navigation li.menu-item-has-children>a::after,
#site-navigation li.page_item_has_children>a::after {
display: none
}
#site-navigation ul.children li,
#site-navigation ul.sub-menu li {
text-align: center
}
#site-navigation .menu-item-description,
#site-navigation .menu-item-description::after,
#site-navigation li.menu-item-has-children>a::before,
#site-navigation li.page_item_has_children>a::before {
display: none
}
.mt-archive--block-grid-style article,
.mt-archive--masonry-style #mt-masonry article {
width: 97%
}
.no-sidebar.mt-archive--block-grid-style article,
.no-sidebar.mt-archive--masonry-style #mt-masonry article {
width: 47%
}
#bottom-footer {
font-size: 12px;
text-align: center
}
#footer-navigation {
float: none;
width: 100%;
display: block;
text-align: center
}
.navigation.pagination .nav-links .page-numbers.current,
.navigation.pagination .nav-links a.page-numbers,
.navigation.pagination .nav-links a.page-numbers:hover {
padding: 8px 12px
}
.bttn,
.navigation .nav-links a,
button,
input[type=button],
input[type=reset],
input[type=submit] {
padding: 10px;
font-size: 12px
}
.mt-author-bio {
font-size: 13px
}
.single .mt-related-posts-wrapper .entry-title {
font-size: 15px
}
input[type=email],
input[type=password],
input[type=search],
input[type=text],
input[type=url] {
height: 28px
}
#respond,
.widget_archive a,
.widget_categories a,
.widget_meta a,
.widget_nav_menu li a,
.widget_pages li a,
.widget_recent_comments li,
.widget_recent_entries a,
.widget_rss li {
font-size: 13px
}
.error-404.not-found {
width: 80%
}
.entry-content {
font-size: 13px
}
.entry-meta a {
font-size: 12px
}
.posted-on a::before {
width: 14px;
right: -20px;
top: 8px
}
}
@media (max-width:839px) {
.front-slider-block,
.top-featured-post-main-wrapper {
width: 100%;
float: none
}
.front-slider-wrapper {
margin: 0 0 40px 0
}
.front-slider-block {
width: 100%;
float: none;
margin-bottom: 40px
}
.top-featured-post-wrap {
overflow: auto;
margin-right: -3%
}
.top-featured-post-wrap .mt-single-post-wrap {
width: 47%;
float: left;
margin-bottom: 3%;
margin-right: 3%
}
#top-footer.footer-column-four .mt-footer-widget {
width: 47%
}
}
@media (max-width:768px) {
.entry-meta {
line-height: 1.5
}
.entry-meta a {
font-size: 12px
}
.entry-header {
margin-top: 5px
}
.posted-on a::before {
width: 11px;
right: -16px
}
.posted-on a {
margin-right: 16px
}
#primary,
#secondary,
.home.blog #primary,
.home.blog #secondary {
width: 100%
}
.right-sidebar #primary .thumb-cat-wrap .wp-post-image {
width: 100%
}
.mt-menu-search .mt-form-wrap .search-form .search-submit {
padding: 16px 46px
}
.mt-menu-search .mt-form-wrap .search-form .search-field {
height: 48px;
font-size: 18px
}
.mt-form-close {
font-size: 40px
}
.trending-wrapper {
width: 100%;
position: relative;
margin-bottom: 10px
}
.error-num {
font-size: 50px;
line-height: 70px
}
.error-num span {
font-size: 30px
}
h1 {
font-size: 20px
}
.error404 h1 {
font-size: 20px
}
.error404 .page-content {
font-size: 12px
}
.error404 #primary {
padding: 20px 0
}
.slider-post-wrap {
height: 450px
}
.mt-live-link {
float: none;
margin: 0 auto;
display: block;
text-align: center;
}
}
@media (max-width:600px) {
.logged-in #page {
padding-top: 40px;
}
body.logged-in {
margin-top: -50px;
}
.logged-in .is-sticky .mt-social-menu-wrapper {
top: 0 !important;
}
.top-featured-post-wrap {
margin-right: 0
}
.top-featured-post-wrap .mt-single-post-wrap {
width: 100%;
margin-right: 0
}
.archive-grid-post-wrapper,
.mt-archive--masonry-style .sophia-after-dark-content-masonry {
margin-left: 0
}
.mt-archive--block-grid-style article,
.mt-archive--masonry-style #mt-masonry article,
.no-sidebar.mt-archive--block-grid-style article,
.no-sidebar.mt-archive--masonry-style #mt-masonry article {
width: 100%;
margin-left: 0
}
.single .entry-title {
font-size: 18px
}
.breadcrumbs .trail-items {
font-size: 12px
}
.custom-header {
padding: 28px 0
}
.mt-related-posts-wrapper {
margin-left: 0
}
.mt-related-posts-wrapper article {
margin-left: 0;
margin-right: 0;
width: 100%
}
.mt-related-posts-wrapper .post-cats-list a {
margin-top: 10px
}
.head-tags-links a {
display: block
}
.tags-wrapper {
position: static;
opacity: 1;
visibility: visible;
text-align: center;
width: 100%;
padding: 0;
transform: translate(0);
}
.tags-wrapper a {
display: inline-block;
padding: 10px 0 5px;
}
blockquote {
font-size: 14px
}
.custom-header .entry-title,
.custom-header .page-title {
font-size: 28px
}
#top-footer.footer-column-three .mt-footer-widget {
width: 97%
}
}
@media (max-width:480px) {
.mt-social-icon-wrap li {
margin-right: 8px
}
.menu-toggle {
padding: 9px 0
}
.single .post-info-wrap {
margin-top: 10px
}
.mt-social-wrapper {
margin: 12px 0 12px
}
.mt-search-icon {
font-size: 14px;
margin: 12px 0 12px 8px
}
.single .post-cat,
.single .post-cats-list {
margin-bottom: 0
}
.single .mt-author-box .mt-author-info .mt-author-name {
font-size: 18px
}
.mt-author-bio {
font-size: 12px
}
.mt-author-meta {
font-size: 13px
}
.comment-form-cookies-consent label {
margin-left: 0
}
.custom-header .entry-title,
.custom-header .page-title {
font-size: 18px
}
p {
font-size: 13px
}
.search-no-results #primary .search-submit {
margin-top: 18px;
font-size: 18px
}
.error404 #primary {
padding: 0
}
.error-404.not-found {
width: 100%;
padding: 18px 0 18px 0
}
.error404 .page-title {
font-size: 16px
}
.slider-post-wrap {
height: 360px
}
.front-slider-block .post-info-wrap .entry-title {
font-size: 20px
}
#top-footer.footer-column-four .mt-footer-widget,
#top-footer.footer-column-two .mt-footer-widget {
width: 97%
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/images/footer-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

BIN
assets/images/footer-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

BIN
assets/images/footer-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

BIN
assets/images/footer-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

42
assets/js/customizer.js Normal file
View File

@ -0,0 +1,42 @@
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'position': 'relative'
} );
$( '.site-title a, .site-description' ).css( {
'color': to
} );
}
} );
} );
} )( jQuery );

View File

@ -0,0 +1,73 @@
/**
* Image up-loader functions
*/
var mtSelector;
function upload_media_image(mtSelector){
// ADD IMAGE LINK
jQuery('body').on( 'click', mtSelector , function( event ){
event.preventDefault();
var imgContainer = jQuery(this).closest('.attachment-media-view').find( '.thumbnail-image'),
placeholder = jQuery(this).closest('.attachment-media-view').find( '.placeholder'),
imgIdInput = jQuery(this).siblings('.upload-id');
// Create a new media frame
frame = wp.media({
title: 'Select or Upload Image',
button: {
text: 'Use Image'
},
multiple: false // Set to true to allow multiple files to be selected
});
// When an image is selected in the media frame...
frame.on( 'select', function() {
// Get media attachment details from the frame state
var attachment = frame.state().get('selection').first().toJSON();
// Send the attachment URL to our custom image input field.
imgContainer.html( '<img src="'+attachment.url+'" style="max-width:100%;"/>' );
placeholder.addClass('hidden');
imgIdInput.val( attachment.url ).trigger('change');
});
// Finally, open the modal on click
frame.open();
});
}
function delete_media_image(mtSelector){
// DELETE IMAGE LINK
jQuery('body').on( 'click', mtSelector, function( event ){
event.preventDefault();
var imgContainer = jQuery(this).closest('.attachment-media-view').find( '.thumbnail-image'),
placeholder = jQuery(this).closest('.attachment-media-view').find( '.placeholder'),
imgIdInput = jQuery(this).siblings('.upload-id');
// Clear out the preview image
imgContainer.find('img').remove();
placeholder.removeClass('hidden');
// Delete the image id from the hidden input
imgIdInput.val( '' ).trigger('change');
});
}
jQuery(document).ready(function($){
"use strict";
/**
* Radio Image control in metabox
*/
$( '.mt-meta-options-wrap .buttonset' ).buttonset();
/**
* Image up-loader
*/
upload_media_image('.mt-upload-button');
delete_media_image('.mt-delete-button');
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,199 @@
jQuery(document).ready(function($) {
"use strict";
/**
* Sophia After Dark Preloader
*/
if($('#preloader-background').length > 0) {
setTimeout(function(){$('#preloader-background').hide();}, 600);
}
var grid = document.querySelector(
'.sophia-after-dark-content-masonry'
),
masonry;
if (
grid &&
typeof Masonry !== undefined &&
typeof imagesLoaded !== undefined
) {
imagesLoaded( grid, function( instance ) {
masonry = new Masonry( grid, {
itemSelector: '.hentry'
} );
} );
}
/**
* Header Search script
*/
$('.mt-menu-search .mt-search-icon').click(function() {
$('.mt-form-wrap').toggleClass('search-activate');
$('.mt-form-wrap .search-field').focus();
var element = document.querySelector( '.mt-form-wrap.search-activate' );
if( element ) {
$(document).on('keydown', function(e) {
var focusable = element.querySelectorAll( 'input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
var firstFocusable = focusable[0];
var lastFocusable = focusable[focusable.length - 1];
sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e );
})
}
});
/**
* Focus trap in popup.
*/
var KEYCODE_TAB = 9;
function sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e ) {
if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) {
if ( e.shiftKey ) /* shift + tab */ {
if (document.activeElement === firstFocusable) {
lastFocusable.focus();
e.preventDefault();
}
} else /* tab */ {
if ( document.activeElement === lastFocusable ) {
firstFocusable.focus();
e.preventDefault();
}
}
}
}
$('.mt-form-wrap .mt-form-close').click(function() {
$('.mt-form-wrap').toggleClass('search-activate');
$(this).parents('.mt-menu-search').find('.mt-search-icon a').focus();
});
/**
* Close popups on escape key.
*/
$( document ).on( 'keydown', function( event ) {
if ( event.keyCode === 27 ) {
event.preventDefault();
//$( '.primary-menu-wrap' ).removeClass( 'menu-active' );
$( '.mt-menu-search .mt-form-wrap' ).removeClass( 'search-activate' );
}
});
/**
* Settings about WOW animation
*/
var wowOption = sophia_after_darkObject.wow_effect;
if( wowOption === 'on' ) {
new WOW().init();
}
/**
* Settings about sticky menu
*/
var stickyOption = sophia_after_darkObject.menu_sticky;
if( stickyOption === 'on' ) {
var windowWidth = $( window ).width();
if( windowWidth < 500 ) {
var wpAdminBar = 0;
} else {
var wpAdminBar = $('#wpadminbar');
}
if ( wpAdminBar.length ) {
$(".mt-social-menu-wrapper").sticky({topSpacing:wpAdminBar.height()});
} else {
$(".mt-social-menu-wrapper").sticky({topSpacing:0});
}
}
/**
* Scroll To Top
*/
$(window).scroll(function() {
if ($(this).scrollTop() > 1000) {
$('#mt-scrollup').fadeIn('slow');
} else {
$('#mt-scrollup').fadeOut('slow');
}
});
$('#mt-scrollup').click(function() {
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
/**
* Slider scripts
*/
$('.front-slider').lightSlider({
pager: false,
auto: false,
loop: true,
item: 1,
controls: true,
slideMargin:0,
rtl:true,
nextHtml: '<span class="icon-prev"><i class="fa fa-angle-left"></i></span>',
prevHtml: '<span class="icon-next"><i class="fa fa-angle-right"></i></span>',
onSliderLoad: function() {
$('.front-slider').removeClass('cS-hidden');
}
});
/**
* Slider scripts
*/
$('.mt-gallery-slider').lightSlider({
pager: false,
auto: false,
loop: true,
item: 1,
controls: true,
});
/**
* Responsive menu
*/
$('.mt-social-menu-wrapper .menu-toggle').click(function(event) {
$('.mt-social-menu-wrapper #site-navigation').toggleClass( 'isActive' ).slideToggle('slow');
var element = document.querySelector( '.mt-header-menu-wrap' );
if( element ) {
$(document).on('keydown', function(e) {
if( element.querySelectorAll( '.mt-social-menu-wrapper #site-navigation.isActive' ).length === 1 ) {
var focusable = element.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
var firstFocusable = focusable[0];
var lastFocusable = focusable[focusable.length - 1];
sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e );
}
})
}
});
/**
* responsive sub menu toggle
*/
$('<a href="javascript:void(0);" class="sub-toggle"><i class="fa fa-angle-right"></i></a>').insertAfter('#site-navigation .menu-item-has-children>a, #site-navigation .page_item_has_children>a');
$('#site-navigation .sub-toggle').click(function() {
$(this).parent('.menu-item-has-children').children('ul.sub-menu').first().slideToggle('1000');
jQuery(this).parent('.page_item_has_children').children('ul.children').first().slideToggle('1000');
$(this).children('.fa-angle-right').first().toggleClass('fa-angle-down');
});
/**
* Slider Section dynamic height script
*/
$(window).on('load', function() {
if ($(window).width() > 839) {
$(".front-slider-wrapper").each(function() {
var imageHeight = $(this).height();
$(this).find(".slider-post-wrap").css('height', imageHeight);
$(this).find(".front-slider ").css('height', imageHeight);
});
}
});
});

View File

@ -0,0 +1,222 @@
( function( api ) {
api.sectionConstructor['mt-upsell'] = api.Section.extend( {
// No events for this type of section.
attachEvents: function () {},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
} );
} )( wp.customize );
wp.customize.controlConstructor['mt-toggle'] = wp.customize.Control.extend({
ready: function(){
'use strict';
var control = this,
checkboxValue = control.setting._value;
// Toggle checkbox
// Save the value
this.container.on( 'change', 'input', function() {
checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false;
control.setting.set( checkboxValue );
});
}
});
jQuery(document).ready(function($) {
"use strict";
/**
* Function for repeater field
*/
function sophia_after_dark_refresh_repeater_values(){
$(".mt-repeater-field-control-wrap").each(function(){
var values = [];
var $this = $(this);
$this.find(".mt-repeater-field-control").each(function(){
var valueToPush = {};
$(this).find('[data-name]').each(function(){
var dataName = $(this).attr('data-name');
var dataValue = $(this).val();
valueToPush[dataName] = dataValue;
});
values.push(valueToPush);
});
$this.next('.mt-repeater-collector').val(JSON.stringify(values)).trigger('change');
});
}
$('#customize-theme-controls').on('click','.mt-repeater-field-title',function(){
$(this).next().slideToggle();
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
});
$('#customize-theme-controls').on('click', '.mt-repeater-field-close', function(){
$(this).closest('.mt-repeater-fields').slideUp();;
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
});
$("body").on("click",'.mt-repeater-add-control-field', function(){
var fLimit = $(this).parent().find('.field-limit').val();
var fCount = $(this).parent().find('.field-count').val();
if( fCount < fLimit ) {
fCount++;
$(this).parent().find('.field-count').val(fCount);
} else {
$(this).before('<span class="mt-limit-msg"><em>Only '+fLimit+' repeater field will be permitted.</em></span>');
return;
}
var $this = $(this).parent();
if(typeof $this != 'undefined') {
var field = $this.find(".mt-repeater-field-control:first").clone();
if(typeof field != 'undefined'){
field.find("input[type='text'][data-name]").each(function(){
var defaultValue = $(this).attr('data-default');
$(this).val(defaultValue);
});
field.find("textarea[data-name]").each(function(){
var defaultValue = $(this).attr('data-default');
$(this).val(defaultValue);
});
field.find("select[data-name]").each(function(){
var defaultValue = $(this).attr('data-default');
$(this).val(defaultValue);
});
field.find(".attachment-media-view").each(function(){
var defaultValue = $(this).find('input[data-name]').attr('data-default');
$(this).find('input[data-name]').val(defaultValue);
if(defaultValue){
$(this).find(".thumbnail-image").html('<img src="'+defaultValue+'"/>').prev('.placeholder').addClass('hidden');
}else{
$(this).find(".thumbnail-image").html('').prev('.placeholder').removeClass('hidden');
}
});
field.find(".mt-repeater-icon-list").each(function(){
var defaultValue = $(this).next('input[data-name]').attr('data-default');
$(this).next('input[data-name]').val(defaultValue);
$(this).prev('.mt-repeater-selected-icon').children('i').attr('class','').addClass(defaultValue);
$(this).find('li').each(function(){
var icon_class = $(this).find('i').attr('class');
if(defaultValue == icon_class ){
$(this).addClass('icon-active');
}else{
$(this).removeClass('icon-active');
}
});
});
field.find('.mt-repeater-fields').show();
$this.find('.mt-repeater-field-control-wrap').append(field);
field.addClass('expanded').find('.mt-repeater-fields').show();
$('.accordion-section-content').animate({ scrollTop: $this.height() }, 1000);
sophia_after_dark_refresh_repeater_values();
}
}
return false;
});
$("#customize-theme-controls").on("click", ".mt-repeater-field-remove",function(){
if( typeof $(this).parent() != 'undefined'){
$(this).closest('.mt-repeater-field-control').slideUp('normal', function(){
$(this).remove();
sophia_after_dark_refresh_repeater_values();
});
}
return false;
});
$("#customize-theme-controls").on('keyup change', '[data-name]',function(){
sophia_after_dark_refresh_repeater_values();
return false;
});
/**
* Drag and drop to change order
*/
$(".mt-repeater-field-control-wrap").sortable({
orientation: "vertical",
update: function( event, ui ) {
sophia_after_dark_refresh_repeater_values();
}
});
/**
* Image upload
*/
var mtFrame;
//Add image
$('.customize-control-mt-repeater').on( 'click', '.mt-upload-button', function( event ){
event.preventDefault();
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
imgIdInput = $(this).siblings('.upload-id');
mtFrame = wp.media({
title: 'Select or Upload Image',
button: {
text: 'Use Image'
},
multiple: false // Set to true to allow multiple files to be selected
});
mtFrame.on( 'select', function() {
var attachment = frame.state().get('selection').first().toJSON();
imgContainer.html( '<img src="'+attachment.url+'" style="max-width:100%;"/>' );
placeholder.addClass('hidden');
imgIdInput.val( attachment.url ).trigger('change');
});
mtFrame.open();
});
// DELETE IMAGE LINK
$('.customize-control-mt-repeater').on( 'click', '.mt-delete-button', function( event ){
event.preventDefault();
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
imgIdInput = $(this).siblings('.upload-id');
imgContainer.find('img').remove();
placeholder.removeClass('hidden');
imgIdInput.val( '' ).trigger('change');
});
/**
* Repeater icon selector
*/
$('body').on('click', '.mt-repeater-icon-list li', function(){
var icon_class = $(this).find('i').attr('class');
$(this).addClass('icon-active').siblings().removeClass('icon-active');
$(this).parent('.mt-repeater-icon-list').prev('.mt-repeater-selected-icon').children('i').attr('class','').addClass(icon_class);
$(this).parent('.mt-repeater-icon-list').next('input').val(icon_class).trigger('change');
sophia_after_dark_refresh_repeater_values();
});
$('body').on('click', '.mt-repeater-selected-icon', function(){
$(this).next().slideToggle();
});
});

82
assets/js/navigation.js Normal file
View File

@ -0,0 +1,82 @@
/**
* File navigation.js.
*
* Handles toggling the navigation menu for small screens and enables TAB key
* navigation support for dropdown menus.
*/
( function() {
var container, button, menu, links, i, len;
container = document.getElementById( 'site-navigation' );
if ( ! container ) {
return;
}
menu = container.getElementsByTagName( 'ul' )[0];
menu.setAttribute( 'aria-expanded', 'false' );
if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
menu.className += ' nav-menu';
}
// Get all the link elements within the menu.
links = menu.getElementsByTagName( 'a' );
// Each time a menu link is focused or blurred, toggle focus.
for ( i = 0, len = links.length; i < len; i++ ) {
links[i].addEventListener( 'focus', toggleFocus, true );
links[i].addEventListener( 'blur', toggleFocus, true );
}
/**
* Sets or removes .focus class on an element.
*/
function toggleFocus() {
var self = this;
// Move up through the ancestors of the current link until we hit .nav-menu.
while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
// On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) {
if ( -1 !== self.className.indexOf( 'focus' ) ) {
self.className = self.className.replace( ' focus', '' );
} else {
self.className += ' focus';
}
}
self = self.parentElement;
}
}
/**
* Toggles `focus` class to allow submenu access on tablets.
*/
( function( container ) {
var touchStartFn, i,
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
if ( 'ontouchstart' in window ) {
touchStartFn = function( e ) {
var menuItem = this.parentNode, i;
if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault();
for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
if ( menuItem === menuItem.parentNode.children[i] ) {
continue;
}
menuItem.parentNode.children[i].classList.remove( 'focus' );
}
menuItem.classList.add( 'focus' );
} else {
menuItem.classList.remove( 'focus' );
}
};
for ( i = 0; i < parentLink.length; ++i ) {
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
}
}
}( container ) );
} )();

View File

@ -0,0 +1,31 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
} )();

View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2016 Daniel Eden
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3146
assets/library/animate/animate.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,496 @@
/*!
* imagesLoaded PACKAGED v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
/**
* EvEmitter v1.1.0
* Lil' event emitter
* MIT License
*/
/* jshint unused: true, undef: true, strict: true */
( function( global, factory ) {
// universal module definition
/* jshint strict: false */ /* globals define, module, window */
if ( typeof define == 'function' && define.amd ) {
// AMD - RequireJS
define( 'ev-emitter/ev-emitter',factory );
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS - Browserify, Webpack
module.exports = factory();
} else {
// Browser globals
global.EvEmitter = factory();
}
}( typeof window != 'undefined' ? window : this, function() {
function EvEmitter() {}
var proto = EvEmitter.prototype;
proto.on = function( eventName, listener ) {
if ( !eventName || !listener ) {
return;
}
// set events hash
var events = this._events = this._events || {};
// set listeners array
var listeners = events[ eventName ] = events[ eventName ] || [];
// only add once
if ( listeners.indexOf( listener ) == -1 ) {
listeners.push( listener );
}
return this;
};
proto.once = function( eventName, listener ) {
if ( !eventName || !listener ) {
return;
}
// add event
this.on( eventName, listener );
// set once flag
// set onceEvents hash
var onceEvents = this._onceEvents = this._onceEvents || {};
// set onceListeners object
var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
// set flag
onceListeners[ listener ] = true;
return this;
};
proto.off = function( eventName, listener ) {
var listeners = this._events && this._events[ eventName ];
if ( !listeners || !listeners.length ) {
return;
}
var index = listeners.indexOf( listener );
if ( index != -1 ) {
listeners.splice( index, 1 );
}
return this;
};
proto.emitEvent = function( eventName, args ) {
var listeners = this._events && this._events[ eventName ];
if ( !listeners || !listeners.length ) {
return;
}
// copy over to avoid interference if .off() in listener
listeners = listeners.slice(0);
args = args || [];
// once stuff
var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
for ( var i=0; i < listeners.length; i++ ) {
var listener = listeners[i]
var isOnce = onceListeners && onceListeners[ listener ];
if ( isOnce ) {
// remove listener
// remove before trigger to prevent recursion
this.off( eventName, listener );
// unset once flag
delete onceListeners[ listener ];
}
// trigger listener
listener.apply( this, args );
}
return this;
};
proto.allOff = function() {
delete this._events;
delete this._onceEvents;
};
return EvEmitter;
}));
/*!
* imagesLoaded v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
( function( window, factory ) { 'use strict';
// universal module definition
/*global define: false, module: false, require: false */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( [
'ev-emitter/ev-emitter'
], function( EvEmitter ) {
return factory( window, EvEmitter );
});
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory(
window,
require('ev-emitter')
);
} else {
// browser global
window.imagesLoaded = factory(
window,
window.EvEmitter
);
}
})( typeof window !== 'undefined' ? window : this,
// -------------------------- factory -------------------------- //
function factory( window, EvEmitter ) {
var $ = window.jQuery;
var console = window.console;
// -------------------------- helpers -------------------------- //
// extend objects
function extend( a, b ) {
for ( var prop in b ) {
a[ prop ] = b[ prop ];
}
return a;
}
var arraySlice = Array.prototype.slice;
// turn element or nodeList into an array
function makeArray( obj ) {
if ( Array.isArray( obj ) ) {
// use object if already an array
return obj;
}
var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
if ( isArrayLike ) {
// convert nodeList to array
return arraySlice.call( obj );
}
// array of single index
return [ obj ];
}
// -------------------------- imagesLoaded -------------------------- //
/**
* @param {Array, Element, NodeList, String} elem
* @param {Object or Function} options - if function, use as callback
* @param {Function} onAlways - callback function
*/
function ImagesLoaded( elem, options, onAlways ) {
// coerce ImagesLoaded() without new, to be new ImagesLoaded()
if ( !( this instanceof ImagesLoaded ) ) {
return new ImagesLoaded( elem, options, onAlways );
}
// use elem as selector string
var queryElem = elem;
if ( typeof elem == 'string' ) {
queryElem = document.querySelectorAll( elem );
}
// bail if bad element
if ( !queryElem ) {
console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );
return;
}
this.elements = makeArray( queryElem );
this.options = extend( {}, this.options );
// shift arguments if no options set
if ( typeof options == 'function' ) {
onAlways = options;
} else {
extend( this.options, options );
}
if ( onAlways ) {
this.on( 'always', onAlways );
}
this.getImages();
if ( $ ) {
// add jQuery Deferred object
this.jqDeferred = new $.Deferred();
}
// HACK check async to allow time to bind listeners
setTimeout( this.check.bind( this ) );
}
ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
ImagesLoaded.prototype.options = {};
ImagesLoaded.prototype.getImages = function() {
this.images = [];
// filter & find items if we have an item selector
this.elements.forEach( this.addElementImages, this );
};
/**
* @param {Node} element
*/
ImagesLoaded.prototype.addElementImages = function( elem ) {
// filter siblings
if ( elem.nodeName == 'IMG' ) {
this.addImage( elem );
}
// get background image on element
if ( this.options.background === true ) {
this.addElementBackgroundImages( elem );
}
// find children
// no non-element nodes, #143
var nodeType = elem.nodeType;
if ( !nodeType || !elementNodeTypes[ nodeType ] ) {
return;
}
var childImgs = elem.querySelectorAll('img');
// concat childElems to filterFound array
for ( var i=0; i < childImgs.length; i++ ) {
var img = childImgs[i];
this.addImage( img );
}
// get child background images
if ( typeof this.options.background == 'string' ) {
var children = elem.querySelectorAll( this.options.background );
for ( i=0; i < children.length; i++ ) {
var child = children[i];
this.addElementBackgroundImages( child );
}
}
};
var elementNodeTypes = {
1: true,
9: true,
11: true
};
ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
var style = getComputedStyle( elem );
if ( !style ) {
// Firefox returns null if in a hidden iframe https://bugzil.la/548397
return;
}
// get url inside url("...")
var reURL = /url\((['"])?(.*?)\1\)/gi;
var matches = reURL.exec( style.backgroundImage );
while ( matches !== null ) {
var url = matches && matches[2];
if ( url ) {
this.addBackground( url, elem );
}
matches = reURL.exec( style.backgroundImage );
}
};
/**
* @param {Image} img
*/
ImagesLoaded.prototype.addImage = function( img ) {
var loadingImage = new LoadingImage( img );
this.images.push( loadingImage );
};
ImagesLoaded.prototype.addBackground = function( url, elem ) {
var background = new Background( url, elem );
this.images.push( background );
};
ImagesLoaded.prototype.check = function() {
var _this = this;
this.progressedCount = 0;
this.hasAnyBroken = false;
// complete if no images
if ( !this.images.length ) {
this.complete();
return;
}
function onProgress( image, elem, message ) {
// HACK - Chrome triggers event before object properties have changed. #83
setTimeout( function() {
_this.progress( image, elem, message );
});
}
this.images.forEach( function( loadingImage ) {
loadingImage.once( 'progress', onProgress );
loadingImage.check();
});
};
ImagesLoaded.prototype.progress = function( image, elem, message ) {
this.progressedCount++;
this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
// progress event
this.emitEvent( 'progress', [ this, image, elem ] );
if ( this.jqDeferred && this.jqDeferred.notify ) {
this.jqDeferred.notify( this, image );
}
// check if completed
if ( this.progressedCount == this.images.length ) {
this.complete();
}
if ( this.options.debug && console ) {
console.log( 'progress: ' + message, image, elem );
}
};
ImagesLoaded.prototype.complete = function() {
var eventName = this.hasAnyBroken ? 'fail' : 'done';
this.isComplete = true;
this.emitEvent( eventName, [ this ] );
this.emitEvent( 'always', [ this ] );
if ( this.jqDeferred ) {
var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
this.jqDeferred[ jqMethod ]( this );
}
};
// -------------------------- -------------------------- //
function LoadingImage( img ) {
this.img = img;
}
LoadingImage.prototype = Object.create( EvEmitter.prototype );
LoadingImage.prototype.check = function() {
// If complete is true and browser supports natural sizes,
// try to check for image status manually.
var isComplete = this.getIsImageComplete();
if ( isComplete ) {
// report based on naturalWidth
this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
return;
}
// If none of the checks above matched, simulate loading on detached element.
this.proxyImage = new Image();
this.proxyImage.addEventListener( 'load', this );
this.proxyImage.addEventListener( 'error', this );
// bind to image as well for Firefox. #191
this.img.addEventListener( 'load', this );
this.img.addEventListener( 'error', this );
this.proxyImage.src = this.img.src;
};
LoadingImage.prototype.getIsImageComplete = function() {
// check for non-zero, non-undefined naturalWidth
// fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
return this.img.complete && this.img.naturalWidth;
};
LoadingImage.prototype.confirm = function( isLoaded, message ) {
this.isLoaded = isLoaded;
this.emitEvent( 'progress', [ this, this.img, message ] );
};
// ----- events ----- //
// trigger specified handler for event type
LoadingImage.prototype.handleEvent = function( event ) {
var method = 'on' + event.type;
if ( this[ method ] ) {
this[ method ]( event );
}
};
LoadingImage.prototype.onload = function() {
this.confirm( true, 'onload' );
this.unbindEvents();
};
LoadingImage.prototype.onerror = function() {
this.confirm( false, 'onerror' );
this.unbindEvents();
};
LoadingImage.prototype.unbindEvents = function() {
this.proxyImage.removeEventListener( 'load', this );
this.proxyImage.removeEventListener( 'error', this );
this.img.removeEventListener( 'load', this );
this.img.removeEventListener( 'error', this );
};
// -------------------------- Background -------------------------- //
function Background( url, element ) {
this.url = url;
this.element = element;
this.img = new Image();
}
// inherit LoadingImage prototype
Background.prototype = Object.create( LoadingImage.prototype );
Background.prototype.check = function() {
this.img.addEventListener( 'load', this );
this.img.addEventListener( 'error', this );
this.img.src = this.url;
// check if image is already complete
var isComplete = this.getIsImageComplete();
if ( isComplete ) {
this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
this.unbindEvents();
}
};
Background.prototype.unbindEvents = function() {
this.img.removeEventListener( 'load', this );
this.img.removeEventListener( 'error', this );
};
Background.prototype.confirm = function( isLoaded, message ) {
this.isLoaded = isLoaded;
this.emitEvent( 'progress', [ this, this.element, message ] );
};
// -------------------------- jQuery -------------------------- //
ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
jQuery = jQuery || window.jQuery;
if ( !jQuery ) {
return;
}
// set local variable
$ = jQuery;
// $().imagesLoaded()
$.fn.imagesLoaded = function( options, callback ) {
var instance = new ImagesLoaded( this, options, callback );
return instance.jqDeferred.promise( $(this) );
};
};
// try making plugin
ImagesLoaded.makeJQueryPlugin();
// -------------------------- -------------------------- //
return ImagesLoaded;
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,395 @@
/*! lightslider - v1.1.6 - 2016-10-25
* https://github.com/sachinchoolur/lightslider
* Copyright (c) 2016 Sachin N; Licensed MIT */
/*! lightslider - v1.1.3 - 2015-04-14
* https://github.com/sachinchoolur/lightslider
* Copyright (c) 2015 Sachin N; Licensed MIT */
/** /!!! core css Should not edit !!!/**/
.lSSlideOuter {
overflow: hidden;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.lightSlider:before, .lightSlider:after {
content: " ";
display: table;
}
.lightSlider {
overflow: hidden;
margin: 0;
}
.lSSlideWrapper {
max-width: 100%;
overflow: hidden;
position: relative;
}
.lSSlideWrapper > .lightSlider:after {
clear: both;
}
.lSSlideWrapper .lSSlide {
-webkit-transform: translate(0px, 0px);
-ms-transform: translate(0px, 0px);
transform: translate(0px, 0px);
-webkit-transition: all 1s;
-webkit-transition-property: -webkit-transform,height;
-moz-transition-property: -moz-transform,height;
transition-property: transform,height;
-webkit-transition-duration: inherit !important;
transition-duration: inherit !important;
-webkit-transition-timing-function: inherit !important;
transition-timing-function: inherit !important;
}
.lSSlideWrapper .lSFade {
position: relative;
}
.lSSlideWrapper .lSFade > * {
position: absolute !important;
top: 0;
left: 0;
z-index: 9;
margin-right: 0;
width: 100%;
}
.lSSlideWrapper.usingCss .lSFade > * {
opacity: 0;
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transition-duration: inherit !important;
transition-duration: inherit !important;
-webkit-transition-property: opacity;
transition-property: opacity;
-webkit-transition-timing-function: inherit !important;
transition-timing-function: inherit !important;
}
.lSSlideWrapper .lSFade > *.active {
z-index: 10;
}
.lSSlideWrapper.usingCss .lSFade > *.active {
opacity: 1;
}
/** /!!! End of core css Should not edit !!!/**/
/* Pager */
.lSSlideOuter .lSPager.lSpg {
margin: 10px 0 0;
padding: 0;
text-align: center;
}
.lSSlideOuter .lSPager.lSpg > li {
cursor: pointer;
display: inline-block;
padding: 0 5px;
}
.lSSlideOuter .lSPager.lSpg > li a {
background-color: #222222;
border-radius: 30px;
display: inline-block;
height: 8px;
overflow: hidden;
text-indent: -999em;
width: 8px;
position: relative;
z-index: 99;
-webkit-transition: all 0.5s linear 0s;
transition: all 0.5s linear 0s;
}
.lSSlideOuter .lSPager.lSpg > li:hover a, .lSSlideOuter .lSPager.lSpg > li.active a {
background-color: #428bca;
}
.lSSlideOuter .media {
opacity: 0.8;
}
.lSSlideOuter .media.active {
opacity: 1;
}
/* End of pager */
/** Gallery */
.lSSlideOuter .lSPager.lSGallery {
list-style: none outside none;
padding-left: 0;
margin: 0;
overflow: hidden;
transform: translate3d(0px, 0px, 0px);
-moz-transform: translate3d(0px, 0px, 0px);
-ms-transform: translate3d(0px, 0px, 0px);
-webkit-transform: translate3d(0px, 0px, 0px);
-o-transform: translate3d(0px, 0px, 0px);
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.lSSlideOuter .lSPager.lSGallery li {
overflow: hidden;
-webkit-transition: border-radius 0.12s linear 0s 0.35s linear 0s;
transition: border-radius 0.12s linear 0s 0.35s linear 0s;
}
.lSSlideOuter .lSPager.lSGallery li.active, .lSSlideOuter .lSPager.lSGallery li:hover {
border-radius: 5px;
}
.lSSlideOuter .lSPager.lSGallery img {
display: block;
height: auto;
max-width: 100%;
}
.lSSlideOuter .lSPager.lSGallery:before, .lSSlideOuter .lSPager.lSGallery:after {
content: " ";
display: table;
}
.lSSlideOuter .lSPager.lSGallery:after {
clear: both;
}
/* End of Gallery*/
/* slider actions */
.lSAction > a {
width: 32px;
display: block;
top: 50%;
height: 32px;
cursor: pointer;
position: absolute;
background-image: url('../img/controls.png');
z-index: 99;
margin-top: -16px;
opacity: 0.5;
-webkit-transition: opacity 0.35s linear 0s;
transition: opacity 0.35s linear 0s;
}
.lSAction > a:hover {
opacity: 1;
}
.lSAction > .lSPrev {
background-position: 0 0;
left: 10px;
}
.lSAction > .lSNext {
background-position: -32px 0;
right: 10px;
}
.lSAction > a.disabled {
pointer-events: none;
}
.cS-hidden {
height: 1px;
opacity: 0;
filter: alpha(opacity=0);
overflow: hidden;
}
/* vertical */
.lSSlideOuter.vertical {
position: relative;
}
.lSSlideOuter.vertical.noPager {
padding-right: 0px !important;
}
.lSSlideOuter.vertical .lSGallery {
position: absolute !important;
right: 0;
top: 0;
}
.lSSlideOuter.vertical .lightSlider > * {
width: 100% !important;
max-width: none !important;
}
/* vertical controlls */
.lSSlideOuter.vertical .lSAction > a {
left: 50%;
margin-left: -14px;
margin-top: 0;
}
.lSSlideOuter.vertical .lSAction > .lSNext {
background-position: 31px -31px;
bottom: 10px;
top: auto;
}
.lSSlideOuter.vertical .lSAction > .lSPrev {
background-position: 0 -31px;
bottom: auto;
top: 10px;
}
/* vertical */
/* Rtl */
.lSSlideOuter.lSrtl {
direction: rtl;
}
.lSSlideOuter .lightSlider, .lSSlideOuter .lSPager {
padding-left: 0;
list-style: none outside none;
}
.lSSlideOuter.lSrtl .lightSlider, .lSSlideOuter.lSrtl .lSPager {
padding-right: 0;
}
.lSSlideOuter .lightSlider > *, .lSSlideOuter .lSGallery li {
float: left;
}
.lSSlideOuter.lSrtl .lightSlider > *, .lSSlideOuter.lSrtl .lSGallery li {
float: right !important;
}
/* Rtl */
@-webkit-keyframes rightEnd {
0% {
left: 0;
}
50% {
left: -15px;
}
100% {
left: 0;
}
}
@keyframes rightEnd {
0% {
left: 0;
}
50% {
left: -15px;
}
100% {
left: 0;
}
}
@-webkit-keyframes topEnd {
0% {
top: 0;
}
50% {
top: -15px;
}
100% {
top: 0;
}
}
@keyframes topEnd {
0% {
top: 0;
}
50% {
top: -15px;
}
100% {
top: 0;
}
}
@-webkit-keyframes leftEnd {
0% {
left: 0;
}
50% {
left: 15px;
}
100% {
left: 0;
}
}
@keyframes leftEnd {
0% {
left: 0;
}
50% {
left: 15px;
}
100% {
left: 0;
}
}
@-webkit-keyframes bottomEnd {
0% {
bottom: 0;
}
50% {
bottom: -15px;
}
100% {
bottom: 0;
}
}
@keyframes bottomEnd {
0% {
bottom: 0;
}
50% {
bottom: -15px;
}
100% {
bottom: 0;
}
}
.lSSlideOuter .rightEnd {
-webkit-animation: rightEnd 0.3s;
animation: rightEnd 0.3s;
position: relative;
}
.lSSlideOuter .leftEnd {
-webkit-animation: leftEnd 0.3s;
animation: leftEnd 0.3s;
position: relative;
}
.lSSlideOuter.vertical .rightEnd {
-webkit-animation: topEnd 0.3s;
animation: topEnd 0.3s;
position: relative;
}
.lSSlideOuter.vertical .leftEnd {
-webkit-animation: bottomEnd 0.3s;
animation: bottomEnd 0.3s;
position: relative;
}
.lSSlideOuter.lSrtl .rightEnd {
-webkit-animation: leftEnd 0.3s;
animation: leftEnd 0.3s;
position: relative;
}
.lSSlideOuter.lSrtl .leftEnd {
-webkit-animation: rightEnd 0.3s;
animation: rightEnd 0.3s;
position: relative;
}
/*/ GRab cursor */
.lightSlider.lsGrab > * {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: -o-grab;
cursor: -ms-grab;
cursor: grab;
}
.lightSlider.lsGrabbing > * {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: -o-grabbing;
cursor: -ms-grabbing;
cursor: grabbing;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,223 @@
/**
* Sticky Plugin v1.0.2 for jQuery
* =======================================
*
* Author: Anthony Garand
*
* Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
* Improvements by Leonardo C. Daronco (daronco)
* Created: 2/14/2011
* Date: 16/04/2015
* Website: http://labs.anthonygarand.com/sticky
*
* Description: Makes an element on the page stick on the screen as you scroll
* It will only set the 'top' and 'position' of your element, you
* might need to adjust the width in some cases.
*/
(function($) {
var slice = Array.prototype.slice; // save ref to original slice()
var splice = Array.prototype.splice; // save ref to original slice()
var defaults = {
topSpacing: 0,
bottomSpacing: 0,
className: 'is-sticky',
wrapperClassName: 'sticky-wrapper',
center: false,
getWidthFrom: '',
widthFromWrapper: true, // works only when .getWidthFrom is empty
responsiveWidth: false
},
$window = $(window),
$document = $(document),
sticked = [],
windowHeight = $window.height(),
scroller = function() {
var scrollTop = $window.scrollTop(),
documentHeight = $document.height(),
dwh = documentHeight - windowHeight,
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
for (var i = 0; i < sticked.length; i++) {
var s = sticked[i],
elementTop = s.stickyWrapper.offset().top,
etse = elementTop - s.topSpacing - extra;
if (scrollTop <= etse) {
if (s.currentTop !== null) {
s.stickyElement
.css({
'width': '',
'position': '',
'top': ''
});
s.stickyElement.parent().removeClass(s.className);
s.stickyElement.trigger('sticky-end', [s]);
s.currentTop = null;
}
}
else {
var newTop = documentHeight - s.stickyElement.outerHeight()
- s.topSpacing - s.bottomSpacing - scrollTop - extra;
if (newTop < 0) {
newTop = newTop + s.topSpacing;
} else {
newTop = s.topSpacing;
}
if (s.currentTop != newTop) {
var newWidth;
if ( s.getWidthFrom ) {
newWidth = $(s.getWidthFrom).width() || null;
}
else if(s.widthFromWrapper) {
newWidth = s.stickyWrapper.width();
}
if ( newWidth == null ) {
newWidth = s.stickyElement.width();
}
s.stickyElement
.css('width', newWidth)
.css('position', 'fixed')
.css('top', newTop);
s.stickyElement.parent().addClass(s.className);
if (s.currentTop === null) {
s.stickyElement.trigger('sticky-start', [s]);
} else {
// sticky is started but it have to be repositioned
s.stickyElement.trigger('sticky-update', [s]);
}
if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
// just reached bottom || just started to stick but bottom is already reached
s.stickyElement.trigger('sticky-bottom-reached', [s]);
} else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
// sticky is started && sticked at topSpacing && overflowing from top just finished
s.stickyElement.trigger('sticky-bottom-unreached', [s]);
}
s.currentTop = newTop;
}
}
}
},
resizer = function() {
windowHeight = $window.height();
for (var i = 0; i < sticked.length; i++) {
var s = sticked[i];
var newWidth = null;
if ( s.getWidthFrom ) {
if ( s.responsiveWidth === true ) {
newWidth = $(s.getWidthFrom).width();
}
}
else if(s.widthFromWrapper) {
newWidth = s.stickyWrapper.width();
}
if ( newWidth != null ) {
s.stickyElement.css('width', newWidth);
}
}
},
methods = {
init: function(options) {
var o = $.extend({}, defaults, options);
return this.each(function() {
var stickyElement = $(this);
var stickyId = stickyElement.attr('id');
var stickyHeight = stickyElement.outerHeight();
var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName
var wrapper = $('<div></div>')
.attr('id', wrapperId)
.addClass(o.wrapperClassName);
stickyElement.wrapAll(wrapper);
var stickyWrapper = stickyElement.parent();
if (o.center) {
stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
}
if (stickyElement.css("float") == "right") {
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
}
stickyWrapper.css('height', stickyHeight);
o.stickyElement = stickyElement;
o.stickyWrapper = stickyWrapper;
o.currentTop = null;
sticked.push(o);
});
},
update: scroller,
unstick: function(options) {
return this.each(function() {
var that = this;
var unstickyElement = $(that);
var removeIdx = -1;
var i = sticked.length;
while ( i-- > 0 )
{
if (sticked[i].stickyElement.get(0) === that)
{
splice.call(sticked,i,1);
removeIdx = i;
}
}
if(removeIdx != -1)
{
unstickyElement.unwrap();
unstickyElement
.css({
'width': '',
'position': '',
'top': '',
'float': ''
})
;
}
});
}
};
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
if (window.addEventListener) {
window.addEventListener('scroll', scroller, false);
window.addEventListener('resize', resizer, false);
} else if (window.attachEvent) {
window.attachEvent('onscroll', scroller);
window.attachEvent('onresize', resizer);
}
$.fn.sticky = function(method) {
if (methods[method]) {
return methods[method].apply(this, slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return methods.init.apply( this, arguments );
} else {
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}
};
$.fn.unstick = function(method) {
if (methods[method]) {
return methods[method].apply(this, slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return methods.unstick.apply( this, arguments );
} else {
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}
};
$(function() {
setTimeout(scroller, 0);
});
})(jQuery);

View File

@ -0,0 +1,18 @@
/**
* Sticky Plugin v1.0.2 for jQuery
=======================================
*
* Author: Anthony Garand
*
* Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
* Improvements by Leonardo C. Daronco (daronco)
* Created: 2/14/2011
* Date: 16/04/2015
* Website: http://labs.anthonygarand.com/sticky
*
* Description: Makes an element on the page stick on the screen as you scroll
* It will only set the 'top' and 'position' of your element, you
* might need to adjust the width in some cases.
*/
!function(t){var e=Array.prototype.slice,i=Array.prototype.splice,r={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1},n=t(window),s=t(document),o=[],c=n.height(),a=function(){for(var e=n.scrollTop(),i=s.height(),r=i-c,a=e>r?r-e:0,p=0;p<o.length;p++){var l=o[p];if(e<=l.stickyWrapper.offset().top-l.topSpacing-a)null!==l.currentTop&&(l.stickyElement.css({width:"",position:"",top:""}),l.stickyElement.parent().removeClass(l.className),l.stickyElement.trigger("sticky-end",[l]),l.currentTop=null);else{var d,h=i-l.stickyElement.outerHeight()-l.topSpacing-l.bottomSpacing-e-a;if(h<0?h+=l.topSpacing:h=l.topSpacing,l.currentTop!=h)l.getWidthFrom?d=t(l.getWidthFrom).width()||null:l.widthFromWrapper&&(d=l.stickyWrapper.width()),null==d&&(d=l.stickyElement.width()),l.stickyElement.css("width",d).css("position","fixed").css("top",h),l.stickyElement.parent().addClass(l.className),null===l.currentTop?l.stickyElement.trigger("sticky-start",[l]):l.stickyElement.trigger("sticky-update",[l]),l.currentTop===l.topSpacing&&l.currentTop>h||null===l.currentTop&&h<l.topSpacing?l.stickyElement.trigger("sticky-bottom-reached",[l]):null!==l.currentTop&&h===l.topSpacing&&l.currentTop<h&&l.stickyElement.trigger("sticky-bottom-unreached",[l]),l.currentTop=h}}},p=function(){c=n.height();for(var e=0;e<o.length;e++){var i=o[e],r=null;i.getWidthFrom?!0===i.responsiveWidth&&(r=t(i.getWidthFrom).width()):i.widthFromWrapper&&(r=i.stickyWrapper.width()),null!=r&&i.stickyElement.css("width",r)}},l={init:function(e){var i=t.extend({},r,e);return this.each(function(){var e=t(this),n=e.attr("id"),s=e.outerHeight(),c=n?n+"-"+r.wrapperClassName:r.wrapperClassName,a=t("<div></div>").attr("id",c).addClass(i.wrapperClassName);e.wrapAll(a);var p=e.parent();i.center&&p.css({width:e.outerWidth(),marginLeft:"auto",marginRight:"auto"}),"right"==e.css("float")&&e.css({float:"none"}).parent().css({float:"right"}),p.css("height",s),i.stickyElement=e,i.stickyWrapper=p,i.currentTop=null,o.push(i)})},update:a,unstick:function(e){return this.each(function(){for(var e=t(this),r=-1,n=o.length;n-- >0;)o[n].stickyElement.get(0)===this&&(i.call(o,n,1),r=n);-1!=r&&(e.unwrap(),e.css({width:"",position:"",top:"",float:""}))})}};window.addEventListener?(window.addEventListener("scroll",a,!1),window.addEventListener("resize",p,!1)):window.attachEvent&&(window.attachEvent("onscroll",a),window.attachEvent("onresize",p)),t.fn.sticky=function(i){return l[i]?l[i].apply(this,e.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.sticky"):l.init.apply(this,arguments)},t.fn.unstick=function(i){return l[i]?l[i].apply(this,e.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.sticky"):l.unstick.apply(this,arguments)},t(function(){setTimeout(a,0)})}(jQuery);

513
assets/library/wow/wow.js Normal file
View File

@ -0,0 +1,513 @@
(function() {
var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Util = (function() {
function Util() {}
Util.prototype.extend = function(custom, defaults) {
var key, value;
for (key in defaults) {
value = defaults[key];
if (custom[key] == null) {
custom[key] = value;
}
}
return custom;
};
Util.prototype.isMobile = function(agent) {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
};
Util.prototype.createEvent = function(event, bubble, cancel, detail) {
var customEvent;
if (bubble == null) {
bubble = false;
}
if (cancel == null) {
cancel = false;
}
if (detail == null) {
detail = null;
}
if (document.createEvent != null) {
customEvent = document.createEvent('CustomEvent');
customEvent.initCustomEvent(event, bubble, cancel, detail);
} else if (document.createEventObject != null) {
customEvent = document.createEventObject();
customEvent.eventType = event;
} else {
customEvent.eventName = event;
}
return customEvent;
};
Util.prototype.emitEvent = function(elem, event) {
if (elem.dispatchEvent != null) {
return elem.dispatchEvent(event);
} else if (event in (elem != null)) {
return elem[event]();
} else if (("on" + event) in (elem != null)) {
return elem["on" + event]();
}
};
Util.prototype.addEvent = function(elem, event, fn) {
if (elem.addEventListener != null) {
return elem.addEventListener(event, fn, false);
} else if (elem.attachEvent != null) {
return elem.attachEvent("on" + event, fn);
} else {
return elem[event] = fn;
}
};
Util.prototype.removeEvent = function(elem, event, fn) {
if (elem.removeEventListener != null) {
return elem.removeEventListener(event, fn, false);
} else if (elem.detachEvent != null) {
return elem.detachEvent("on" + event, fn);
} else {
return delete elem[event];
}
};
Util.prototype.innerHeight = function() {
if ('innerHeight' in window) {
return window.innerHeight;
} else {
return document.documentElement.clientHeight;
}
};
return Util;
})();
WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
function WeakMap() {
this.keys = [];
this.values = [];
}
WeakMap.prototype.get = function(key) {
var i, item, j, len, ref;
ref = this.keys;
for (i = j = 0, len = ref.length; j < len; i = ++j) {
item = ref[i];
if (item === key) {
return this.values[i];
}
}
};
WeakMap.prototype.set = function(key, value) {
var i, item, j, len, ref;
ref = this.keys;
for (i = j = 0, len = ref.length; j < len; i = ++j) {
item = ref[i];
if (item === key) {
this.values[i] = value;
return;
}
}
this.keys.push(key);
return this.values.push(value);
};
return WeakMap;
})());
MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
function MutationObserver() {
if (typeof console !== "undefined" && console !== null) {
console.warn('MutationObserver is not supported by your browser.');
}
if (typeof console !== "undefined" && console !== null) {
console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
}
}
MutationObserver.notSupported = true;
MutationObserver.prototype.observe = function() {};
return MutationObserver;
})());
getComputedStyle = this.getComputedStyle || function(el, pseudo) {
this.getPropertyValue = function(prop) {
var ref;
if (prop === 'float') {
prop = 'styleFloat';
}
if (getComputedStyleRX.test(prop)) {
prop.replace(getComputedStyleRX, function(_, _char) {
return _char.toUpperCase();
});
}
return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null;
};
return this;
};
getComputedStyleRX = /(\-([a-z]){1})/g;
this.WOW = (function() {
WOW.prototype.defaults = {
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: true,
live: true,
callback: null,
scrollContainer: null
};
function WOW(options) {
if (options == null) {
options = {};
}
this.scrollCallback = bind(this.scrollCallback, this);
this.scrollHandler = bind(this.scrollHandler, this);
this.resetAnimation = bind(this.resetAnimation, this);
this.start = bind(this.start, this);
this.scrolled = true;
this.config = this.util().extend(options, this.defaults);
if (options.scrollContainer != null) {
this.config.scrollContainer = document.querySelector(options.scrollContainer);
}
this.animationNameCache = new WeakMap();
this.wowEvent = this.util().createEvent(this.config.boxClass);
}
WOW.prototype.init = function() {
var ref;
this.element = window.document.documentElement;
if ((ref = document.readyState) === "interactive" || ref === "complete") {
this.start();
} else {
this.util().addEvent(document, 'DOMContentLoaded', this.start);
}
return this.finished = [];
};
WOW.prototype.start = function() {
var box, j, len, ref;
this.stopped = false;
this.boxes = (function() {
var j, len, ref, results;
ref = this.element.querySelectorAll("." + this.config.boxClass);
results = [];
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
results.push(box);
}
return results;
}).call(this);
this.all = (function() {
var j, len, ref, results;
ref = this.boxes;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
results.push(box);
}
return results;
}).call(this);
if (this.boxes.length) {
if (this.disabled()) {
this.resetStyle();
} else {
ref = this.boxes;
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
this.applyStyle(box, true);
}
}
}
if (!this.disabled()) {
this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);
this.util().addEvent(window, 'resize', this.scrollHandler);
this.interval = setInterval(this.scrollCallback, 50);
}
if (this.config.live) {
return new MutationObserver((function(_this) {
return function(records) {
var k, len1, node, record, results;
results = [];
for (k = 0, len1 = records.length; k < len1; k++) {
record = records[k];
results.push((function() {
var l, len2, ref1, results1;
ref1 = record.addedNodes || [];
results1 = [];
for (l = 0, len2 = ref1.length; l < len2; l++) {
node = ref1[l];
results1.push(this.doSync(node));
}
return results1;
}).call(_this));
}
return results;
};
})(this)).observe(document.body, {
childList: true,
subtree: true
});
}
};
WOW.prototype.stop = function() {
this.stopped = true;
this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);
this.util().removeEvent(window, 'resize', this.scrollHandler);
if (this.interval != null) {
return clearInterval(this.interval);
}
};
WOW.prototype.sync = function(element) {
if (MutationObserver.notSupported) {
return this.doSync(this.element);
}
};
WOW.prototype.doSync = function(element) {
var box, j, len, ref, results;
if (element == null) {
element = this.element;
}
if (element.nodeType !== 1) {
return;
}
element = element.parentNode || element;
ref = element.querySelectorAll("." + this.config.boxClass);
results = [];
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
if (indexOf.call(this.all, box) < 0) {
this.boxes.push(box);
this.all.push(box);
if (this.stopped || this.disabled()) {
this.resetStyle();
} else {
this.applyStyle(box, true);
}
results.push(this.scrolled = true);
} else {
results.push(void 0);
}
}
return results;
};
WOW.prototype.show = function(box) {
this.applyStyle(box);
box.className = box.className + " " + this.config.animateClass;
if (this.config.callback != null) {
this.config.callback(box);
}
this.util().emitEvent(box, this.wowEvent);
this.util().addEvent(box, 'animationend', this.resetAnimation);
this.util().addEvent(box, 'oanimationend', this.resetAnimation);
this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);
this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);
return box;
};
WOW.prototype.applyStyle = function(box, hidden) {
var delay, duration, iteration;
duration = box.getAttribute('data-wow-duration');
delay = box.getAttribute('data-wow-delay');
iteration = box.getAttribute('data-wow-iteration');
return this.animate((function(_this) {
return function() {
return _this.customStyle(box, hidden, duration, delay, iteration);
};
})(this));
};
WOW.prototype.animate = (function() {
if ('requestAnimationFrame' in window) {
return function(callback) {
return window.requestAnimationFrame(callback);
};
} else {
return function(callback) {
return callback();
};
}
})();
WOW.prototype.resetStyle = function() {
var box, j, len, ref, results;
ref = this.boxes;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
results.push(box.style.visibility = 'visible');
}
return results;
};
WOW.prototype.resetAnimation = function(event) {
var target;
if (event.type.toLowerCase().indexOf('animationend') >= 0) {
target = event.target || event.srcElement;
return target.className = target.className.replace(this.config.animateClass, '').trim();
}
};
WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
if (hidden) {
this.cacheAnimationName(box);
}
box.style.visibility = hidden ? 'hidden' : 'visible';
if (duration) {
this.vendorSet(box.style, {
animationDuration: duration
});
}
if (delay) {
this.vendorSet(box.style, {
animationDelay: delay
});
}
if (iteration) {
this.vendorSet(box.style, {
animationIterationCount: iteration
});
}
this.vendorSet(box.style, {
animationName: hidden ? 'none' : this.cachedAnimationName(box)
});
return box;
};
WOW.prototype.vendors = ["moz", "webkit"];
WOW.prototype.vendorSet = function(elem, properties) {
var name, results, value, vendor;
results = [];
for (name in properties) {
value = properties[name];
elem["" + name] = value;
results.push((function() {
var j, len, ref, results1;
ref = this.vendors;
results1 = [];
for (j = 0, len = ref.length; j < len; j++) {
vendor = ref[j];
results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
}
return results1;
}).call(this));
}
return results;
};
WOW.prototype.vendorCSS = function(elem, property) {
var j, len, ref, result, style, vendor;
style = getComputedStyle(elem);
result = style.getPropertyCSSValue(property);
ref = this.vendors;
for (j = 0, len = ref.length; j < len; j++) {
vendor = ref[j];
result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
}
return result;
};
WOW.prototype.animationName = function(box) {
var animationName, error;
try {
animationName = this.vendorCSS(box, 'animation-name').cssText;
} catch (error) {
animationName = getComputedStyle(box).getPropertyValue('animation-name');
}
if (animationName === 'none') {
return '';
} else {
return animationName;
}
};
WOW.prototype.cacheAnimationName = function(box) {
return this.animationNameCache.set(box, this.animationName(box));
};
WOW.prototype.cachedAnimationName = function(box) {
return this.animationNameCache.get(box);
};
WOW.prototype.scrollHandler = function() {
return this.scrolled = true;
};
WOW.prototype.scrollCallback = function() {
var box;
if (this.scrolled) {
this.scrolled = false;
this.boxes = (function() {
var j, len, ref, results;
ref = this.boxes;
results = [];
for (j = 0, len = ref.length; j < len; j++) {
box = ref[j];
if (!(box)) {
continue;
}
if (this.isVisible(box)) {
this.show(box);
continue;
}
results.push(box);
}
return results;
}).call(this);
if (!(this.boxes.length || this.config.live)) {
return this.stop();
}
}
};
WOW.prototype.offsetTop = function(element) {
var top;
while (element.offsetTop === void 0) {
element = element.parentNode;
}
top = element.offsetTop;
while (element = element.offsetParent) {
top += element.offsetTop;
}
return top;
};
WOW.prototype.isVisible = function(box) {
var bottom, offset, top, viewBottom, viewTop;
offset = box.getAttribute('data-wow-offset') || this.config.offset;
viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset;
viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
top = this.offsetTop(box);
bottom = top + box.clientHeight;
return top <= viewBottom && bottom >= viewTop;
};
WOW.prototype.util = function() {
return this._util != null ? this._util : this._util = new Util();
};
WOW.prototype.disabled = function() {
return !this.config.mobile && this.util().isMobile(navigator.userAgent);
};
return WOW;
})();
}).call(this);

2
assets/library/wow/wow.min.js vendored Normal file

File diff suppressed because one or more lines are too long

75
comments.php Normal file
View File

@ -0,0 +1,75 @@
<?php
/**
* The template for displaying comments
*
* This is the template that displays the area of the page that contains both the current comments
* and the comment form.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
<?php
// You can start editing here -- including this comment!
if ( have_comments() ) :
?>
<h2 class="comments-title">
<?php
$sophia_after_dark_comment_count = get_comments_number();
if ( '1' === $sophia_after_dark_comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One thought on &ldquo;%1$s&rdquo;', 'sophia-after-dark' ),
'<span>' . get_the_title() . '</span>'
);
} else {
printf( // WPCS: XSS OK.
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $sophia_after_dark_comment_count, 'comments title', 'sophia-after-dark' ) ),
number_format_i18n( $sophia_after_dark_comment_count ),
'<span>' . get_the_title() . '</span>'
);
}
?>
</h2><!-- .comments-title -->
<?php the_comments_navigation(); ?>
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
) );
?>
</ol><!-- .comment-list -->
<?php
the_comments_navigation();
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'sophia-after-dark' ); ?></p>
<?php
endif;
endif; // Check for have_comments().
comment_form();
?>
</div><!-- #comments -->

61
footer.php Normal file
View File

@ -0,0 +1,61 @@
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Sophia After Dark
* @since 1.0.0
*/
?>
</div> <!-- mt-container -->
</div><!-- #content -->
<?php
/**
* sophia_after_dark before footer
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_before_footer' );
/**
* sophia_after_dark footer
*
* @hooked - sophia_after_dark_footer_start - 5
* @hooked - sophia_after_dark_footer_sidebar - 10
* @hooked - sophia_after_dark_bottom_footer - 15
* @hooked - sophia_after_dark_footer_end - 20
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_footer' );
/**
* sophia_after_dark_scroll_top hook
*
* @hooked - sophia_after_dark_scroll_top_content - 10
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_scroll_top' );
?>
</div><!-- #page -->
<?php
/**
* sophia_after_dark_after_page hook
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_after_page' );
wp_footer();
?>
</body>
</html>

199
functions.php Normal file
View File

@ -0,0 +1,199 @@
<?php
/**
* Sophia After Dark functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Sophia After Dark
* @since 1.0.0
*/
if ( ! function_exists( 'sophia_after_dark_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, whic
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function sophia_after_dark_setup(){
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Sophia After Dark, use a find and replace
* to change 'sophia-after-dark' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'sophia-after-dark', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 768, 432, true );
add_image_size( 'sophia-after-dark-full-width', 1160, 653, true );
add_image_size( 'sophia-after-dark-post', 600, 400, true );
add_image_size( 'sophia-after-dark-post-auto', 600, 9999, false );
add_image_size( 'sophia-after-dark-slider-post', 1200, 700, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'top_header_menu' => esc_html__( 'Top Header', 'sophia-after-dark' ),
'primary_menu' => esc_html__( 'Primary', 'sophia-after-dark' ),
'footer_menu' => esc_html__( 'Footer', 'sophia-after-dark' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'sophia_after_dark_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/**
* Registers an editor stylesheet for the theme.
*/
add_editor_style( 'assets/css/mt-editor-style.css' );
/**
* Restoring the classic Widgets Editor
*
* @since 1.1.5
*/
$sophia_after_dark_enable_widgets_editor = get_theme_mod( 'sophia_after_dark_enable_widgets_editor', false );
if ( false === $sophia_after_dark_enable_widgets_editor ) {
remove_theme_support( 'widgets-block-editor' );
}
}
endif;
add_action( 'after_setup_theme', 'sophia_after_dark_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function sophia_after_dark_content_width() {
// This variable is intended to be overruled from themes.
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$GLOBALS['content_width'] = apply_filters( 'sophia_after_dark_content_width', 640 );
}
add_action( 'after_setup_theme', 'sophia_after_dark_content_width', 0 );
/**
* Set the theme version, based on theme stylesheet.
*
* @global string $sophia_after_dark_theme_version
*/
function sophia_after_dark_theme_version_info() {
$sophia_after_dark_theme_info = wp_get_theme();
$GLOBALS['sophia_after_dark_theme_version'] = $sophia_after_dark_theme_info->get( 'Version' );
}
add_action( 'after_setup_theme', 'sophia_after_dark_theme_version_info', 0 );
/**
* Function for displaying menu item description
*
*/
function sophia_after_dark_nav_description( $item_output, $item, $depth, $menu_args ) {
if ( !empty( $item->description ) ) {
$item_output = str_replace( $menu_args->link_after . '</a>', '<span class="menu-item-description">' . $item->description . '</span>' . $menu_args->link_after . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'sophia_after_dark_nav_description', 10, 4 );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer/mt-customizer.php';
/**
* Load Jetpack compatibility file.
*/
if ( defined( 'JETPACK__VERSION' ) ) {
require get_template_directory() . '/inc/jetpack.php';
}
/**
* Load custom hook file
*/
require get_template_directory() . '/inc/hooks/mt-custom-hooks.php';
/**
* Load custom hook top header file
*/
require get_template_directory() . '/inc/hooks/mt-top-header-hooks.php';
/**
* Load widget functions file
*/
require get_template_directory() . '/inc/widgets/mt-widget-functions.php';
/**
* Load metaboxes
*/
require get_template_directory() . '/inc/metaboxes/mt-post-sidebar-meta.php';
/**
* Load breadcrumbs class
*/
if ( ! function_exists( 'breadcrumb_trail' ) ) {
require get_template_directory() . '/inc/mt-class-breadcrumbs.php';
}

122
header.php Normal file
View File

@ -0,0 +1,122 @@
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Sophia After Dark
* @since 1.0.0
*/
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<meta name="keywords" content="Sophia, Sophia Atkinson, SophiaLUL">
<meta property="og:url" content="https://sophiaatkinson.com/">
<meta property="og:type" content="website">
<meta property="og:title" content="Sophia Atkinson">
<meta property="og:image" content="https://cdn.statically.io/og/theme=dark/Sophia%20Atkinson.jpg">
<meta name="twitter:image" content="https://cdn.statically.io/og/theme=dark/Sophia%20Atkinson.jpg">
<link rel='dns-prefetch' href='//cdn.jsdelivr.net' />
<p hidden>
<a rel="me" href="https://masto.ai/@sa">Mastodon</a>
<a rel="me" href="https://tech.lgbt/@sa">Mastodon</a>
<a rel="me" href="https://pronouns.page/@sophialul">Pronouns.page</a>
</p>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
/**
* Hook: wp_body_open
*
* @since 1.1.0
*/
do_action( 'wp_body_open' );
}
/**
* sophia_after_dark before page hook
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_before_page' );
?>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip To Content', 'sophia-after-dark' ) ?></a>
<?php
/**
* sophia_after_dark before header
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_before_header' );
$sophia_after_dark_enable_top_header = get_theme_mod( 'sophia_after_dark_enable_top_header', true );
if ( true === $sophia_after_dark_enable_top_header ) {
/**
* hook - sophia_after_dark_top_header
*
* @hooked - sophia_after_dark_top_header_start - 5
* @hooked - sophia_after_dark_trending_section - 10
* @hooked - sophia_after_dark_top_header_nav - 20
* @hooked - sophia_after_dark_top_header_end - 50
*/
do_action( 'sophia_after_dark_top_header' );
}
/**
* sophia_after_dark main header
*
* @hooked - sophia_after_dark_main_header_start - 5
* @hooked - sophia_after_dark_site_branding - 10
* @hooked - sophia_after_dark_menu_wrapper_start - 15
* @hooked - sophia_after_dark_header_main_menu - 20
* @hooked - sophia_after_dark_menu_icon_wrapper_start - 25
* @hooked - sophia_after_dark_menu_social_icons - 30
* @hooked - sophia_after_dark_menu_search_icon - 35
* @hooked - sophia_after_dark_menu_icon_wrapper_end - 40
* @hooked - sophia_after_dark_menu_wrapper_end - 45
* @hooked - sophia_after_dark_main_header_end - 50
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_main_header' );
if ( is_front_page() ) {
/**
* hook - front_slider_section
* displays front top section before archive blogs.
*/
do_action( 'sophia_after_dark_front_slider_section' );
}
if ( ! is_front_page() ) {
/**
* sophia_after_dark_innerpage_header hook
*
* @hooked - sophia_after_dark_innerpage_header_start - 5
* @hooked - sophia_after_dark_innerpage_header_title - 10
* @hooked - sophia_after_dark_breadcrumb_content - 15
* @hooked - sophia_after_dark_innerpage_header_end - 20
*
* @since 1.0.0
*/
do_action( 'sophia_after_dark_innerpage_header' );
}
?>
<div id="content" class="site-content">
<div class="mt-container">

75
inc/custom-header.php Normal file
View File

@ -0,0 +1,75 @@
<?php
/**
* Sample implementation of the Custom Header feature
*
* You can add an optional custom header image to header.php like so ...
*
*
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
*
* @package Sophia After Dark
* @since 1.0.0
*/
/**
* Set up the WordPress core custom header feature.
*
* @uses sophia_after_dark_header_style()
*/
function sophia_after_dark_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'sophia_after_dark_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000000',
'width' => 1000,
'height' => 250,
'flex-height' => true,
'flex-width' => true,
'wp-head-callback' => 'sophia_after_dark_header_style',
) ) );
}
add_action( 'after_setup_theme', 'sophia_after_dark_custom_header_setup' );
if ( ! function_exists( 'sophia_after_dark_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog.
*
* @see sophia_after_dark_custom_header_setup().
*/
function sophia_after_dark_header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
*/
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
?>
.site-title,
.site-description {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that.
else :
?>
.site-title a,
.site-description {
color: #<?php echo esc_attr( $header_text_color ); ?>;
}
<?php endif; ?>
</style>
<?php
}
endif;

View File

@ -0,0 +1,176 @@
<?php
/**
* Define callback functions for active_callback.
*
* @package Sophia After Dark
* @since 1.0.0
*/
if ( ! function_exists( 'sophia_after_dark_enable_top_header_active_callback' ) ) :
/**
* Check if top header option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_top_header_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_top_header' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_enable_top_header_trending_active_callback' ) ) :
/**
* Check if top header option and trending section option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_top_header_trending_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_top_header' )->value() && false !== $control->manager->get_setting( 'sophia_after_dark_enable_trending' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_enable_top_header_live_now_active_callback' ) ) :
/**
* Check if top header option and trending section option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_top_header_live_now_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_top_header' )->value() && false !== $control->manager->get_setting( 'sophia_after_dark_enable_live_now' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_section_slider_option_active_callback' ) ) :
/**
* Check if slider option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_section_slider_option_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_section_slider_option' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_section_top_featured_posts_option_active_callback' ) ) :
/**
* Check if top featured posts option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_section_top_featured_posts_option_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_section_top_featured_posts_option' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_enable_footer_widget_area_active_callback' ) ) :
/**
* Check if foooter menu option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_footer_widget_area_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_footer_widget_area' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_enable_footer_menu_active_callback' ) ) :
/**
* Check if foooter menu option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_footer_menu_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_footer_menu' )->value() ) {
return true;
} else {
return false;
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_enable_pnf_latest_posts_active_callback' ) ) :
/**
* Check if pnf latest posts option is enabled.
*
* @since 1.0.0
*
* @param WP_Customize_Control $control WP_Customize_Control instance.
*
* @return bool Whether the control is active to the current preview.
*/
function sophia_after_dark_enable_pnf_latest_posts_active_callback( $control ) {
if ( false !== $control->manager->get_setting( 'sophia_after_dark_enable_pnf_latest_posts' )->value() ) {
return true;
} else {
return false;
}
}
endif;

View File

@ -0,0 +1,113 @@
<?php
/**
* Sophia After Dark manage the Customizer options of additional panel.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_additinal_panels_sections_register' );
/**
* Add Additional panels in the theme customize
*
*/
function sophia_after_dark_customize_additinal_panels_sections_register( $wp_customize ) {
/*------------------------------------------------ Social Icons Section ------------------------------------------------*/
/**
* Social Icons
*/
$wp_customize->add_section( 'sophia_after_dark_section_social_icons',
array(
'title' => esc_html__( 'Social Icons', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_additional_panel',
'capability' => 'edit_theme_options',
'priority' => 5,
'theme_supports' => '',
)
);
/**
* Repeater field for social icons
*/
$wp_customize->add_setting(
'sophia_after_dark_social_icons',
array(
'capability' => 'edit_theme_options',
'default' => json_encode( array(
array(
'social_icon' => 'fa fa-twitter',
'social_url' => '#',
),
array(
'social_icon' => 'fa fa-pinterest',
'social_url' => '#',
)
)
),
'sanitize_callback' => 'wp_kses_post'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Repeater(
$wp_customize,
'sophia_after_dark_social_icons',
array(
'label' => __( 'Social Media', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_social_icons',
'settings' => 'sophia_after_dark_social_icons',
'priority' => 5,
'sophia_after_dark_box_label_text' => __( 'Social Media Icons','sophia-after-dark' ),
'sophia_after_dark_box_add_control_text' => __( 'Add Icon','sophia-after-dark' )
),
array(
'social_icon' => array(
'type' => 'social_icon',
'label' => esc_html__( 'Social Icon', 'sophia-after-dark' ),
'description' => __( 'Choose social media icon.', 'sophia-after-dark' )
),
'social_url' => array(
'type' => 'url',
'label' => esc_html__( 'Social Link URL', 'sophia-after-dark' ),
'description' => __( 'Enter social media url.', 'sophia-after-dark' )
),
)
)
);
/*------------------------------------------------ Breadcrumbs Section ------------------------------------------------*
/**
* Breadcrumbs
*/
$wp_customize->add_section( 'sophia_after_dark_section_breadcrumbs',
array(
'title' => esc_html__( 'Breadcrumbs', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_additional_panel',
'capability' => 'edit_theme_options',
'priority' => 10,
'theme_supports' => '',
)
);
/**
* Toggle field for Enable/Disable breadcrumbs.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_breadcrumb_option',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_breadcrumb_option',
array(
'label' => __( 'Enable Breadcrumbs', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_breadcrumbs',
'settings' => 'sophia_after_dark_enable_breadcrumb_option',
'priority' => 5,
)
)
);
}

View File

@ -0,0 +1,367 @@
<?php
/**
* Sophia After Dark include the Customizer custom classes of customizer fields.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_register_custom_controls' );
if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
/**
* Register Custom Controls
*
* @since 1.0.0
*/
function sophia_after_dark_register_custom_controls( $wp_customize ) {
if ( ! class_exists( 'sophia_after_dark_Control_Toggle' ) ) {
/**
* Toggle control (modified checkbox)
*/
class Sophia_After_Dark_Control_Toggle extends WP_Customize_Control {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'mt-toggle';
public $tooltip = '';
public function to_json() {
parent::to_json();
if ( isset( $this->default ) ) {
$this->json['default'] = $this->default;
} else{
$this->json['default'] = $this->setting->default;
}
$this->json['value'] = $this->value();
$this->json['link'] = $this->get_link();
$this->json['id'] = $this->id;
$this->json['tooltip'] = $this->tooltip;
$this->json['inputAttrs'] = '';
foreach ( $this->input_attrs as $attr => $value ) {
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
}
}
protected function content_template() {
?>
<# if ( data.tooltip ) { #>
<a href="#" class="tooltip hint--left" data-hint="{{ data.tooltip }}"><span class='dashicons dashicons-info'></span></a>
<# } #>
<label for="toggle_{{ data.id }}">
<span class="customize-control-title">
{{{ data.label }}}
</span>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<input {{{ data.inputAttrs }}} name="toggle_{{ data.id }}" id="toggle_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( '1' == data.value ) { #> checked<# } #> hidden />
<span class="switch"></span>
</label>
<?php
}
}
} //Ends sophia_after_dark_Control_Toggle
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! class_exists( 'sophia_after_dark_Control_Radio_Image' ) ) {
/**
* Radio Image control (modified radio).
*/
class Sophia_After_Dark_Control_Radio_Image extends WP_Customize_Control {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'mt-radio-image';
public $tooltip = '';
public function to_json() {
parent::to_json();
if ( isset( $this->default ) ) {
$this->json['default'] = $this->default;
} else {
$this->json['default'] = $this->setting->default;
}
$this->json['value'] = $this->value();
$this->json['link'] = $this->get_link();
$this->json['id'] = $this->id;
$this->json['tooltip'] = $this->tooltip;
$this->json['choices'] = $this->choices;
$this->json['inputAttrs'] = '';
foreach ( $this->input_attrs as $attr => $value ) {
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
}
}
protected function content_template() {
?>
<# if ( data.tooltip ) { #>
<a href="#" class="tooltip hint--left" data-hint="{{ data.tooltip }}"><span class='dashicons dashicons-info'></span></a>
<# } #>
<label class="customizer-text">
<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
</label>
<div id="input_{{ data.id }}" class="image">
<# for ( key in data.choices ) { #>
<# dataAlt = ( _.isObject( data.choices[ key ] ) && ! _.isUndefined( data.choices[ key ].alt ) ) ? data.choices[ key ].alt : '' #>
<input {{{ data.inputAttrs }}} class="image-select" type="radio" value="{{ key }}" name="_customize-radio-{{ data.id }}" id="{{ data.id }}{{ key }}" {{{ data.link }}}<# if ( data.value === key ) { #> checked="checked"<# } #> data-alt="{{ dataAlt }}">
<label for="{{ data.id }}{{ key }}" {{{ data.labelStyle }}} class="{{{ data.id + key }}}">
<# if ( _.isObject( data.choices[ key ] ) ) { #>
<img src="{{ data.choices[ key ].src }}" alt="{{ data.choices[ key ].alt }}">
<span class="image-label"><span class="inner">{{ data.choices[ key ].alt }}</span></span>
<# } else { #>
<img src="{{ data.choices[ key ] }}">
<# } #>
<span class="image-clickable"></span>
</label>
</input>
<# } #>
</div>
<?php
}
}
}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! class_exists( 'sophia_after_dark_Control_Repeater' ) ) {
/**
* Repeater control
*/
class Sophia_After_Dark_Control_Repeater extends WP_Customize_Control {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'mt-repeater';
public $sophia_after_dark_box_label = '';
public $sophia_after_dark_box_add_control = '';
/**
* The fields that each container row will contain.
*
* @access public
* @var array
*/
public $fields = array();
/**
* Repeater drag and drop controller
*
* @since 1.0.0
*/
public function __construct( $manager, $id, $args = array(), $fields = array() ) {
$this->fields = $fields;
$this->sophia_after_dark_box_label = $args['sophia_after_dark_box_label_text'] ;
$this->sophia_after_dark_box_add_control = $args['sophia_after_dark_box_add_control_text'];
parent::__construct( $manager, $id, $args );
}
protected function render_content() {
$values = json_decode( $this->value() );
$repeater_id = $this->id;
$field_count = count( $values );
?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php if ( $this->description ) { ?>
<span class="description customize-control-description">
<?php echo wp_kses_post( $this->description ); ?>
</span>
<?php } ?>
<ul class="mt-repeater-field-control-wrap">
<?php $this->sophia_after_dark_get_fields(); ?>
</ul>
<input type="hidden" <?php $this->link(); ?> class="mt-repeater-collector" value="<?php echo esc_attr( $this->value() ); ?>" />
<input type="hidden" name="<?php echo esc_attr( $repeater_id ).'_count'; ?>" class="field-count" value="<?php echo absint( $field_count ); ?>">
<input type="hidden" name="field_limit" class="field-limit" value="6">
<button type="button" class="button mt-repeater-add-control-field"><?php echo esc_html( $this->sophia_after_dark_box_add_control ); ?></button>
<?php
}
private function sophia_after_dark_get_fields() {
$fields = $this->fields;
$values = json_decode( $this->value() );
if ( is_array( $values ) ) {
foreach( $values as $value ) {
?>
<li class="mt-repeater-field-control">
<h3 class="mt-repeater-field-title"><?php echo esc_html( $this->sophia_after_dark_box_label ); ?></h3>
<div class="mt-repeater-fields">
<?php
foreach ( $fields as $key => $field ) {
$class = isset( $field['class'] ) ? $field['class'] : '';
?>
<div class="mt-repeater-field mt-repeater-type-<?php echo esc_attr( $field['type'] ).' '.esc_attr( $class ); ?>">
<?php
$label = isset( $field['label'] ) ? $field['label'] : '';
$description = isset( $field['description'] ) ? $field['description'] : '';
if ( $field['type'] != 'checkbox' ) {
?>
<span class="customize-control-title"><?php echo esc_html( $label ); ?></span>
<span class="description customize-control-description"><?php echo esc_html( $description ); ?></span>
<?php
}
$new_value = isset( $value->$key ) ? $value->$key : '';
$default = isset( $field['default'] ) ? $field['default'] : '';
switch ( $field['type'] ) {
/**
* Text field
*/
case 'text':
echo '<input data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'" type="text" value="'.esc_attr( $new_value ).'"/>';
break;
/**
* Textarea field
*/
case 'textarea':
echo '<textarea data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'">'.esc_attr( $new_value ).'</textarea>';
break;
/**
* URL field
*/
case 'url':
echo '<input data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'" type="text" value="'.esc_url( $new_value ).'"/>';
break;
/**
* Icon field
*/
case 'icon':
$sophia_after_dark_font_awesome_icon_array = sophia_after_dark_font_awesome_icon_array();
echo '<div class="mt-repeater-selected-icon"><i class="'.esc_attr( $new_value ).'"></i><span><i class="fa fa-angle-down"></i></span></div><ul class="mt-repeater-icon-list mt-clearfix">';
foreach ( $sophia_after_dark_font_awesome_icon_array as $sophia_after_dark_font_awesome_icon ) {
$icon_class = $new_value == $sophia_after_dark_font_awesome_icon ? 'icon-active' : '';
echo '<li class='.esc_attr( $icon_class ).'><i class="'.esc_attr( $sophia_after_dark_font_awesome_icon ).'"></i></li>';
}
echo '</ul><input data-default="'.esc_attr( $default ).'" type="hidden" value="'.esc_attr( $new_value ).'" data-name="'.esc_attr( $key ).'"/>';
break;
/**
* Social Icon field
*/
case 'social_icon':
$sophia_after_dark_font_awesome_social_icon_array = sophia_after_dark_font_awesome_social_icon_array();
echo '<div class="mt-repeater-selected-icon"><i class="'.esc_attr( $new_value ).'"></i><span><i class="fa fa-angle-down"></i></span></div><ul class="mt-repeater-icon-list mt-clearfix">';
foreach ( $sophia_after_dark_font_awesome_social_icon_array as $sophia_after_dark_font_awesome_icon ) {
$icon_class = $new_value == $sophia_after_dark_font_awesome_icon ? 'icon-active' : '';
echo '<li class='.esc_attr( $icon_class ).'><i class="'.esc_attr( $sophia_after_dark_font_awesome_icon ).'"></i></li>';
}
echo '</ul><input data-default="'.esc_attr( $default ).'" type="hidden" value="'.esc_attr( $new_value ).'" data-name="'.esc_attr( $key ).'"/>';
break;
/**
* Select field
*/
case 'select':
$options = $field['options'];
echo '<select data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'">';
foreach ( $options as $option => $val )
{
printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $option ), selected( $new_value, $option, false ), esc_html( $val ) );
}
echo '</select>';
break;
/**
* Dropdown field
*/
case 'dropdown_pages':
$show_option_none = esc_html__( '&mdash; Select a page &mdash;', 'sophia-after-dark' );
$select_field ='data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'"';
$option_none_value = '';
$dropdown = wp_dropdown_pages(
array(
'name' => esc_attr( $key ),
'echo' => '',
'show_option_none' => esc_html( $show_option_none ),
'option_none_value' => esc_attr( $option_none_value ),
'selected' => esc_attr( $new_value )
)
);
if ( empty( $dropdown ) ) {
$dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $key ) );
$dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );
$dropdown .= '</select>';
}
// Hackily add in the data link parameter.
$dropdown = str_replace( '<select', '<select ' . $select_field, $dropdown );
echo $dropdown;
break;
/**
* Upload field
*/
case 'upload':
$image_class = "";
$upload_btn_label = esc_html__( 'Select Image', 'sophia-after-dark' );
$remove_btn_label = esc_html__( 'Remove', 'sophia-after-dark' );
if ( $new_value ) {
$image_class = ' hidden';
}
echo '<div class="mt-fields-wrap"><div class="attachment-media-view"><div class="placeholder'. esc_attr( $image_class ).'">';
esc_html_e( 'No image selected', 'sophia-after-dark' );
echo '</div><div class="thumbnail thumbnail-image"><img src="'.esc_url( $new_value ).'" style="max-width:100%;"/></div><div class="actions mt-clearfix"><button type="button" class="button mt-delete-button align-left">'. esc_html( $remove_btn_label ) .'</button><button type="button" class="button mt-upload-button alignright">'. esc_html( $upload_btn_label ) .'</button><input data-default="'.esc_attr( $default ).'" class="upload-id" data-name="'.esc_attr( $key ).'" type="hidden" value="'.esc_attr( $new_value ).'"/></div></div></div>';
break;
default:
break;
}
?>
</div>
<?php
}
?>
<div class="mt-clearfix mt-repeater-footer">
<div class="alignright">
<a class="mt-repeater-field-remove" href="#remove"><?php esc_html_e( 'Delete', 'sophia-after-dark' ) ?></a> |
<a class="mt-repeater-field-close" href="#close"><?php esc_html_e( 'Close', 'sophia-after-dark' ) ?></a>
</div>
</div><!-- .mt-repeater-footer -->
</div><!-- .mt-repeater-fields-->
</li>
<?php
}
}
}
}
}
}// Ends sophia_after_dark_register_custom_controls
endif;
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/

View File

@ -0,0 +1,303 @@
<?php
/**
* Sophia After Dark manage the Customizer options of design settings panel.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_design_panels_sections_register' );
/**
* Add Additional panels in the theme customizer
*
*/
function sophia_after_dark_customize_design_panels_sections_register( $wp_customize ) {
/*------------------------------------------------ Archive Section ------------------------------------------------------------*/
/**
* Archive Settings
*/
$wp_customize->add_section( 'sophia_after_dark_section_archive_settings',
array(
'title' => esc_html__( 'Archive Settings', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_design_panel',
'capability' => 'edit_theme_options',
'priority' => 5,
'theme_supports' => '',
)
);
/*
* Radio Image field for archive/blog sidebar layout.
*/
$wp_customize->add_setting( 'sophia_after_dark_archive_sidebar_layout',
array(
'default' => 'no-sidebar',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_archive_sidebar_layout',
array(
'label' => esc_html__( 'Archive/Blog Sidebar Layout', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_archive_settings',
'settings' => 'sophia_after_dark_archive_sidebar_layout',
'priority' => 10,
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
'no-sidebar-center' => get_template_directory_uri() . '/assets/images/no-sidebar-center.png'
),
)
)
);
/*
* Radio Image field for arvhive/blog style.
*/
$wp_customize->add_setting( 'sophia_after_dark_archive_style',
array(
'default' => 'mt-archive--masonry-style',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_archive_style',
array(
'label' => esc_html__( 'Archive/Blog Style', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_archive_settings',
'settings' => 'sophia_after_dark_archive_style',
'priority' => 10,
'choices' => array(
'mt-archive--block-grid-style' => get_template_directory_uri() . '/assets/images/archive-block-grid.png',
'mt-archive--masonry-style' => get_template_directory_uri() . '/assets/images/archive-masonry.png',
),
)
)
);
/*
* Text field for archive read more button.
*/
$wp_customize->add_setting( 'sophia_after_dark_archive_read_more',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'Discover', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_archive_read_more',
array(
'type' => 'text',
'label' => esc_html__( 'Read More Button', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_archive_settings',
'settings' => 'sophia_after_dark_archive_read_more',
'priority' => 15,
)
);
/**
* Toggle field for Enable/Disable title prefix at category pages.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_archive_title_prefix',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_archive_title_prefix',
array(
'label' => __( 'Enable Title Prefix', 'sophia-after-dark' ),
'description' => esc_html__( 'Show/Hide title prefix in archive pages.', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_archive_settings',
'settings' => 'sophia_after_dark_enable_archive_title_prefix',
'priority' => 20,
)
)
);
/*------------------------------------------------------- Post Section ------------------------------------------------------------*/
/**
* Post Settings
*/
$wp_customize->add_section( 'sophia_after_dark_section_post_settings',
array(
'title' => esc_html__( 'Post Settings', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_design_panel',
'capability' => 'edit_theme_options',
'priority' => 10,
'theme_supports' => '',
)
);
/*
* Radio Image field for single posts sidebar layout.
*/
$wp_customize->add_setting( 'sophia_after_dark_posts_sidebar_layout',
array(
'default' => 'right-sidebar',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_posts_sidebar_layout',
array(
'label' => esc_html__( 'Posts Sidebar Layout', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_post_settings',
'settings' => 'sophia_after_dark_posts_sidebar_layout',
'priority' => 5,
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
'no-sidebar-center' => get_template_directory_uri() . '/assets/images/no-sidebar-center.png'
),
)
)
);
/*
* Toggle field for Enable/Disable related posts.
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_related_posts',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_related_posts',
array(
'label' => esc_html__( 'Enable Related Posts', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_post_settings',
'settings' => 'sophia_after_dark_enable_related_posts',
'priority' => 15,
)
)
);
/*------------------------------------------------------- Post Section ------------------------------------------------------------*/
/**
* Page Setting
*/
$wp_customize->add_section( 'sophia_after_dark_section_page_settings',
array(
'title' => esc_html__( 'Page Settings', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_design_panel',
'capability' => 'edit_theme_options',
'priority' => 15,
'theme_supports' => '',
)
);
/*
* Radio Image field for single page sidebar layout.
*/
$wp_customize->add_setting( 'sophia_after_dark_pages_sidebar_layout',
array(
'default' => 'right-sidebar',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_pages_sidebar_layout',
array(
'label' => esc_html__( 'Pages Sidebar Layout', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_page_settings',
'settings' => 'sophia_after_dark_pages_sidebar_layout',
'priority' => 5,
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
'no-sidebar-center' => get_template_directory_uri() . '/assets/images/no-sidebar-center.png'
),
)
)
);
/*-------------------------------------------------------------------- 404 Page Settings Section ----------------------------------------------------------------*/
/**
* 404 Page Settings
*/
$wp_customize->add_section( 'sophia_after_dark_section_pnf_settings',
array(
'priority' => 20,
'panel' => 'sophia_after_dark_design_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( '404 Page Settings', 'sophia-after-dark' )
)
);
/**
* Toggle field for Enable/Disable latest posts section at 404 page
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_pnf_latest_posts',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_pnf_latest_posts',
array(
'label' => __( 'Enable Latest Posts', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_pnf_settings',
'settings' => 'sophia_after_dark_enable_pnf_latest_posts',
'priority' => 40,
)
)
);
/**
* Text field for latest posts section title
*/
$wp_customize->add_setting( 'sophia_after_dark_pnf_latest_title',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'You May Like', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_pnf_latest_title',
array(
'type' => 'text',
'label' => esc_html__( 'Section Title', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_pnf_settings',
'priority' => 45,
'active_callback' => 'sophia_after_dark_enable_pnf_latest_posts_active_callback',
)
);
/**
* Text field for latest posts count
*/
$wp_customize->add_setting( 'sophia_after_dark_pnf_latest_post_count',
array(
'capability' => 'edit_theme_options',
'default' => 3,
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control( 'sophia_after_dark_pnf_latest_post_count',
array(
'type' => 'number',
'label' => esc_html__( 'Post count', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_pnf_settings',
'priority' => 50,
'active_callback' => 'sophia_after_dark_enable_pnf_latest_posts_active_callback',
)
);
}

View File

@ -0,0 +1,156 @@
<?php
/**
* Sophia After Dark manage the Customizer options of footer settings panel.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_footer_panels_sections_register' );
/**
* Add Additional panels in the theme customizer
*
*/
function sophia_after_dark_customize_footer_panels_sections_register( $wp_customize ) {
/*------------------------------------------------------- Footer Widget Area Section --------------------------------------------------------------------------*/
/**
* Footer Widget Area
*/
$wp_customize->add_section( 'sophia_after_dark_section_footer_widget_area',
array(
'title' => esc_html__( 'Footer Widget Area', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_footer_panel',
'capability' => 'edit_theme_options',
'priority' => 5,
'theme_supports' => '',
)
);
/**
* Toggle field for Enable/Disable footer widget area.
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_footer_widget_area',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_footer_widget_area',
array(
'label' => esc_html__( 'Enable Footer Widget Area', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_footer_widget_area',
'settings' => 'sophia_after_dark_enable_footer_widget_area',
'priority' => 5,
)
)
);
/**
* Radio Image field for Widget Area layout
*/
$wp_customize->add_setting( 'sophia_after_dark_widget_area_layout',
array(
'default' => 'column-three',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_widget_area_layout',
array(
'label' => esc_html__( 'Widget Area Layout', 'sophia-after-dark' ),
'description' => __( 'Choose widget layout from available layouts', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_footer_widget_area',
'settings' => 'sophia_after_dark_widget_area_layout',
'priority' => 15,
'active_callback' => 'sophia_after_dark_enable_footer_widget_area_active_callback',
'choices' => array(
'column-four' => get_template_directory_uri() . '/assets/images/footer-4.png',
'column-three' => get_template_directory_uri() . '/assets/images/footer-3.png',
'column-two' => get_template_directory_uri() . '/assets/images/footer-2.png',
'column-one' => get_template_directory_uri() . '/assets/images/footer-1.png'
),
)
)
);
/*------------------------------------------------------- Bottom Footer Section --------------------------------------------------------------------------*/
/**
* Bottom footer
*/
$wp_customize->add_section( 'sophia_after_dark_section_bottom_footer',
array(
'title' => esc_html__( 'Bottom Footer', 'sophia-after-dark' ),
'panel' => 'sophia_after_dark_footer_panel',
'capability' => 'edit_theme_options',
'priority' => 10,
'theme_supports' => '',
)
);
/**
* Toggle field for Enable/Disable footer menu.
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_footer_menu',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_footer_menu',
array(
'label' => esc_html__( 'Enable Footer Menu', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_bottom_footer',
'settings' => 'sophia_after_dark_enable_footer_menu',
'priority' => 5,
)
)
);
/**
* Text filed for copyright
*/
$wp_customize->add_setting( 'sophia_after_dark_footer_copyright',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( '&copy;1969 Sophia After Dark', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_footer_copyright',
array(
'type' => 'text',
'label' => esc_html__( 'Copyright Text', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_bottom_footer',
'priority' => 25,
'active_callback' => 'sophia_after_dark_enable_footer_menu_active_callback',
)
);
/**
* Text filed for disclaimer
*/
$wp_customize->add_setting( 'sophia_after_dark_footer_disclaimer',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'All trademarks are property of their respective owners', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_footer_disclaimer',
array(
'type' => 'text',
'label' => esc_html__( 'Disclaimer Text', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_bottom_footer',
'priority' => 25,
'active_callback' => 'sophia_after_dark_enable_footer_menu_active_callback',
)
);
}

View File

@ -0,0 +1,184 @@
<?php
/**
* Customizer fields for front slider section
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_slider_panels_sections_register' );
/**
* Add panels in the theme customizer
*
*/
function sophia_after_dark_customize_slider_panels_sections_register( $wp_customize ) {
/*--------------------------------------------------------- Slider Section ------------------------------------------------ */
/**
* Slider Settings
*/
$wp_customize->add_section( 'sophia_after_dark_section_slider',
array(
'priority' => 10,
'panel' => 'sophia_after_dark_front_section_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Slider Settings', 'sophia-after-dark' )
)
);
/**
* Toggle field for slider option
*
*/
$wp_customize->add_setting( 'sophia_after_dark_section_slider_option',
array(
'capability' => 'edit_theme_options',
'default' => false,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_section_slider_option',
array(
'label' => __( 'Enable Slider Section', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_slider',
'settings' => 'sophia_after_dark_section_slider_option',
'priority' => 5,
)
)
);
/**
* Select field for slider cat select
*
*/
$wp_customize->add_setting( 'sophia_after_dark_section_slider_cat',
array(
'capability' => 'edit_theme_options',
'default' => '',
'sanitize_callback' => 'sophia_after_dark_sanitize_select',
)
);
$wp_customize->add_control( 'sophia_after_dark_section_slider_cat',
array(
'type' => 'select',
'label' => esc_html__( 'Slider category', 'sophia-after-dark' ),
'description' => esc_html__( 'Choose default post category', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_slider',
'default' => '',
'priority' => 30,
'choices' => sophia_after_dark_select_categories_list(),
'active_callback' => 'sophia_after_dark_section_slider_option_active_callback',
)
);
/**
* Image field for background image in slider section
*/
$wp_customize->add_setting( 'sophia_after_dark_slider_bg_image',
array(
'capability' => 'edit_theme_options',
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control( new WP_Customize_Image_Control(
$wp_customize, 'sophia_after_dark_slider_bg_image',
array(
'label' => __( 'Slider Section Background Image', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_slider',
'settings' => 'sophia_after_dark_slider_bg_image',
'priority' => 40,
'active_callback' => 'sophia_after_dark_section_slider_option_active_callback'
)
)
);
/*--------------------------------------------------------- Featured Posts Section ------------------------------------------------ */
/**
* Featured Slider Settings
*/
$wp_customize->add_section( 'sophia_after_dark_section_top_featured_post',
array(
'priority' => 20,
'panel' => 'sophia_after_dark_front_section_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => esc_html__( 'Featured Posts Settings', 'sophia-after-dark' ),
)
);
/**
* Toggle field for featured slider option
*
*/
$wp_customize->add_setting( 'sophia_after_dark_section_top_featured_posts_option',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_section_top_featured_posts_option',
array(
'label' => esc_html__( 'Enable Featured Posts Section', 'sophia-after-dark' ),
'description' => 'This section is displayed after the slider content at the right side minimizing the slider width.',
'section' => 'sophia_after_dark_section_top_featured_post',
'settings' => 'sophia_after_dark_section_top_featured_posts_option',
'priority' => 5,
)
)
);
/**
* Text field for Featured Posts Title
*/
$wp_customize->add_setting( 'sophia_after_dark_top_featured_posts_title',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'Featured News', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_top_featured_posts_title',
array(
'type' => 'text',
'label' => esc_html__( 'Featured News', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_featured_post',
'priority' => 10,
'active_callback' => 'sophia_after_dark_section_top_featured_posts_option_active_callback',
)
);
/**
* Select field for featured posts type.
*/
$wp_customize->add_setting( 'sophia_after_dark_top_featured_post_order',
array(
'capability' => 'edit_theme_options',
'default' => 'default',
'sanitize_callback' => 'sophia_after_dark_sanitize_select',
)
);
$wp_customize->add_control( 'sophia_after_dark_top_featured_post_order',
array(
'type' => 'select',
'label' => esc_html__( 'Featured Post Order', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_featured_post',
'priority' => 15,
'choices' => array(
'default' => __( 'Latest Posts', 'sophia-after-dark' ),
'random' => __( 'Random Posts', 'sophia-after-dark' ),
),
'active_callback' => 'sophia_after_dark_section_top_featured_posts_option_active_callback',
)
);
}

View File

@ -0,0 +1,125 @@
<?php
/**
* Sophia After Dark manage the Customizer options of general panel.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_general_panels_sections_register' );
/**
* Add panels in the theme customizer
*
*/
function sophia_after_dark_customize_general_panels_sections_register( $wp_customize ) {
/*------------------------------------------- Site Settings Section -----------------------------------------------*/
/**
* Site Settings Section
*/
$wp_customize->add_section( 'sophia_after_dark_section_site',
array(
'priority' => 40,
'panel' => 'sophia_after_dark_general_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Site Settings', 'sophia-after-dark' )
)
);
/**
* Toggle field for Enable/Disable preloader.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_preloader',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_preloader',
array(
'label' => __( 'Enable Preloader', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_site',
'settings' => 'sophia_after_dark_enable_preloader',
'priority' => 5,
)
)
);
/**
* Toggle field for Enable/Disable wow animation.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_wow_animation',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_wow_animation',
array(
'label' => __( 'Enable Wow Animation', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_site',
'settings' => 'sophia_after_dark_enable_wow_animation',
'priority' => 10,
)
)
);
/**
* Radio image field for Archive Sidebar
*
* @since 1.0.0
*/
$wp_customize->add_setting( 'sophia_after_dark_site_layout',
array(
'default' => 'site-layout--wide',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Radio_Image(
$wp_customize, 'sophia_after_dark_site_layout',
array(
'label' => __( 'Site Layout', 'sophia-after-dark' ),
'description' => __( 'Choose site layout from available layouts', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_site',
'settings' => 'sophia_after_dark_site_layout',
'priority' => 15,
'choices' => array(
'site-layout--wide' => get_template_directory_uri() . '/assets/images/full-width.png',
'site-layout--boxed' => get_template_directory_uri() . '/assets/images/boxed-layout.png'
),
)
)
);
/**
* Toggle field for block based widget editor.
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_widgets_editor',
array(
'capability' => 'edit_theme_options',
'default' => false,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_widgets_editor',
array(
'label' => __( 'Enable Widgets Editor', 'sophia-after-dark' ),
'description' => __( 'Enable/disable Block-based Widgets Editor(since WordPress 5.8).', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_site',
'settings' => 'sophia_after_dark_enable_widgets_editor',
'priority' => 15,
)
)
);
}

View File

@ -0,0 +1,327 @@
<?php
/**
* Sophia After Dark manage the Customizer options of header panel.
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_header_panels_sections_register' );
/**
* Add panels in the theme customizer
*
*/
function sophia_after_dark_customize_header_panels_sections_register( $wp_customize ) {
/*------------------------------------------ Top Header Section ----------------------------------------*/
/**
* Top Header Section
*/
$wp_customize->add_section( 'sophia_after_dark_section_top_header',
array(
'priority' => 10,
'panel' => 'sophia_after_dark_header_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Top Header Settings', 'sophia-after-dark' )
)
);
/**
* Toggle field for Enable/Disable Top Header section
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_top_header',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_top_header',
array(
'label' => __( 'Enable Top Header', 'sophia-after-dark' ),
'description' => esc_html__( 'Show/Hide top header section.', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'settings' => 'sophia_after_dark_enable_top_header',
'priority' => 10,
)
)
);
/**
* Toggle field for Enable/Disable trending section.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_trending',
array(
'capability' => 'edit_theme_options',
'default' => false,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_trending',
array(
'label' => esc_html__( 'Enable Trending Section', 'sophia-after-dark' ),
'description' => esc_html__( 'Trending section shows the popular tags.', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'settings' => 'sophia_after_dark_enable_trending',
'priority' => 10,
'active_callback' => 'sophia_after_dark_enable_top_header_active_callback',
)
)
);
/**
* checkox for before icon in tags.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_trending_tag_before_icon',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( 'sophia_after_dark_enable_trending_tag_before_icon',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Add Icon Before Tag', 'sophia-after-dark' ),
'description' => esc_html__( 'Show/Hide Hash Icon before tag.', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'priority' => 20,
'active_callback' => 'sophia_after_dark_enable_top_header_trending_active_callback',
)
);
/**
* Text field for trending label.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_trending_label',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'Trending Now', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_trending_label',
array(
'type' => 'text',
'label' => esc_html__( 'Trending Label', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'priority' => 25,
'active_callback' => 'sophia_after_dark_enable_top_header_trending_active_callback',
)
);
/**
* Select field of trending tags orderby.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_trending_tags_orderby',
array(
'capability' => 'edit_theme_options',
'default' => '',
'sanitize_callback' => 'sophia_after_dark_sanitize_select',
)
);
$wp_customize->add_control( 'sophia_after_dark_trending_tags_orderby',
array(
'type' => 'select',
'label' => esc_html__( 'Tags Orderby', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'default' => '',
'priority' => 30,
'choices' => array(
'' => esc_html__( 'Default', 'sophia-after-dark' ),
'count' => esc_html__( 'Count', 'sophia-after-dark' ),
),
'active_callback' => 'sophia_after_dark_enable_top_header_trending_active_callback',
)
);
/**
* Number field of trending tags count.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_trending_tags_count',
array(
'capability' => 'edit_theme_options',
'default' => '5',
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control( 'sophia_after_dark_trending_tags_count',
array(
'type' => 'number',
'label' => esc_html__( 'Tags Count', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'priority' => 35,
'active_callback' => 'sophia_after_dark_enable_top_header_trending_active_callback',
)
);
/**
* Toggle field for Enable/Disable live now button.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_live_now',
array(
'capability' => 'edit_theme_options',
'default' => false,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_live_now',
array(
'label' => esc_html__( 'Enable Live Now Button', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'settings' => 'sophia_after_dark_enable_live_now',
'priority' => 40,
'active_callback' => 'sophia_after_dark_enable_top_header_active_callback',
)
)
);
/**
* Text field for live now button label.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_live_now_label',
array(
'capability' => 'edit_theme_options',
'default' => esc_html__( 'Live Now', 'sophia-after-dark' ),
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( 'sophia_after_dark_live_now_label',
array(
'type' => 'text',
'label' => esc_html__( 'Button Label', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'settings' => 'sophia_after_dark_live_now_label',
'priority' => 45,
'active_callback' => 'sophia_after_dark_enable_top_header_live_now_active_callback',
)
);
/**
* Text field for live now button link.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_live_now_link',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw'
)
);
$wp_customize->add_control( 'sophia_after_dark_live_now_link',
array(
'type' => 'text',
'label' => esc_html__( 'Button Link', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_top_header',
'settings' => 'sophia_after_dark_live_now_link',
'priority' => 50,
'active_callback' => 'sophia_after_dark_enable_top_header_live_now_active_callback',
'input_attrs' => array(
'placeholder' => "https://www.youtube.com/channel/UCnGp3UHMB4DH8W_KmSmrCEw"
)
)
);
/*------------------------------------------ Header: Extra Options ----------------------------------------*/
/**
* Header Extra Options
*/
$wp_customize->add_section( 'sophia_after_dark_section_header_extra',
array(
'priority' => 30,
'panel' => 'sophia_after_dark_header_panel',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Extra Options', 'sophia-after-dark' )
)
);
/**
* Toggle field for Enable/Disable sticky menu.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_sticky_menu',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_sticky_menu',
array(
'label' => esc_html__( 'Enable Sticky Menu', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_header_extra',
'settings' => 'sophia_after_dark_enable_sticky_menu',
'priority' => 5,
)
)
);
/**
* Toggle field for Enable/Disable social icons.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_header_social_icons',
array(
'capability' => 'edit_theme_options',
'default' => false,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_header_social_icons',
array(
'label' => esc_html__( 'Enable Social Icons', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_header_extra',
'settings' => 'sophia_after_dark_enable_header_social_icons',
'priority' => 10,
)
)
);
/**
* Toggle field for Enable/Disable search icon.
*
*/
$wp_customize->add_setting( 'sophia_after_dark_enable_search_icon',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
)
);
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
$wp_customize, 'sophia_after_dark_enable_search_icon',
array(
'label' => esc_html__( 'Enable Search Icon', 'sophia-after-dark' ),
'section' => 'sophia_after_dark_section_header_extra',
'settings' => 'sophia_after_dark_enable_search_icon',
'priority' => 15,
)
)
);
}

View File

@ -0,0 +1,86 @@
<?php
/**
* Sophia After Dark manage the Customizer panels
*
* @package Sophia After Dark
* @since 1.0.0
*/
add_action( 'customize_register', 'sophia_after_dark_customize_panels_register' );
/**
* Add panels in the theme customizer
*
*/
function sophia_after_dark_customize_panels_register( $wp_customize ) {
/**
* General Settings Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_general_panel',
array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'General Settings', 'sophia-after-dark' ),
)
);
/**
* Header Settings Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_header_panel',
array(
'priority' => 15,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Header Settings', 'sophia-after-dark' ),
)
);
/**
* Front Settings Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_front_section_panel',
array(
'priority' => 20,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Front Sections', 'sophia-after-dark' ),
)
);
/**
* Design Settings Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_design_panel',
array(
'priority' => 35,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Design Settings', 'sophia-after-dark' ),
)
);
/**
* Additional Features Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_additional_panel',
array(
'priority' => 40,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Additional Features', 'sophia-after-dark' ),
)
);
/**
* Footer Settings Panel
*/
$wp_customize->add_panel( 'sophia_after_dark_footer_panel',
array(
'priority' => 45,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Footer Settings', 'sophia-after-dark' ),
)
);
}

View File

@ -0,0 +1,103 @@
<?php
/**
* Sophia After Dark Theme Customizer
*
* @package Sophia After Dark
* @since 1.0.0
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function sophia_after_dark_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_section( 'title_tagline' )->panel = 'sophia_after_dark_general_panel';
$wp_customize->get_section( 'title_tagline' )->priority = '5'; $wp_customize->get_section( 'background_image' )->panel = 'sophia_after_dark_general_panel';
$wp_customize->get_section( 'background_image' )->priority = '15';
$wp_customize->get_section( 'static_front_page' )->panel = 'sophia_after_dark_general_panel';
$wp_customize->get_section( 'static_front_page' )->priority = '20';
$wp_customize->get_section( 'header_image' )->panel = 'sophia_after_dark_header_panel';
$wp_customize->get_section( 'header_image' )->priority = '5';
$wp_customize->get_section( 'header_image' )->description = __( 'Header Image for only Innerpages', 'sophia-after-dark' );
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title a',
'render_callback' => 'sophia_after_dark_customize_partial_blogname',
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'render_callback' => 'sophia_after_dark_customize_partial_blogdescription',
) );
}
/**
* Load customizer custom classes.
*/
$wp_customize->register_control_type( 'sophia_after_dark_Control_Toggle' );
$wp_customize->register_control_type( 'sophia_after_dark_Control_Radio_Image' );
}
add_action( 'customize_register', 'sophia_after_dark_customize_register' );
/**
* Render the site title for the selective refresh partial.
*
* @return void
*/
function sophia_after_dark_customize_partial_blogname() {
bloginfo( 'name' );
}
/**
* Render the site tagline for the selective refresh partial.
*
* @return void
*/
function sophia_after_dark_customize_partial_blogdescription() {
bloginfo( 'description' );
}
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function sophia_after_dark_customize_preview_js() {
wp_enqueue_script( 'sophia-after-dark-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20151215', true );
}
add_action( 'customize_preview_init', 'sophia_after_dark_customize_preview_js' );
/*----------------------------------------------------------------------------------------------------------------------------------------*/
/**
* Enqueue required scripts/styles for customizer panel
*
* @since 1.0.0
*/
function sophia_after_dark_customize_backend_scripts() {
global $sophia_after_dark_theme_version;
wp_enqueue_style( 'sophia-after-dark--admin-customizer-style', get_template_directory_uri() . '/assets/css/mt-customizer-styles.css', array(), esc_attr( esc_attr( $sophia_after_dark_theme_version ) ) );
wp_enqueue_style( 'jquery-ui', esc_url( get_template_directory_uri() . '/assets/css/jquery-ui.css' ) );
wp_enqueue_style( 'font-awesome-customize', get_template_directory_uri() . '/assets/library/font-awesome/css/font-awesome.min.css', array(), '4.7.0' );
wp_enqueue_script( 'sophia-after-dark--admin-customizer-script', get_template_directory_uri() . '/assets/js/mt-customizer-controls.js', array( 'jquery', 'customize-controls' ), esc_attr( $sophia_after_dark_theme_version ), true );
}
add_action( 'customize_controls_enqueue_scripts', 'sophia_after_dark_customize_backend_scripts', 10 );
/**
* Add Kirki required file for custom fields
*/
require get_template_directory() . '/inc/customizer/mt-customizer-custom-classes.php';
require get_template_directory() . '/inc/customizer/mt-customizer-panels.php';
require get_template_directory() . '/inc/customizer/mt-sanitize.php';
require get_template_directory() . '/inc/customizer/mt-callback.php';
require get_template_directory() . '/inc/customizer/mt-customizer-general-panel-options.php';
require get_template_directory() . '/inc/customizer/mt-customizer-header-panel-options.php';
require get_template_directory() . '/inc/customizer/mt-customizer-front-panel-options.php';
require get_template_directory() . '/inc/customizer/mt-customizer-additional-panel-options.php';
require get_template_directory() . '/inc/customizer/mt-customizer-design-panel-options.php';
require get_template_directory() . '/inc/customizer/mt-customizer-footer-panel-options.php';

View File

@ -0,0 +1,47 @@
<?php
/**
* Sanitize customizer field
*
* @package Sophia After Dark
* @since 1.0.0
*/
if ( ! function_exists( 'sophia_after_dark_sanitize_checkbox' ) ) :
/**
* Sanitize checkbox.
*
* @since 1.0.0
*
* @param bool $checked Whether the checkbox is checked.
* @return bool Whether the checkbox is checked.
*/
function sophia_after_dark_sanitize_checkbox( $checked ) {
return ( ( isset( $checked ) && true === $checked ) ? true : false );
}
endif;
if ( ! function_exists( 'sophia_after_dark_sanitize_select' ) ) :
/**
* Sanitize select.
*
* @since 1.0.0
*
* @param mixed $input The value to sanitize.
* @param WP_Customize_Setting $setting WP_Customize_Setting instance.
* @return mixed Sanitized value.
*/
function sophia_after_dark_sanitize_select( $input, $setting ) {
// Ensure input is a slug.
$input = sanitize_key( $input );
// Get list of choices from the control associated with the setting.
$choices = $setting->manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
endif;

View File

@ -0,0 +1,594 @@
<?php
/**
* Managed the custom functions and hooks for entire theme.
*
* @package Sophia After Dark
* @since 1.0.0
*/
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_main_header_start' ) ) :
/**
* function to start header section
*/
function sophia_after_dark_main_header_start() {
echo '<header id="masthead" class="site-header">';
echo '<div class="mt-logo-row-wrapper mt-clearfix">';
}
endif;
if ( ! function_exists( 'sophia_after_dark_site_branding' ) ) :
/**
* function to display site branding
*/
function sophia_after_dark_site_branding() {
?>
<div class="logo-ads-wrap">
<div class="mt-container">
<div class="site-branding">
<?php
the_custom_logo();
if ( is_front_page() || is_home() ) :
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php
endif;
$sophia_after_dark_description = get_bloginfo( 'description', 'display' );
if ( $sophia_after_dark_description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $sophia_after_dark_description; /* WPCS: xss ok. */ ?></p>
<?php endif; ?>
</div><!-- .site-branding -->
<div class="header-widget-wrapper">
<?php
if ( is_active_sidebar( 'header-ads-section' ) ) {
dynamic_sidebar( 'header-ads-section' );
}
?>
</div>
</div> <!-- mt-container -->
</div><!-- .logo-ads-wrap -->
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_wrapper_start' ) ) :
/**
* function to start menu wrapper
*/
function sophia_after_dark_menu_wrapper_start() {
echo '<div class="mt-social-menu-wrapper">';
echo '<div class="mt-container">';
}
endif;
if ( ! function_exists( 'sophia_after_dark_header_main_menu' ) ) :
/**
* function to display primary menu
*/
function sophia_after_dark_header_main_menu() {
$sophia_after_dark_menu_toggle_text = apply_filters( 'sophia_after_dark_menu_toggle_text', __( 'Menu', 'sophia-after-dark' ) );
?>
<div class="mt-header-menu-wrap">
<div class="menu-toggle"><a href="javascript:void(0)"><i class="fa fa-navicon"></i><?php echo esc_html( $sophia_after_dark_menu_toggle_text ); ?></a></div>
<nav itemscope id="site-navigation" class="main-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'primary_menu',
'menu_id' => 'primary-menu',
) );
?>
</nav><!-- #site-navigation -->
</div>
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_icon_wrapper_start' ) ) :
/**
* function to start icon wrapper
*/
function sophia_after_dark_menu_icon_wrapper_start() {
echo '<div class="mt-social-search-wrapper">';
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_social_icons' ) ) :
/**
* function to display social icons at menu section
*/
function sophia_after_dark_menu_social_icons() {
$sophia_after_dark_enable_header_social_icons = get_theme_mod( 'sophia_after_dark_enable_header_social_icons', false );
if ( false === $sophia_after_dark_enable_header_social_icons ) {
return;
}
$sophia_after_dark_menu_social_icons_label = apply_filters( 'sophia_after_dark_menu_social_icons_label', __( 'Follow Us: ', 'sophia-after-dark' ) );
?>
<div class="mt-social-wrapper">
<span class="mt-follow-title"><?php echo esc_html( $sophia_after_dark_menu_social_icons_label ); ?></span>
<?php sophia_after_dark_social_media_content(); ?>
</div>
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_search_icon' ) ) :
/**
* function to display search icon at menu section
*/
function sophia_after_dark_menu_search_icon() {
$sophia_after_dark_enable_search_icon = get_theme_mod( 'sophia_after_dark_enable_search_icon', true );
if ( false === $sophia_after_dark_enable_search_icon ) {
return;
}
$sophia_after_dark_menu_search_icon_lable = apply_filters( 'sophia_after_dark_menu_search_icon_lable', __( 'Search', 'sophia-after-dark' ) );
?>
<div class="mt-menu-search">
<div class="mt-search-icon"><a href="javascript:void(0)"><?php echo esc_html( $sophia_after_dark_menu_search_icon_lable ); ?><i class="fa fa-search"></i></a></div>
<div class="mt-form-wrap">
<?php get_search_form(); ?>
<div class="mt-form-close"><a href="javascript:void(0)"><i class="fa fa-close"></i></a></div>
</div><!-- .mt-form-wrap -->
</div><!-- .mt-menu-search -->
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_icon_wrapper_end' ) ) :
/**
* function to end icon wrapper
*/
function sophia_after_dark_menu_icon_wrapper_end() {
echo '</div><!-- .mt-social-search-wrapper -->';
}
endif;
if ( ! function_exists( 'sophia_after_dark_menu_wrapper_end' ) ) :
/**
* function to end menu wrapper
*/
function sophia_after_dark_menu_wrapper_end() {
echo '</div><!--.mt-container -->';
echo '</div><!--.mt-social-menu-wrapper -->';
}
endif;
if ( ! function_exists( 'sophia_after_dark_main_header_end' ) ) :
/**
* function to end header section
*/
function sophia_after_dark_main_header_end() {
echo '</div><!--.mt-logo-row-wrapper -->';
echo '</header><!-- #masthead -->';
}
endif;
/**
* manage functions at sophia_after_dark_main_header hook
*/
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_main_header_start', 5 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_site_branding', 10 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_wrapper_start', 15 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_header_main_menu', 20 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_icon_wrapper_start', 25 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_social_icons', 30 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_search_icon', 35 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_icon_wrapper_end', 40 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_menu_wrapper_end', 45 );
add_action( 'sophia_after_dark_main_header', 'sophia_after_dark_main_header_end', 50 );
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_header_categories_lists_content' ) ) :
/**
* function to display categories lists
*/
function sophia_after_dark_header_categories_lists_content() {
$get_categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) );
?>
<div class="mt-header-cat-list-wrapper">
<ul class="sticky-header-sidebar-menu mt-slide-cat-lists">
<?php
$count = 1;
$cat_list_items = apply_filters( 'sophia_after_dark_menu_cat_list_items', 5 );
foreach ( $get_categories as $category ) {
$cat_link = get_category_link( $category->term_id );
$cat_name = $category->name;
$cat_count = $category->count;
if ( $count <= $cat_list_items ) {
?>
<li class="cat-item">
<a href="<?php echo esc_url( $cat_link ); ?>">
<?php
echo esc_html( $cat_name );
echo '<span>'. esc_html( $cat_count ) .'</span>';
?>
</a>
</li>
<?php
}
}
?>
</ul><!-- .mt-slide-cat-lists -->
</div><!-- .mt-header-cat-list-wrapper -->
<?php
}
endif;
add_action( 'sophia_after_dark_header_categories_lists', 'sophia_after_dark_header_categories_lists_content', 10 );
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_header_author_box_content' ) ) :
/**
* function to display author info
*/
function sophia_after_dark_header_author_box_content() {
$sophia_after_dark_user_id = apply_filters( 'sophia_after_dark_header_user_id', 1 );
?>
<div itemscope itemtype="http://schema.org/Person" class="sticky-header-sidebar-author author-bio-wrap">
<div class="author-avatar"><?php echo get_avatar( $sophia_after_dark_user_id, '150' ); ?></div>
<h3 itemprop="name" class="author-name"><?php echo esc_html( get_the_author_meta( 'nicename', $sophia_after_dark_user_id ) ); ?></h3>
<div class="author-description"><?php echo wp_kses_post( wpautop( get_the_author_meta( 'description', $sophia_after_dark_user_id ) ) ); ?></div>
<div class="author-social">
<?php sophia_after_dark_social_media_content(); ?>
</div><!-- .author-social -->
</div><!-- .author-bio-wrap -->
<?php
}
endif;
add_action( 'sophia_after_dark_header_author_box', 'sophia_after_dark_header_author_box_content', 10 );
/*----------------------------------------------------------------------------------------------------------------------------------*/
add_action( 'sophia_after_dark_scroll_top', 'sophia_after_dark_scroll_top_content', 10 );
if ( ! function_exists( 'sophia_after_dark_scroll_top_content' ) ) :
/**
* Function for scroll top
*
* @since 1.0.0
*/
function sophia_after_dark_scroll_top_content() {
$sophia_after_dark_scroll_top_text = apply_filters( 'sophia_after_dark_scroll_top_text', __( 'Back To Top', 'sophia-after-dark' ) );
echo '<div id="mt-scrollup" class="animated arrow-hide">'. esc_html( $sophia_after_dark_scroll_top_text ) .'</div>';
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_innerpage_header_start' ) ) :
/**
* function to manage starting div of section
*/
function sophia_after_dark_innerpage_header_start() {
$inner_header_attribute = '';
$inner_header_attribute = apply_filters( 'sophia_after_dark_inner_header_style_attribute', $inner_header_attribute );
if ( !empty( $inner_header_attribute ) ) {
$header_class = 'has-bg-img';
} else {
$header_class = 'no-bg-img';
}
?>
<div class="custom-header <?php echo esc_attr( $header_class ); ?>" <?php echo ( ! empty( $inner_header_attribute ) ) ? ' style="' . esc_attr( $inner_header_attribute ) . '" ' : ''; ?>>
<div class="mt-container">
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_innerpage_header_title' ) ) :
/**
* function to display the page title
*/
function sophia_after_dark_innerpage_header_title() {
if ( is_single() || is_page() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_archive() ) {
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
} elseif ( is_search() ) {
?>
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'sophia-after-dark' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<?php
} elseif ( is_404() ) {
echo '<h1 class="entry-title">'. esc_html( 'Error 404', 'sophia-after-dark' ) .'</h1>';
} elseif ( is_home() ) {
$page_for_posts_id = get_option( 'page_for_posts' );
$page_title = get_the_title( $page_for_posts_id );
?>
<h1 class="entry-title"><?php echo esc_html( $page_title ); ?></h1>
<?php
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_breadcrumb_content' ) ) :
/**
* function to manage the breadcrumbs content
*/
function sophia_after_dark_breadcrumb_content() {
$sophia_after_dark_breadcrumb_option = get_theme_mod( 'sophia_after_dark_enable_breadcrumb_option', true );
if ( false === $sophia_after_dark_breadcrumb_option ) {
return;
}
?>
<nav id="breadcrumb" class="mt-breadcrumb">
<?php
breadcrumb_trail( array(
'container' => 'div',
'before' => '<div class="mt-container">',
'after' => '</div>',
'show_browse' => false,
) );
?>
</nav>
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_innerpage_header_end' ) ) :
/**
* function to manage ending div of section
*/
function sophia_after_dark_innerpage_header_end() {
?>
</div><!-- .mt-container -->
</div><!-- .custom-header -->
<?php
}
endif;
/**
* manage the function at sophia_after_dark_innerpage_header hook
*/
add_action( 'sophia_after_dark_innerpage_header', 'sophia_after_dark_innerpage_header_start', 5 );
add_action( 'sophia_after_dark_innerpage_header', 'sophia_after_dark_innerpage_header_title', 10 );
add_action( 'sophia_after_dark_innerpage_header', 'sophia_after_dark_breadcrumb_content', 15 );
add_action( 'sophia_after_dark_innerpage_header', 'sophia_after_dark_innerpage_header_end', 20 );
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
/**
* Function displaying front slider section
*
*/
function sophia_after_dark_front_slider() {
$sophia_after_dark_section_slider_option = get_theme_mod( 'sophia_after_dark_section_slider_option', false );
if ( false == $sophia_after_dark_section_slider_option ) {
return;
}
$sophia_after_dark_section_top_featured_posts_option = get_theme_mod( 'sophia_after_dark_section_top_featured_posts_option', true );
if ( true === $sophia_after_dark_section_top_featured_posts_option ) {
$slider_class = 'has-featured-slider default-width--slider';
} else {
$slider_class = 'no-featured-slider full-width--slider';
}
?>
<div class="front-slider-wrapper <?php echo esc_attr( $slider_class ); ?>">
<div class="mt-container">
<div class="front-slider-block">
<div class="front-slider cS-hidden">
<?php
$slider_cat_slug = get_theme_mod( 'sophia_after_dark_section_slider_cat', '' );
$slide_post_count = apply_filters( 'sophia_after_dark_slider_post_count', 3 );
$slider_args = array(
'category_name' => esc_attr( $slider_cat_slug ),
'meta_key' => '_thumbnail_id',
'posts_per_page' => absint( $slide_post_count )
);
$slider_post_query = new WP_Query( $slider_args );
if ( $slider_post_query->have_posts() ) :
while ( $slider_post_query-> have_posts() ) :
$slider_post_query -> the_post();
$post_id = get_the_ID();
$image_url = get_the_post_thumbnail_url( $post_id, 'large' );
if ( ! empty( $image_url ) ) {
$slider_style = 'style="background:url('. esc_url( $image_url ) .') no-repeat scroll center center; background-size:cover"';
} else {
$slider_style = '';
}
?>
<div class="slider-post-wrap" <?php echo $slider_style; ?>>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"></a>
</div>
<div class="post-info-wrap">
<div class="post-cat"><?php sophia_after_dark_article_categories_list(); ?></div>
<div class="entry-meta">
<?php
sophia_after_dark_posted_on();
sophia_after_dark_posted_by();
?>
</div>
<?php the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); ?>
</div><!--.post-info-wrap -->
</div><!-- .slider-post-wrap -->
<?php
endwhile;
endif;
?>
</div><!-- .front-slider -->
</div> <!-- .front-slider-block -->
<?php
if ( true == $sophia_after_dark_section_top_featured_posts_option ) {
$sophia_after_dark_top_featured_posts_title = get_theme_mod( 'sophia_after_dark_top_featured_posts_title', __( 'Featured News', 'sophia-after-dark' ) );
echo '<div class="top-featured-post-main-wrapper">';
if ( ! empty( $sophia_after_dark_top_featured_posts_title ) ) {
echo '<div class="features-post-title">'.esc_html( $sophia_after_dark_top_featured_posts_title ).'</div><!-- .features-post-title -->';
}
$sophia_after_dark_top_featured_post_order = get_theme_mod( 'sophia_after_dark_top_featured_post_order', 'default' );
$featured_posts_per_page = apply_filters( 'sophia_after_dark_featured_post_count', 5 );
$top_featured_post_args = array(
'post_type' => 'post',
'posts_per_page' => absint( $featured_posts_per_page ),
);
if ( 'random' == $sophia_after_dark_top_featured_post_order ) {
$top_featured_post_args['orderby'] = 'rand';
}
$top_featured_post_query = new WP_Query( $top_featured_post_args );
if ( $top_featured_post_query -> have_posts() ) :
echo '<div class="top-featured-post-wrap">';
$featured_post_count = 1;
while ( $top_featured_post_query -> have_posts() ) : $top_featured_post_query -> the_post();
?>
<div id="post-<?php the_ID(); ?>" class="mt-single-post-wrap mt-clearfix">
<div class="post-thumbnail">
<span class="post-number"><?php echo absint( $featured_post_count ); ?></span>
<figure style="background: no-repeat center top url(<?php echo get_the_post_thumbnail_url(); ?>); background-size: cover; height: 100px;">
</figure>
</div>
<div class="mt-post-content">
<div class="entry-meta">
<?php
sophia_after_dark_posted_on();
sophia_after_dark_posted_by();
?>
</div>
<header class="entry-header">
<?php the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); ?>
</header><!-- .entry-header -->
</div>
</div><!-- #post-<?php the_ID(); ?> -->
<?php
$featured_post_count ++;
endwhile;
echo '</div><!-- .top-featured-post-wrap -->';
endif;
echo '</div><!-- .top-featured-post-main-wrapper -->';
}
?>
</div>
</div><!-- .front-slider-wrapper -->
<?php
}
endif;
add_action( 'sophia_after_dark_front_slider_section', 'sophia_after_dark_front_slider' );
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_footer_start' ) ) :
/**
* function to start footer wrapper
*/
function sophia_after_dark_footer_start() {
echo '<footer itemscope id="colophon" class="site-footer">';
}
endif;
if ( ! function_exists( 'sophia_after_dark_footer_sidebar' ) ) :
/**
* function to display footer widget area
*/
function sophia_after_dark_footer_sidebar() {
$sophia_after_dark_footer_widget_option = get_theme_mod( 'sophia_after_dark_enable_footer_widget_area', true );
if ( true === $sophia_after_dark_footer_widget_option ) {
get_sidebar( 'footer' );
}
}
endif;
if ( ! function_exists( 'sophia_after_dark_bottom_footer' ) ) :
/**
* function to display bottom footer section
*/
function sophia_after_dark_bottom_footer() {
?>
<div id="bottom-footer">
<div class="mt-container">
<?php
$sophia_after_dark_enable_footer_menu = get_theme_mod( 'sophia_after_dark_enable_footer_menu', true );
if ( true === $sophia_after_dark_enable_footer_menu ) {
?>
<nav id="footer-navigation" class="footer-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'footer_menu',
'menu_id' => 'footer-menu',
'fallback_cb' => false,
'depth' => 1
) );
?>
</nav><!-- #footer-navigation -->
<?php
}
?>
<div class="site-info">
<span class="mt-copyright-text">
<?php
$sophia_after_dark_footer_copyright = get_theme_mod( 'sophia_after_dark_footer_copyright', __( 'Sophia After Dark', 'sophia-after-dark' ) );
echo esc_html( $sophia_after_dark_footer_copyright );
?>
</span>
<br>
<span class="mt-disclaimer-text">
<?php
$sophia_after_dark_footer_disclaimer = get_theme_mod( 'sophia_after_dark_footer_disclaimer', __( 'Sophia After Dark', 'sophia-after-dark' ) );
echo esc_html( $sophia_after_dark_footer_disclaimer );
?>
</span>
</div><!-- .site-info -->
</div><!-- .mt-container -->
</div><!-- #bottom-footer -->
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_footer_end' ) ) :
/**
* function to end footer wrapper
*/
function sophia_after_dark_footer_end() {
echo '</footer><!-- #colophon -->';
}
endif;
/**
* manage the function at sophia_after_dark_footer hook
*/
add_action( 'sophia_after_dark_footer', 'sophia_after_dark_footer_start', 5 );
add_action( 'sophia_after_dark_footer', 'sophia_after_dark_footer_sidebar', 10 );
add_action( 'sophia_after_dark_footer', 'sophia_after_dark_bottom_footer', 15 );
add_action( 'sophia_after_dark_footer', 'sophia_after_dark_footer_end', 20 );

View File

@ -0,0 +1,116 @@
<?php
/**
* Managed the custom functions and hooks for top header of theme.
*
* @package Sophia After Dark
* @since 1.0.0
*/
/*----------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_top_header_start' ) ) :
/**
* function to start top header section
*/
function sophia_after_dark_top_header_start() {
echo '<div id="top-header" class="top-header-wrap mt-clearfix">';
echo '<div class="mt-container">';
}
endif;
if ( ! function_exists( 'sophia_after_dark_top_header_end' ) ) :
/**
* function to end top header section
*/
function sophia_after_dark_top_header_end() {
echo '</div><!-- mt-container -->';
echo '</div><!-- #top-header -->';
}
endif;
if ( ! function_exists( 'sophia_after_dark_trending_section' ) ) :
/**
* function to display the trending tags sections
*
*/
function sophia_after_dark_trending_section() {
$sophia_after_dark_enable_trending = get_theme_mod( 'sophia_after_dark_enable_trending', false );
if ( false === $sophia_after_dark_enable_trending ){
return;
}
$sophia_after_dark_enable_trending_tag_before_icon = get_theme_mod( 'sophia_after_dark_enable_trending_tag_before_icon', true );
if ( $sophia_after_dark_enable_trending_tag_before_icon === true ){
$before_icon = 'tag-before-icon';
}else{
$before_icon = '';
}
$trending_label = get_theme_mod( 'sophia_after_dark_trending_label', __( 'Trending Now', 'sophia-after-dark' ) );
?>
<div class="trending-wrapper <?php echo esc_html( $before_icon ); ?>">
<span class="wrap-label"><i class="fa fa-bolt" aria-hidden="true"></i> <?php echo esc_html( $trending_label ); ?></span>
<div class="tags-wrapper">
<?php
$sophia_after_dark_trending_tags_orderby = get_theme_mod( 'sophia_after_dark_trending_tags_orderby', '' );
$sophia_after_dark_trending_tags_count = get_theme_mod( 'sophia_after_dark_trending_tags_count', '5' );
$get_tags_lists = get_tags( array(
'order' => 'DESC',
'orderby'=> esc_attr( $sophia_after_dark_trending_tags_orderby ),
'number' => absint( $sophia_after_dark_trending_tags_count ),
));
if ( !empty( $get_tags_lists ) ) {
echo '<span class="head-tags-links">';
foreach( $get_tags_lists as $tag ) {
echo '<a href="'.esc_html( get_tag_link( $tag->term_id ) ).'" rel="tag">'. esc_html( $tag->name ) .'</a>';
}
echo '</span>';
}
?>
</div><!-- .tags-wrapper -->
</div><!-- .trending-wrapper -->
<?php
}
endif;
if ( ! function_exists( 'sophia_after_dark_top_header_nav' ) ) :
/**
* function to display top nav menu.
*/
function sophia_after_dark_top_header_nav() {
$sophia_after_dark_enable_live_now = get_theme_mod( 'sophia_after_dark_enable_live_now', false );
if ( true === $sophia_after_dark_enable_live_now ) {
$sophia_after_dark_live_now_label = get_theme_mod( 'sophia_after_dark_live_now_label', __( 'Live Now', 'sophia-after-dark' ) );
$sophia_after_dark_live_now_link = get_theme_mod( 'sophia_after_dark_live_now_link' );
?>
<div class="mt-live-link">
<a href="<?php echo esc_url( $sophia_after_dark_live_now_link ); ?>" target="_blank"> <i class="fa fa-play-circle-o" aria-hidden="true"></i><?php echo esc_html( $sophia_after_dark_live_now_label ); ?></a>
</div>
<?php
}
?>
<div class="top-header-nav">
<nav itemscope id="top-navigation" class="main-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'top_header_menu',
'menu_id' => 'top-header-menu',
'fallback_cb' => false,
) );
?>
</nav><!-- #site-navigation -->
</div><!-- .top-header-nav -->
<?php
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------*/
add_action( 'sophia_after_dark_top_header', 'sophia_after_dark_top_header_start', 5 );
add_action( 'sophia_after_dark_top_header', 'sophia_after_dark_trending_section', 10 );
add_action( 'sophia_after_dark_top_header', 'sophia_after_dark_top_header_nav', 20 );
add_action( 'sophia_after_dark_top_header', 'sophia_after_dark_top_header_end', 50 );

60
inc/jetpack.php Normal file
View File

@ -0,0 +1,60 @@
<?php
/**
* Jetpack Compatibility File
*
* @link https://jetpack.com
*
* @package Color Blo Dark
* @since 1.0.0
*/
/**
* Jetpack setup function.
*
* See: https://jetpack.com/support/infinite-scroll
* See: https://jetpack.com/support/responsive-videos/
* See: https://jetpack.com/support/content-options/
*/
function sophia_after_dark_jetpack_setup() {
// Add theme support for Infinite Scroll.
add_theme_support( 'infinite-scroll', array(
'container' => 'main',
'render' => 'sophia_after_dark_infinite_scroll_render',
'footer' => 'page'
) );
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
// Add theme support for Content Options
add_theme_support( 'jetpack-content-options', array(
'post-details' => array(
'stylesheet' => 'sophia-after-dark-style',
'date' => '.posted-on',
'categories' => '.cat-links',
'tags' => '.tags-links',
'author' => '.byline',
'comment' => '.comments-link',
),
'featured-images' => array(
'archive' => true,
'post' => true,
'page' => true,
),
) );
}
add_action( 'after_setup_theme', 'sophia_after_dark_jetpack_setup' );
/**
* Custom render function for Infinite Scroll
*/
function sophia_after_dark_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_type() );
endif;
}
}

View File

@ -0,0 +1,116 @@
<?php
/**
* Functions for rendering meta boxes in post/page
*
* @package Sophia After Dark
* @since 1.0.0
*/
/*----------------------------------------------------------------------------------------------------------------------------------------*/
add_action( 'add_meta_boxes', 'sophia_after_dark_sidebar_metaboxes', 10, 2 );
function sophia_after_dark_sidebar_metaboxes() {
add_meta_box(
'sophia_after_dark_post_sidebar',
__( 'Sidebar Layout', 'sophia-after-dark' ),
'sophia_after_dark_sidebar_callback',
'post',
'normal',
'default'
);
add_meta_box(
'sophia_after_dark_post_sidebar',
__( 'Sidebar Layout', 'sophia-after-dark' ),
'sophia_after_dark_sidebar_callback',
'page',
'normal',
'default'
);
}
/*----------------------------------------------------------------------------------------------------------------------------------------*/
function sophia_after_dark_sidebar_callback( $post ) {
// Setup our options.
$sophia_after_dark_page_sidebar_option = array(
'default-sidebar' => array(
'id' => 'post-default-sidebar',
'value' => 'layout--default-sidebar',
'label' => __( 'Default Sidebar', 'sophia-after-dark' ),
'thumbnail' => get_template_directory_uri() . '/assets/images/default-sidebar.png'
),
'left-sidebar' => array(
'id' => 'post-left-sidebar',
'value' => 'left-sidebar',
'label' => __( 'Left sidebar', 'sophia-after-dark' ),
'thumbnail' => get_template_directory_uri() . '/assets/images/left-sidebar.png'
),
'right-sidebar' => array(
'id' => 'post-right-sidebar',
'value' => 'right-sidebar',
'label' => __( 'Right sidebar', 'sophia-after-dark' ),
'thumbnail' => get_template_directory_uri() . '/assets/images/right-sidebar.png'
),
'no-sidebar' => array(
'id' => 'post-no-sidebar',
'value' => 'no-sidebar',
'label' => __( 'No sidebar Full width', 'sophia-after-dark' ),
'thumbnail' => get_template_directory_uri() . '/assets/images/no-sidebar.png'
),
'no-sidebar-center' => array(
'id' => 'post-no-sidebar-center',
'value' => 'no-sidebar-center',
'label' => __( 'No sidebar Content Centered', 'sophia-after-dark' ),
'thumbnail' => get_template_directory_uri() . '/assets/images/no-sidebar-center.png'
)
);
// Check for previously set.
$post_sidebar_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
// If it is then we use it otherwise set to default.
$post_sidebar_layout = ( $post_sidebar_layout ) ? $post_sidebar_layout : 'layout--default-sidebar';
// Create our nonce field.
wp_nonce_field( 'sophia_after_dark_nonce_' . basename( __FILE__ ) , 'sophia_after_dark_sidebar_layout_nonce' );
?>
<div class="mt-meta-options-wrap">
<div class="buttonset">
<?php foreach ( $sophia_after_dark_page_sidebar_option as $field ) { ?>
<input type="radio" id="<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" name="sophia_after_dark_post_sidebar_layout" <?php checked( $field['value'], $post_sidebar_layout ); ?> />
<label for="<?php echo esc_attr( $field['id'] ); ?>">
<span class="screen-reader-text"><?php echo esc_html( $field['label'] ); ?></span>
<img src="<?php echo esc_url( $field['thumbnail'] ); ?>" title="<?php echo esc_attr( $field['label'] ); ?>" alt="<?php echo esc_attr( $field['label'] ); ?>" />
</label>
<?php } ?>
</div><!-- .buttonset -->
</div><!-- .mt-meta-options-wrap -->
<?php
}
/*----------------------------------------------------------------------------------------------------------------------------------------*/
add_action( 'save_post', 'sophia_after_dark_save_post_meta' );
function sophia_after_dark_save_post_meta( $post_id ) {
// Checks save status
$is_autosave = wp_is_post_autosave( $post_id );
$is_revision = wp_is_post_revision( $post_id );
$is_valid_nonce = ( isset( $_POST['sophia_after_dark_sidebar_layout_nonce'] ) && wp_verify_nonce( $_POST['sophia_after_dark_sidebar_layout_nonce'], 'sophia_after_dark_nonce_' . basename( __FILE__ ) ) ) ? 'true' : 'false';
// Exits script depending on save status
if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
return;
}
// Check for out input value.
if ( isset( $_POST['sophia_after_dark_post_sidebar_layout'] ) ) {
// We validate making sure that the option is something we can expect.
$value = in_array( $_POST['sophia_after_dark_post_sidebar_layout'], array( 'no-sidebar', 'left-sidebar', 'right-sidebar', 'no-sidebar-center', 'layout--default-sidebar' ) ) ? $_POST['sophia_after_dark_post_sidebar_layout'] : 'layout--default-sidebar';
// We update our post meta.
update_post_meta( $post_id, 'sophia_after_dark_post_sidebar_layout', $value );
}
}

1237
inc/mt-class-breadcrumbs.php Normal file

File diff suppressed because it is too large Load Diff

51
inc/mt-dynamic-styles.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* Dynamic styles
*
* @package Sophia After Dark
* @since 1.0.0
*
*/
add_action( 'wp_enqueue_scripts', 'sophia_after_dark_dynamic_styles' );
if ( ! function_exists( 'sophia_after_dark_dynamic_styles' ) ) :
function sophia_after_dark_dynamic_styles() {
$sophia_after_dark_primary_color = get_theme_mod( 'sophia_after_dark_primary_color', '#dd3333' );
$get_categories = get_categories( array( 'hide_empty' => 1 ) );
$output_css = '';
foreach ( $get_categories as $category ) {
$cat_color = get_theme_mod( 'sophia_after_dark_category_color_'.$category->slug, '#3b2d1b' );
$cat_hover_color = sophia_after_dark_hover_color( $cat_color, '-50' );
$cat_id = $category->term_id;
if ( !empty( $cat_color ) ) {
$output_css .= ".category-button.cbd-cat-". esc_attr( $cat_id ) ." a { background: ". esc_attr( $cat_color ) ."}\n";
$output_css .= ".category-button.cbd-cat-". esc_attr( $cat_id ) ." a:hover { background: ". esc_attr( $cat_hover_color ) ."}\n";
$output_css .= "#site-navigation ul li.cbd-cat-". esc_attr( $cat_id ) ." .menu-item-description { background: ". esc_attr( $cat_color ) ."}\n";
$output_css .= "#site-navigation ul li.cbd-cat-". esc_attr( $cat_id ) ." .menu-item-description:after { border-top-color: ". esc_attr( $cat_color ) ."}\n";
}
}
$output_css .= "a,a:hover,a:focus,a:active,.entry-cat .cat-links a:hover,.entry-cat a:hover,.entry-footer a:hover,.comment-author .fn .url:hover,.commentmetadata .comment-edit-link, #cancel-comment-reply-link, #cancel-comment-reply-link:before, .logged-in-as a,.widget a:hover, .widget a:hover::before, .widget li:hover::before,.mt-social-icon-wrap li a:hover,.mt-social-icon-wrap li a:focus,#site-navigation ul li:hover>a,#site-navigation ul li.current-menu-item>a,#site-navigation ul li.current_page_ancestor>a,#site-navigation ul li.current-menu-ancestor>a,#site-navigation ul li.current_page_item>a,#site-navigation ul li.current-menu-parent>a,#site-navigation ul li.focus>a,.banner-sub-title,.entry-title a:hover,.cat-links a:hover,.entry-footer .mt-readmore-btn:hover,.btn-wrapper a:hover,.mt-readmore-btn:hover,.navigation.pagination .nav-links .page-numbers.current, .navigation.pagination .nav-links a.page-numbers:hover,#footer-menu li a:hover,.sophia_after_dark_latest_posts .mt-post-title a:hover,#mt-scrollup:hover,.menu-toggle:hover, #top-navigation ul li a:hover,.mt-search-icon:hover, .entry-meta a:hover, .front-slider-block .banner-title a:hover, .post-info-wrap .entry-meta a:hover, .single .mt-single-related-posts .entry-title a:hover, .breadcrumbs .trail-items li a:hover, .wrap-label i,.has-thumbnail .post-info-wrap .entry-title a:hover,.front-slider-block .post-info-wrap .entry-title a:hover,#top-footer a:hover{ color: ". esc_attr( $sophia_after_dark_primary_color ) ."}\n";
$output_css .= ".widget_search .search-submit,.widget_search .search-submit:hover,.navigation.pagination .nav-links .page-numbers.current, .navigation.pagination .nav-links a.page-numbers:hover, .error-404.not-found, .sophia_after_dark_social_media a:hover, .custom-header,.widget_tag_cloud .tagcloud a:hover,.widget.widget_tag_cloud a:hover { border-color: ". esc_attr( $sophia_after_dark_primary_color ) ."}\n";
$output_css .= ".front-slider-block .lSAction > a:hover, .top-featured-post-wrap .post-thumbnail .post-number, .post-cats-list a, #site-navigation .menu-item-description, article .post-thumbnail::before, #secondary .widget .widget-title::before, .mt-related-post-title::before, #colophon .widget .widget-title::before, .features-post-title::before, .mt-menu-search .mt-form-wrap .search-form .search-submit,.mt-live-link a,.widget_tag_cloud .tagcloud a:hover,.widget.widget_tag_cloud a:hover { background: ". esc_attr( $sophia_after_dark_primary_color ) ."}\n";
$output_css .= ".edit-link .post-edit-link,.reply .comment-reply-link,.widget_search .search-submit, .mt-menu-search .mt-form-wrap .search-form .search-submit:hover, article.sticky::before{ background: ". esc_attr( $sophia_after_dark_primary_color ) ."}\n";
$output_css .= ".mt-menu-search .mt-form-wrap .search-form .search-field:focus{ outline-color: ". esc_attr( $sophia_after_dark_primary_color ) ."}\n";
$slider_bg_image = get_theme_mod( 'sophia_after_dark_slider_bg_image' );
if ( !empty( $slider_bg_image ) ) {
$output_css .= ".front-slider-wrapper{background: url(". esc_url( $slider_bg_image ) .") no-repeat fixed center center/cover}\n";
}
$refine_output_css = sophia_after_dark_css_strip_whitespace( $output_css );
wp_add_inline_style( 'sophia-after-dark-style', $refine_output_css );
}
endif;

431
inc/template-functions.php Normal file
View File

@ -0,0 +1,431 @@
<?php
/**
* Functions which enhance the theme by hooking into WordPress
*
* @package Sophia After Dark
* @since 1.0.0
*/
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function sophia_after_dark_body_classes( $classes ) {
global $post;
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
// Adds a class of no-sidebar when there is no sidebar present.
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
$classes[] = 'no-sidebar';
}
$sophia_after_dark_site_layout = get_theme_mod( 'sophia_after_dark_site_layout', 'site-layout--wide' );
$classes[] = esc_attr( $sophia_after_dark_site_layout );
/**
* Add classes about style and sidebar layout for archive, post and page
*/
if ( is_archive() || is_home() || is_search()) {
$archive_sidebar_layout = get_theme_mod( 'sophia_after_dark_archive_sidebar_layout', 'no-sidebar' );
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
$classes[] = esc_attr( $archive_sidebar_layout );
$classes[] = esc_attr( $archive_style );
} elseif ( is_single() ) {
$single_post_sidebar_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
if ( 'layout--default-sidebar' !== $single_post_sidebar_layout && !empty( $single_post_sidebar_layout ) ) {
$classes[] = esc_attr( $single_post_sidebar_layout );
} else {
$posts_sidebar_layout = get_theme_mod( 'sophia_after_dark_posts_sidebar_layout', 'right-sidebar' );
$classes[] = esc_attr( $posts_sidebar_layout );
}
} elseif ( is_page() ) {
$single_page_sidebar_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
if ( 'layout--default-sidebar' !== $single_page_sidebar_layout && !empty( $single_page_sidebar_layout ) ) {
$classes[] = esc_attr( $single_page_sidebar_layout );
} else {
$pages_sidebar_layout = get_theme_mod( 'sophia_after_dark_pages_sidebar_layout', 'right-sidebar' );
$classes[] = esc_attr( $pages_sidebar_layout );
}
}
return $classes;
}
add_filter( 'body_class', 'sophia_after_dark_body_classes' );
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function sophia_after_dark_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">';
}
}
add_action( 'wp_head', 'sophia_after_dark_pingback_header' );
/*-----------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_fonts_url' ) ) :
/**
* Register Google fonts for Sophia After Dark.
*
* @return string Google fonts URL for the theme.
* @since 1.0.0
*/
function sophia_after_dark_fonts_url() {
$fonts_url = '';
$font_families = array();
/*
* Translators: If there are characters in your language that are not supported
* byJosefin Sans translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Josefin Sans font: on or off', 'sophia-after-dark' ) ) {
$font_families[] = 'Josefin Sans:400,700';
}
/*
* Translators: If there are characters in your language that are not supported
* by Poppins, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Poppins font: on or off', 'sophia-after-dark' ) ) {
$font_families[] = 'Poppins:300,400,400i,500,700';
}
if ( $font_families ) {
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.bunny.net/css' );
}
return $fonts_url;
}
endif;
/*-----------------------------------------------------------------------------------------------------------------------*/
/**
* Enqueue scripts and styles for only admin
*
* @since 1.0.0
*/
add_action( 'admin_enqueue_scripts', 'sophia_after_dark_admin_scripts' );
function sophia_after_dark_admin_scripts( $hook ) {
global $sophia_after_dark_theme_version;
if ( 'widgets.php' != $hook && 'customize.php' != $hook && 'edit.php' != $hook && 'post.php' != $hook && 'post-new.php' != $hook ) {
return;
}
wp_enqueue_script( 'jquery-ui-button' );
wp_enqueue_script( 'sophia-after-dark--admin-script', get_template_directory_uri() .'/assets/js/mt-admin-scripts.js', array( 'jquery' ), esc_attr( $sophia_after_dark_theme_version ), true );
wp_enqueue_style( 'sophia-after-dark--admin-style', get_template_directory_uri() . '/assets/css/mt-admin-styles.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
}
/*----------------------------------------------------------------------------------------------------------------------------------------*/
/**
* Enqueue scripts and styles.
*/
function sophia_after_dark_scripts() {
global $sophia_after_dark_theme_version;
wp_enqueue_style( 'sophia-after-dark-fonts', sophia_after_dark_fonts_url(), array(), null );
wp_enqueue_style( 'lightslider-style', get_template_directory_uri() .'/assets/library/lightslider/css/lightslider.min.css', array(), '' );
wp_enqueue_style( 'animate', get_template_directory_uri(). '/assets/library/animate/animate.min.css', array(), '3.5.1' );
wp_enqueue_style( 'preloader', get_template_directory_uri() .'/assets/css/mt-preloader.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
wp_enqueue_style( 'sophia-after-dark-style', get_stylesheet_uri(), array(), esc_attr( $sophia_after_dark_theme_version) );
wp_enqueue_style( 'sophia-after-dark-responsive-style', get_template_directory_uri(). '/assets/css/mt-responsive.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
wp_enqueue_script( 'sophia-after-dark-combine-scripts', get_template_directory_uri() .'/assets/js/mt-combine-scripts.js', array('jquery'), esc_attr( $sophia_after_dark_theme_version ), true );
wp_enqueue_script( 'sophia-after-dark-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), esc_attr( $sophia_after_dark_theme_version ), true );
wp_enqueue_script( 'sophia-after-dark-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), esc_attr( $sophia_after_dark_theme_version ), true );
wp_enqueue_script( 'sophia-after-dark-custom-scripts', get_template_directory_uri() .'/assets/js/mt-custom-scripts.js', array('jquery'), esc_attr( $sophia_after_dark_theme_version ), true );
$sophia_after_dark_enable_sticky_menu = get_theme_mod( 'sophia_after_dark_enable_sticky_menu', true );
if ( true === $sophia_after_dark_enable_sticky_menu ) {
$sticky_value = 'on';
} else {
$sticky_value = 'off';
}
$sophia_after_dark_enable_wow_animation = get_theme_mod( 'sophia_after_dark_enable_wow_animation', true );
if ( true === $sophia_after_dark_enable_wow_animation ) {
$wow_value = 'on';
} else {
$wow_value = 'off';
}
wp_localize_script( 'sophia-after-dark-custom-scripts', 'sophia_after_darkObject', array(
'menu_sticky' => $sticky_value,
'wow_effect' => $wow_value
) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'sophia_after_dark_scripts' );
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_preloader' ) ) :
/**
* preloader function
*
* @since 1.0.0
*/
function sophia_after_dark_preloader() {
$sophia_after_dark_enable_preloader = get_theme_mod( 'sophia_after_dark_enable_preloader', true );
if ( false === $sophia_after_dark_enable_preloader ){
return;
}
?>
<div id="preloader-background">
<div class="preloader-wrapper">
<div class="sk-spinner sk-spinner-pulse"></div>
</div><!-- .preloader-wrapper -->
</div><!-- #preloader-background -->
<?php
}
endif;
add_action( 'sophia_after_dark_before_page', 'sophia_after_dark_preloader', 5 );
if ( ! function_exists( 'sophia_after_dark_font_awesome_social_icon_array' ) ) :
/**
* Define font awesome social media icons
*
* @return array();
* @since 1.0.0
*/
function sophia_after_dark_font_awesome_social_icon_array() {
return array(
"fa fa-facebook-square","fa fa-facebook-f","fa fa-facebook","fa fa-facebook-official","fa fa-twitter-square","fa fa-twitter","fa fa-yahoo","fa fa-google","fa fa-google-wallet","fa fa-google-plus-circle","fa fa-google-plus-official","fa fa-instagram","fa fa-linkedin-square","fa fa-linkedin","fa fa-pinterest-p","fa fa-pinterest","fa fa-pinterest-square","fa fa-google-plus-square","fa fa-google-plus","fa fa-youtube-square","fa fa-youtube","fa fa-youtube-play","fa fa-vimeo","fa fa-vimeo-square",
);
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_social_media_content' ) ) :
/**
* function to display the social icons
*/
function sophia_after_dark_social_media_content() {
$defaults_icons = json_encode( array(
array(
'social_icon' => 'fa fa-twitter',
'social_url' => '#',
),
array(
'social_icon' => 'fa fa-pinterest',
'social_url' => '#',
)
)
);
$sophia_after_dark_social_icons = get_theme_mod( 'sophia_after_dark_social_icons', $defaults_icons );
$social_icons = json_decode( $sophia_after_dark_social_icons );
if ( ! empty( $social_icons ) ) {
?>
<ul class="mt-social-icon-wrap">
<?php
foreach ( $social_icons as $social_icon ) {
if ( ! empty( $social_icon->social_url ) ) {
?>
<li class="mt-social-icon">
<a href="<?php echo esc_url( $social_icon->social_url ); ?>" target="_blank">
<i class="<?php echo esc_attr( $social_icon->social_icon ); ?>"></i>
</a>
</li>
<?php
}
}
?>
</ul>
<?php
}
}
endif;
/*-----------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_hover_color' ) ) :
/**
* Generate darker color
* Source: http://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
*
* @since 1.0.0
*/
function sophia_after_dark_hover_color( $hex, $steps ) {
// Steps should be between -255 and 255. Negative = darker, positive = lighter
$steps = max( -255, min( 255, $steps ) );
// Normalize into a six character long hex string
$hex = str_replace( '#', '', $hex );
if ( strlen( $hex ) == 3) {
$hex = str_repeat( substr( $hex,0,1 ), 2 ).str_repeat( substr( $hex, 1, 1 ), 2 ).str_repeat( substr( $hex,2,1 ), 2 );
}
// Split into three parts: R, G and B
$color_parts = str_split( $hex, 2 );
$return = '#';
foreach ( $color_parts as $color ) {
$color = hexdec( $color ); // Convert to decimal
$color = max( 0, min( 255, $color + $steps ) ); // Adjust color
$return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code
}
return $return;
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_select_categories_list' ) ) :
/**
* function to return category lists
*
* @return $sophia_after_dark_categories_list in array
*/
function sophia_after_dark_select_categories_list() {
$sophia_after_dark_get_categories = get_categories( array( 'hide_empty' => 0 ) );
$sophia_after_dark_categories_list[''] = __( 'Select Category', 'sophia-after-dark' );
foreach ( $sophia_after_dark_get_categories as $category ) {
$sophia_after_dark_categories_list[esc_attr( $category->slug )] = esc_html( $category->cat_name );
}
return $sophia_after_dark_categories_list;
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_is_sidebar_layout' ) ) :
/**
* Checks if the current page matches the given layout
*
* @return string $layout layout of current page.
*/
function sophia_after_dark_is_sidebar_layout() {
global $post;
$layout = '';
if ( is_archive() || is_home() ) {
$layout = get_theme_mod( 'sophia_after_dark_archive_sidebar_layout', 'no-sidebar' );
} elseif ( is_single() ) {
$single_post_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
if ( 'layout--default-sidebar' !== $single_post_layout ) {
$layout = $single_post_layout;
} else {
$layout = get_theme_mod( 'sophia_after_dark_posts_sidebar_layout', 'right-sidebar' );
}
} elseif ( is_page() ) {
$single_page_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
if ( 'layout--default-sidebar' !== $single_page_layout ) {
$layout = $single_page_layout;
} else {
$layout = get_theme_mod( 'sophia_after_dark_pages_sidebar_layout', 'right-sidebar' );
}
}
return $layout;
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_inner_header_bg_image' ) ) :
/**
* Background image for inner page header
*
* @since 1.0.0
*/
function sophia_after_dark_inner_header_bg_image( $input ) {
$image_attr = array();
if ( empty( $image_attr ) ) {
// Fetch from Custom Header Image.
$image = get_header_image();
if ( ! empty( $image ) ) {
$image_attr['url'] = $image;
$image_attr['width'] = get_custom_header()->width;
$image_attr['height'] = get_custom_header()->height;
}
}
if ( ! empty( $image_attr ) ) {
$input .= 'background-image:url(' . esc_url( $image_attr['url'] ) . ');';
$input .= 'background-size:cover;';
}
return $input;
}
endif;
add_filter( 'sophia_after_dark_inner_header_style_attribute', 'sophia_after_dark_inner_header_bg_image' );
/*-----------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_css_strip_whitespace' ) ) :
/**
* Get minified css and removed space
*
* @since 1.0.0
*/
function sophia_after_dark_css_strip_whitespace( $css ){
$replace = array(
"#/\*.*?\*/#s" => "", // Strip C style comments.
"#\s\s+#" => " ", // Strip excess whitespace.
);
$search = array_keys( $replace );
$css = preg_replace( $search, $replace, $css );
$replace = array(
": " => ":",
"; " => ";",
" {" => "{",
" }" => "}",
", " => ",",
"{ " => "{",
";}" => "}", // Strip optional semicolons.
",\n" => ",", // Don't wrap multiple selectors.
"\n}" => "}", // Don't wrap closing braces.
"} " => "}\n", // Put each rule on it's own line.
);
$search = array_keys( $replace );
$css = str_replace( $search, $replace, $css );
return trim( $css );
}
endif;
/*-----------------------------------------------------------------------------------------------------------------------*/
/**
* Archive title prefix
*
*/
$archive_title_prefix_option = get_theme_mod( 'sophia_after_dark_enable_archive_title_prefix', true );
if ( false === $archive_title_prefix_option ) {
add_filter( 'get_the_archive_title', 'sophia_after_dark_archive_title_prefix' );
}
if ( ! function_exists( 'sophia_after_dark_archive_title_prefix' ) ) :
function sophia_after_dark_archive_title_prefix( $title ) {
return preg_replace( '/^\w+: /', '', $title );
}
endif;

264
inc/template-tags.php Normal file
View File

@ -0,0 +1,264 @@
<?php
/**
* Custom template tags for this theme
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package Sophia After Dark
* @since 1.0.0
*/
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time.
*/
function sophia_after_dark_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( DATE_W3C ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
'%s',
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_posted_by' ) ) :
/**
* Prints HTML with meta information for the current author.
*/
function sophia_after_dark_posted_by() {
echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="'. esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) .'">'. esc_html( get_the_author() ) .'</a></span></span>'; // WPCS: XSS OK.
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_posted_comments' ) ) :
/**
* Show comment count and leave comment link if no comments are posted
*/
function sophia_after_dark_posted_comments() {
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link(
sprintf(
wp_kses(
/* translators: %s: post title */
__( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', 'sophia-after-dark' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
echo '</span>';
}
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function sophia_after_dark_entry_footer() {
// Hide tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'sophia-after-dark' ) );
if ( $tags_list ) {
/* translators: 1: list of tags. */
printf( '<span class="tags-links">' . esc_html__( 'Tagged&#58; %1$s', 'sophia-after-dark' ) . '</span>', $tags_list ); // WPCS: XSS OK.
}
}
if ( 'post' === get_post_type() && ! is_single() ) {
$sophia_after_dark_archive_read_more = get_theme_mod( 'sophia_after_dark_archive_read_more', __( 'Discover', 'sophia-after-dark' ) );
?>
<a href="<?php the_permalink(); ?>" class="mt-readmore-btn"><?php echo esc_html( $sophia_after_dark_archive_read_more ); ?> <i class="fa fa-long-arrow-right"> </i></a>
<?php
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'sophia-after-dark' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_widget_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function sophia_after_dark_widget_entry_footer() {
// Hide tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'sophia-after-dark' ) );
if ( $tags_list ) {
/* translators: 1: list of tags. */
printf( '<span class="tags-links">' . esc_html__( 'Tagged&#58; %1$s', 'sophia-after-dark' ) . '</span>', $tags_list ); // WPCS: XSS OK.
}
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'sophia-after-dark' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_post_thumbnail' ) ) :
/**
* Displays an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*/
function sophia_after_dark_post_thumbnail() {
global $wp_query;
$current_post = $wp_query->current_post;
$thumbnail_size = 'post-thumbnail';
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
$sidebar_layout = sophia_after_dark_is_sidebar_layout();
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
// define image size in various section
if ( 'mt-archive--masonry-style' === $archive_style ) {
$thumbnail_size = 'sophia-after-dark-post-auto';
}elseif ( 'mt-archive--block-grid-style' === $archive_style ) {
$thumbnail_size = 'sophia-after-dark-full-width';
}
if ( is_singular() ) :
?>
<div class="post-thumbnail">
<?php the_post_thumbnail( 'sophia-after-dark-full-width' ); ?>
</div><!-- .post-thumbnail -->
<?php else : ?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
<?php
the_post_thumbnail( $thumbnail_size, array(
'alt' => the_title_attribute( array(
'echo' => false,
) ),
) );
?>
</a>
<?php
endif; // End is_singular().
}
endif;
/*----------------------------------------------------------------------------------------------------------------------------------------*/
if ( ! function_exists( 'sophia_after_dark_article_categories_list' ) ) :
/**
* Display the lists of categories at only articles
*/
function sophia_after_dark_article_categories_list() {
global $post;
$post_id = $post->ID;
$categories_list = get_the_category( $post_id );
if ( !empty( $categories_list ) ) {
?>
<div class="post-cats-list">
<?php
foreach ( $categories_list as $cat_data ) {
$cat_name = $cat_data->name;
$cat_id = $cat_data->term_id;
$cat_link = get_category_link( $cat_id );
?>
<span class="category-button cbd-cat-<?php echo esc_attr( $cat_id ); ?>"><a href="<?php echo esc_url( $cat_link ); ?>"><?php echo esc_html( $cat_name ); ?></a></span>
<?php
}
?>
</div><!-- .post-cats-list --><?php
}
}
endif;
/*
*
* Add cat id in menu class
*/
function sophia_after_dark_category_nav_class( $classes, $item ) {
if ( 'category' == $item->object ){
$category = get_category( $item->object_id );
$classes[] = 'cbd-cat-' . $category->term_id;
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'sophia_after_dark_category_nav_class', 10, 2 );

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,104 @@
<?php
/**
* This file represents an example of the code that themes would use to register
* the required plugins.
*
* It is expected that theme authors would copy and paste this code into their
* functions.php file, and amend to suit.
*
* @see http://tgmpluginactivation.com/configuration/ for detailed documentation.
*
* @package TGM-Plugin-Activation
* @subpackage Example
* @version 2.6.1 for parent theme Sophia After Dark for publication on WordPress.org
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
* @copyright Copyright (c) 2011, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
* @link https://github.com/TGMPA/TGM-Plugin-Activation
*/
/**
* Include the TGM_Plugin_Activation class.
*
* Depending on your implementation, you may want to change the include call:
*
* Parent Theme:
* require_once get_template_directory() . '/path/to/class-tgm-plugin-activation.php';
*
* Child Theme:
* require_once get_stylesheet_directory() . '/path/to/class-tgm-plugin-activation.php';
*
* Plugin:
* require_once dirname( __FILE__ ) . '/path/to/class-tgm-plugin-activation.php';
*/
require_once get_template_directory() . '/inc/tgm/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'sophia_after_dark_register_required_plugins' );
/**
* Register the required plugins for this theme.
*
* In this example, we register five plugins:
* - one included with the TGMPA library
* - two from an external source, one from an arbitrary source, one from a GitHub repository
* - two from the .org repo, where one demonstrates the use of the `is_callable` argument
*
* The variables passed to the `tgmpa()` function should be:
* - an array of plugin arrays;
* - optionally a configuration array.
* If you are not changing anything in the configuration array, you can remove the array and remove the
* variable from the function call: `tgmpa( $plugins );`.
* In that case, the TGMPA default settings will be used.
*
* This function is hooked into `tgmpa_register`, which is fired on the WP `init` action on priority 10.
*/
function sophia_after_dark_register_required_plugins() {
/*
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(
// recommend wp blog post layouts
array(
'name' => __( 'WP Blog Post Layouts', 'sophia-after-dark' ),
'slug' => 'wp-blog-post-layouts',
'required' => false,
'force_activation' => false,
'force_deactivation' => false,
),
// recommend maintenance mode
array(
'name' => __( 'Maintenance Notice', 'sophia-after-dark' ),
'slug' => 'maintenance-notice',
'required' => false,
'force_activation' => false,
'force_deactivation' => false,
),
);
/*
* Array of configuration settings. Amend each line as needed.
*
* TGMPA will start providing localized text strings soon. If you already have translations of our standard
* strings available, please help us make TGMPA even better by giving us access to these translations or by
* sending in a pull-request with .po file(s) with the translations.
*
* Only uncomment the strings in the config array if you want to customize the strings.
*/
$config = array(
'id' => 'sophia-after-dark', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
tgmpa( $plugins, $config );
}

View File

@ -0,0 +1,609 @@
/*====================================
About Page Style
====================================*/
pre.changelog {
background-color: #f5f5f5;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(50%, #f5f5f5), color-stop(50%, #e6e6e6));
background-image: -webkit-linear-gradient(#f5f5f5 50%, #e6e6e6 50%);
background-image: linear-gradient(#f5f5f5 50%, #e6e6e6 50%);
background-size: 50px 54.35px;
border: 1px solid #d4d4d4;
display: block;
line-height: 19px;
margin-bottom: 10px;
overflow: visible;
overflow-y: hidden;
padding: 0 0 0 4px;
font-size: 16px;
line-height: 1.7;
font-weight: 500;
}
pre.changelog span {
font-weight: 700;
}
.return-to-dashboard.sophia-after-dark {
clear: both;
text-align: right;
}
p.sophia-after-dark-actions a.skip {
opacity: .5;
}
table {
width: 100%;
border-collapse: collapse;
}
td {
text-align: center;
}
.about-wrap {
max-width: 100%;
}
.about-wrap table td h3 {
margin: 15px 20px;
padding-left: 20px;
text-align: left;
font-size: 16px;
text-align: center;
}
.mt-nav-content-wrap table th h3 {
margin: 10px 0;
font-weight: 700;
}
table td {
font-weight: 600;
font-size: 16px;
}
.wrap table td .dashicons {
font-size: 44px;
text-align: center;
line-height: 20px;
display: block;
width: 100%;
}
.wrap table {
border: 1px solid #e1e1e1;
border-collapse: collapse;
}
.wrap table th {
width: 33%;
}
.wrap table th:first-child {
background-color: rgba(0, 0, 0, 0.03);
}
.about-wrap table .table-feature-title>h3 {
color: #404040;
}
.mt-nav-content-wrap table th {
background: #f3f3f3;
}
tr:nth-child(2n) {
background-color: #f8f8f8;
}
.wrap table td span {
font-size: 25px;
}
.wrap table td .dashicons.dashicons-no {
color: #CE2D2D;
}
.wrap table td .dashicons.dashicons-yes {
color: #24B37E;
}
table tr .btn-wrapper {
padding: 10px 0;
}
.theme-browser {
margin-top: 15px;
}
.theme-browser .theme .theme-actions,
.theme-browser .theme.active .theme-actions {
position: absolute;
bottom: 0;
top: auto;
-webkit-transform: none;
transform: none;
right: 0;
padding: 9px 15px;
box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
}
.author-credit .theme-version {
font-style: italic;
}
.author-credit .author-link a {
text-decoration: none;
}
.author-credit .author-link {
margin: 15px 0 25px;
color: #72777c;
font-size: 16px;
font-weight: 400;
line-height: inherit;
}
/**
* RTL Ready
*/
.rtl .about-wrap .about-text {
float: right;
}
.rtl .theme-browser .theme .theme-name,
.rtl .theme-browser .theme.active .theme-name {
text-align: left;
}
.rtl .theme-browser .theme.active .theme-name {
padding-left: 5%;
}
.rtl .theme-browser .theme.active .theme-actions {
left: 90%;
}
.rtl .theme-browser .theme .theme-actions {
left: 35%;
}
@media (max-width: 1400px) {
.about-wrap h1 {
font-size: 30px;
}
.about-wrap .about-text {
font-size: 16px;
}
}
@media (max-width: 1200px) {
.about-wrap .about-text {
font-size: 14px;
}
.about-wrap table td h3,
.about-wrap table td {
font-size: 14px;
}
}
@media (max-width: 980px) {
.about-wrap h1 {
font-size: 25px;
}
.about-wrap .about-text,
.sophia-after-dark-screenshot {
float: none;
width: 100%;
}
}
/* Welcome new css */
.mt-clearfix:after {
clear: both;
content: "";
display: block;
}
.mt-theme-info {
background: #fff;
padding: 10px 20px;
}
.mt-welcome-screenshot {
width: 42%;
float: right;
border: 1px solid #e1e1e1;
padding: 10px;
margin: 0;
}
.welcome-description-wrap {
margin: 0;
}
.about-wrap .mt-about-title {
display: block;
float: left;
width: auto;
font-size: 24px;
font-weight: 700;
margin: 0;
text-transform: uppercase;
vertical-align: middle;
margin-right: 20px;
}
.about-wrap .author-credit {
display: block;
font-size: 13px;
float: right;
margin-top: 4px;
}
.author-credit .author-link {
font-size: 13px;
}
.about-wrap .about-text {
font-size: 14px;
margin: 10px 0 0;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a {
display: block;
float: none;
}
.mt-nav-tab-content-wrapper {
display: flex;
flex-wrap: wrap;
margin-top: 30px;
}
.nav-tab-wrapper {
width: 18%;
padding: 0;
border-bottom: none;
}
.mt-nav-content-wrap {
width: 82%;
background: #fff;
padding: 0px 40px 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
min-height: 500px;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a {
display: block;
float: none;
background: #fff;
border: none;
padding: 20px 20px;
border-top: 1px solid #e1e1e1;
border-left: 5px solid transparent;
margin-left: 0;
font-size: 16px;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a:first-child {
border-top: none;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a.nav-tab.nav-tab-active,
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a:hover {
border-left: 5px solid #0071A1;
color: #0071A1;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a .dashicons {
font-size: 26px;
margin: 0 15px 0px 0;
vertical-align: top;
position: relative;
top: 0;
}
.about-wrap .theme-features-wrap .two-col {
margin-left: -3%;
display: flex;
flex-wrap: wrap;
}
.about-wrap .theme-features-wrap .two-col .col {
border: 1px solid #e1e1e1;
width: 47%;
margin-left: 3%;
padding: 20px;
margin-right: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.about-wrap .theme-features-wrap .two-col .col h3 {
margin: 0;
}
.mt-theme-demos .mt-each-demo {
width: 30.33%;
margin-left: 3%;
margin-top: 3%;
margin-right: 0;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
position: relative;
}
.mt-demo-pro::after {
content: "Premium";
display: inline-block;
position: absolute;
top: 10px;
right: 0px;
background: #B71C1C;
width: 90px;
color: #fff;
text-align: center;
padding: 8px 0;
font-weight: 600;
}
.mt-theme-demos .themes {
display: flex;
flex-wrap: wrap;
margin-left: -3%;
}
.theme-id-container h2 {
font-size: 15px;
font-weight: 600;
height: 18px;
margin: 0;
padding: 15px;
box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
background: #F6F6F6;
text-align: left;
}
.theme-id-container .theme-actions {
position: absolute;
bottom: 0;
top: auto;
-webkit-transform: none;
transform: none;
right: 0;
padding: 9px 15px;
box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
}
.theme-id-container .theme-actions a {
display: inline-block;
margin: 0 5px;
float: none;
}
table tr .btn-wrapper .button {
font-size: 16px;
padding: 5px 50px;
font-weight: 600;
}
.about-wrap .mt-upgrader-title {
margin: 0 0 10px;
font-size: 22px;
font-weight: 700;
}
.mt-upgrader-pro {
background: #fff;
padding: 20px;
margin-top: 30px;
display: flex;
flex-wrap: wrap;
}
.mt-upgrade-title-wrap {
width: 85%;
}
.mt-upgrader-btn {
width: 15%;
}
.wp-core-ui .mt-upgrader-btn a {
font-size: 18px;
width: 100%;
display: block;
text-align: center;
padding: 10px 0;
font-weight: 600;
}
.welcome-panel h4 {
margin-top: 0;
}
.mt-popup-inner-wrap {
padding: 4px 30px;
margin-top: 30px;
}
.mt-dashicons-no::before,
.mt-dashicons-yes::before {
display: inline-block;
width: 30px;
height: 30px;
content: '';
background-image: url(../images/cross.png);
background-size: 30px auto;
position: relative;
top: -6px;
}
.mt-dashicons-yes::before {
background-image: url(../images/tick.png);
}
.theme-features-wrap.welcome-panel {
border: none;
padding: 0;
}
.about-wrap .about-description {
margin-top: 0;
font-weight: 700;
color: #333;
}
.about-wrap .theme-features-wrap .two-col .col li {
display: inline-block;
width: 48%;
vertical-align: top;
margin: 8px 0;
}
.about-wrap .changelog {
background-size: 0;
background: #fafafa;
border: none;
padding: 20px 20px;
}
a.notice-dismiss {
text-decoration: none;
}
.mt-get-started.updating-message::before {
margin-top: 12px !important;
}
.configure-msg {
font-weight: 700;
font-size: 20px;
margin-top: 80px;
text-align: center;
display: block;
text-transform: capitalize;
}
.theme-features-wrap.welcome-panel,
.theme-features-wrap.welcome-panel::before {
background: none;
height: auto;
}
@media (max-width: 1400px) {
.about-wrap .theme-features-wrap .two-col .col {
border: 1px solid #e1e1e1;
width: 47%;
}
.nav-tab-wrapper {
width: 20%;
}
.mt-nav-content-wrap {
width: 80%;
}
.mt-theme-demos .mt-each-demo {
width: 47%;
}
.mt-upgrade-title-wrap {
width: 75%;
}
.mt-upgrader-btn {
width: 25%;
}
.about-wrap .theme-features-wrap .two-col .col li {
width: 100%;
}
}
@media (max-width: 1200px) {
.mt-upgrade-title-wrap {
width: 100%;
text-align: center;
}
.mt-upgrader-btn {
margin: 20px auto 0;
width: auto;
}
.wp-core-ui .mt-upgrader-btn a {
padding: 8px 20px;
}
.theme-id-container {
position: relative;
padding: 10px 0px;
background: #F6F6F6;
}
.theme-id-container h2 {
display: block;
text-align: center;
padding: 10px 0;
box-shadow: none;
}
.theme-id-container .theme-actions {
position: static;
text-align: center;
background: #F6F6F6;
box-shadow: none;
}
}
@media (max-width: 768px) {
.mt-theme-demos .mt-each-demo {
width: 100%;
margin-bottom: 20px;
}
.nav-tab-wrapper {
width: 100%;
}
.mt-nav-content-wrap {
width: 100%;
padding: 0 30px;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a {
display: inline-block;
margin-right: -4px;
font-size: 14px;
padding: 12px 10px;
border-top: none;
border-left: none;
border-bottom: 5px solid transparent;
}
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a.nav-tab.nav-tab-active,
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a:hover {
border-left: none;
border-bottom: 5px solid #0071A1;
}
}
@media (max-width: 600px) {
.about-wrap .mt-nav-tab-content-wrapper .nav-tab-wrapper a {
font: 0/0 a;
}
.mt-each-demo.theme:focus .more-details,
.mt-each-demo.theme:hover .more-details,
.mt-each-demo.theme:not(.active):focus .theme-actions,
.mt-each-demo.theme:not(.active):hover .theme-actions {
display: block;
}
.about-wrap .mt-nav-tab-content-wrapper .theme-features-wrap .two-col .col {
width: 100%;
margin-bottom: 20px;
}
.wp-core-ui .mt-upgrader-btn a {
padding: 0 20px;
font-size: 16px;
}
}

View File

@ -0,0 +1,42 @@
.theme-review-notice {
position: relative;
}
.theme-review-notice .links {
margin: 10px 0;
}
.theme-review-notice .links a {
height: auto;
padding: 3px 15px;
margin-left: 10px;
text-transform: capitalize;
}
.theme-review-notice .links a .dashicons {
line-height: 1.5;
}
.theme-review-notice .links a.button-primary {
margin-left: 0;
}
.theme-review-notice a.notice-dismiss {
text-decoration: none;
}
#mt-theme-message {
position: relative;
}
.sophia-after-dark-message-close .notice-dismiss {
position: absolute;
}
a.notice-dismiss {
text-decoration: none;
}
.mt-get-started.updating-message::before {
margin-top: 12px !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,53 @@
/**
* Handles event for theme about page.
*/
jQuery(document).ready(function($) {
var WpAjaxurl = mtaboutObject.ajax_url;
var _wpnonce = mtaboutObject._wpnonce;
var action = mtaboutObject.action;
/**
* Popup on click demo import if mysterythemes demo importer plugin is not activated.
*/
$( '.mtdi-demo-import' ).addClass( 'disabled' );
switch( action ) {
case 'activate' : $( '.mt-activate-demo-import-plugin' ).on( 'click', function() {
var _this = $( this );
sophia_after_dark_do_plugin( 'activate_demo_importer_plugin', _this );
});
break;
case 'install' : $( '.mt-install-demo-import-plugin' ).on( 'click', function() {
var _this = $( this );
sophia_after_dark_do_plugin( 'install_demo_importer_plugin', _this );
});
break;
}
sophia_after_dark_do_plugin = function ( ajax_action, _this ) {
$.ajax({
method : "POST",
url : WpAjaxurl,
data : ({
'action' : ajax_action,
'_wpnonce' : _wpnonce
}),
beforeSend: function() {
var loadingTxt = _this.data( 'process' );
_this.addClass( 'updating-message' ).text( loadingTxt );
},
success: function( response ) {
if( response.success ) {
var loadedTxt = _this.data( 'done' );
_this.removeClass( 'updating-message' ).text( loadedTxt );
console.log( response.data.message );
} else {
console.log( response.data.message );
}
location.reload();
}
});
}
});

View File

@ -0,0 +1,53 @@
jQuery(document).ready(function($) {
"use strict";
var WpAjaxurl = mtaboutObject.ajax_url;
var _wpnonce = mtaboutObject._wpnonce;
var action = mtaboutObject.action;
switch( action ) {
case 'activate' :
$( '#mt-theme-message .mt-get-started' ).on( 'click', function() {
var _this = $( this );
sophia_after_dark_do_plugin( 'activate_demo_importer_plugin', _this );
});
break;
case 'install' :
$( '#mt-theme-message .mt-get-started' ).on( 'click', function() {
var _this = $( this );
sophia_after_dark_do_plugin( 'install_demo_importer_plugin', _this );
});
break;
case 'redirect' :
$( '#mt-theme-message .mt-get-started' ).on( 'click', function() {
var _this = $( this );
location.href = _this.data( 'redirect' );
});
break;
}
function sophia_after_dark_do_plugin( ajax_action, _this ) {
$.ajax({
method : "POST",
url : WpAjaxurl,
data : ({
'action' : ajax_action,
'_wpnonce' : _wpnonce
}),
beforeSend: function() {
var loadingTxt = _this.data( 'process' );
_this.addClass( 'updating-message' ).text( loadingTxt );
},
success: function( response ) {
if( response.success ) {
var loadedTxt = _this.data( 'done' );
_this.removeClass( 'updating-message' ).text( loadedTxt );
console.log( response.data.message );
} else {
console.log( response.data.message );
}
location.href = _this.data( 'redirect' );
}
})
}
})

View File

@ -0,0 +1,880 @@
<?php
/**
* Theme settings page.
*
* @package Sophia After Dark
*
* @since 1.0.7
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'sophia_after_dark_Settings' ) ) :
class sophia_after_dark_Settings {
/**
* Constructor.
*/
public function __construct() {
add_action( 'admin_menu', array( $this, 'sophia_after_dark_admin_menu' ) );
add_action( 'wp_loaded', array( __CLASS__, 'sophia_after_dark_hide_notices' ) );
add_action( 'wp_loaded', array( $this, 'sophia_after_dark_admin_notice' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'about_theme_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'about_theme_scripts' ) );
add_filter( 'admin_footer_text', array( $this, 'sophia_after_dark_admin_footer_text' ) );
//about theme review notice
add_action( 'after_setup_theme', array( $this, 'sophia_after_dark_theme_rating_notice' ) );
add_action( 'switch_theme', array( $this, 'sophia_after_dark_theme_rating_notice_data_remove' ) );
add_action( 'wp_ajax_activate_demo_importer_plugin', array( $this, 'activate_demo_importer_plugin' ) );
add_action( 'wp_ajax_install_demo_importer_plugin', array( $this, 'install_demo_importer_plugin' ) );
}
/**
* Add admin menu.
*/
public function sophia_after_dark_admin_menu() {
$theme = wp_get_theme( get_template() );
$page = add_theme_page( $theme->display( 'Name' ).' '.esc_html__( 'Settings', 'sophia-after-dark' ), $theme->display( 'Name' ).' '.' '.esc_html__( 'Settings', 'sophia-after-dark' ), 'activate_plugins', 'sophia-after-dark-settings', array( $this, 'get_started_screen' ) );
}
/**
* Enqueue styles.
*/
public function about_theme_styles( $hook ) {
global $sophia_after_dark_theme_version;
wp_enqueue_style( 'mt-theme-review-notice', get_template_directory_uri() . '/inc/theme-settings/assets/css/theme-review-notice.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
if ( 'appearance_page_sophia-after-dark-settings' != $hook && 'themes.php' != $hook ) {
return;
}
wp_enqueue_style( 'mt-theme-settings-style', get_template_directory_uri() . '/inc/theme-settings/assets/css/settings.css', array(), $sophia_after_dark_theme_version );
}
/**
* Enqueue scripts.
*/
public function about_theme_scripts( $hook ) {
global $sophia_after_dark_theme_version;
$theme_notice_option = get_option( 'sophia_after_dark_admin_notice_welcome' );
if ( $theme_notice_option ) {
wp_enqueue_script( 'mt-theme-review-notice', get_template_directory_uri() . '/inc/theme-settings/assets/js/theme-review-notice.js', array( 'jquery' ), esc_attr( $sophia_after_dark_theme_version ) );
$demo_importer_plugin = WP_PLUGIN_DIR . '/mysterythemes-demo-importer/mysterythemes-demo-importer.php';
if ( file_exists( $demo_importer_plugin ) && !is_plugin_active( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php' ) ) {
$action = 'activate';
} elseif ( !file_exists( $demo_importer_plugin ) ) {
$action = 'install';
} else {
$action = 'redirect';
}
wp_localize_script( 'mt-theme-review-notice', 'mtaboutObject', array(
'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
'_wpnonce' => wp_create_nonce( 'sophia_after_dark_admin_plugin_install_nonce' ),
'action' => esc_html( $action )
));
}
if ( 'appearance_page_sophia-after-dark-settings' != $hook ) {
return;
}
$activated_plugins = apply_filters( 'sophia_after_dark_active_plugins', get_option('active_plugins') );
$demo_import_plugin = in_array( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php', $activated_plugins );
if ( $demo_import_plugin ) {
return;
}
wp_enqueue_script( 'mt-theme-settings-script', get_template_directory_uri() . '/inc/theme-settings/assets/js/settings.js', array( 'jquery' ), esc_attr( $sophia_after_dark_theme_version ) );
$demo_importer_plugin = WP_PLUGIN_DIR . '/mysterythemes-demo-importer/mysterythemes-demo-importer.php';
if ( file_exists( $demo_importer_plugin ) && !is_plugin_active( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php' ) ) {
$action = 'activate';
} else {
$action = 'install';
}
wp_localize_script( 'mt-theme-settings-script', 'mtaboutObject', array(
'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
'_wpnonce' => wp_create_nonce( 'sophia_after_dark_admin_plugin_install_nonce' ),
'action' => esc_html( $action )
));
}
/**
* Add admin notice.
*/
public function sophia_after_dark_admin_notice() {
if ( isset( $_GET['activated'] ) ) {
update_option( 'sophia_after_dark_admin_notice_welcome', true );
}
$theme_notice_option = get_option( 'sophia_after_dark_admin_notice_welcome' );
// Let's bail on theme activation.
if ( $theme_notice_option ) {
add_action( 'admin_notices', array( $this, 'welcome_notice' ) );
}
}
/**
* Hide a notice if the GET variable is set.
*/
public static function sophia_after_dark_hide_notices() {
if ( isset( $_GET['sophia-after-dark-hide-notice'] ) && isset( $_GET['_sophia_after_dark_notice_nonce'] ) ) {
if ( ! wp_verify_nonce( $_GET['_sophia_after_dark_notice_nonce'], 'sophia_after_dark_hide_notices_nonce' ) ) {
wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'sophia-after-dark' ) );
}
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'Cheat in &#8217; huh?', 'sophia-after-dark' ) );
}
$hide_notice = sanitize_text_field( $_GET['sophia-after-dark-hide-notice'] );
update_option( 'sophia_after_dark_admin_notice_' . $hide_notice, false );
}
}
/**
* Show welcome notice.
*/
public function welcome_notice() {
$theme = wp_get_theme( get_template() );
$theme_name = $theme->get( 'Name' );
?>
<div id="mt-theme-message" class="updated notice sophia-after-dark-message">
<a class="sophia-after-dark-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'activated' ), add_query_arg( 'sophia-after-dark-hide-notice', 'welcome' ) ), 'sophia_after_dark_hide_notices_nonce', '_sophia_after_dark_notice_nonce' ) ); ?>">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'sophia-after-dark' ); ?>
</a>
<h2 class="welcome-title"><?php printf( esc_html__( 'Welcome to %s', 'sophia-after-dark' ), $theme_name ); ?></h2>
<p>
<?php printf( esc_html__( 'Welcome! Thank you for choosing %1$s ! To fully take advantage of the best our theme can offer please make sure you visit our %2$s theme settings page %3$s.', 'sophia-after-dark' ), '<strong>'. esc_html( $theme_name ).'</strong>', '<a href="' . esc_url( admin_url( 'themes.php?page=sophia-after-dark-settings' ) ) . '">', '</a>' ); ?>
</p>
<p>
<?php printf( esc_html__( 'Clicking get started will process to installation of %1$s Mystery Themes Demo Importer %2$s Plugin in your dashboard. After success it will redirect to the theme settings page.', 'sophia-after-dark' ), '<strong>', '</strong>' ); ?>
</p>
<div class="submit">
<button class="mt-get-started button button-primary button-hero" data-done="<?php esc_attr_e( 'Done!', 'sophia-after-dark' ); ?>" data-process="<?php esc_attr_e( 'Processing', 'sophia-after-dark' ); ?>" data-redirect="<?php echo esc_url( wp_nonce_url( add_query_arg( 'sophia-after-dark-hide-notice', 'welcome', admin_url( 'themes.php' ).'?page=sophia-after-dark-settings&tab=demos' ) , 'sophia_after_dark_hide_notices_nonce', '_sophia_after_dark_notice_nonce' ) ); ?>">
<?php printf( esc_html__( 'Get started with %1$s', 'sophia-after-dark' ), esc_html( $theme_name ) ); ?>
</button>
</div>
</div><!-- #mt-theme-message -->
<?php
}
/**
* Intro text/links shown to all about pages.
*
* @access private
*/
private function intro() {
global $sophia_after_dark_theme_version;
$theme = wp_get_theme( get_template() );
$theme_name = $theme->get( 'Name' );
$author_uri = $theme->get( 'AuthorURI' );
$author_name = $theme->get( 'Author' );
// Drop minor version if 0
?>
<div class="sophia-after-dark-theme-info mt-theme-info mt-clearfix">
<h1 class="mt-about-title"> <?php echo esc_html( $theme_name ); ?> </h1>
<div class="author-credit">
<span class="theme-version"><?php printf( esc_html__( 'Version: %1$s', 'sophia-after-dark' ), $sophia_after_dark_theme_version ); ?></span>
<span class="author-link"><?php printf( wp_kses_post( 'By <a href="%1$s" target="_blank">%2$s</a>', 'sophia-after-dark' ), $author_uri, $author_name ); ?></span>
</div>
</div><!-- .sophia-after-dark-theme-info -->
<div class="mt-upgrader-pro">
<div class="mt-upgrade-title-wrap">
<h3 class="mt-upgrader-title"><?php esc_html_e( 'Upgrade to Premium Version', 'sophia-after-dark' ); ?></h3>
<div class="mt-upgrader-text"><?php esc_html_e( 'Upgrade to pro version for additional features and better supports.', 'sophia-after-dark' ); ?></div>
</div>
<div class="mt-upgrader-btn"> <a href="<?php echo esc_url( 'https://mysterythemes.com/wp-themes/color-blog-pro/' ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Unlock Features With Pro', 'sophia-after-dark' ); ?></a> </div>
</div><!-- .mt-upgrader-pro -->
<div class="mt-nav-tab-content-wrapper">
<div class="nav-tab-wrapper">
<a class="nav-tab <?php if ( empty( $_GET['tab'] ) && $_GET['page'] == 'sophia-after-dark-settings' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sophia-after-dark-settings' ), 'themes.php' ) ) ); ?>">
<span class="dashicons dashicons-admin-appearance"></span> <?php esc_html_e( 'Get Started', 'sophia-after-dark' ); ?>
</a>
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'demos' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sophia-after-dark-settings', 'tab' => 'demos' ), 'themes.php' ) ) ); ?>">
<span class="dashicons dashicons-download"></span> <?php esc_html_e( 'Demos', 'sophia-after-dark' ); ?>
</a>
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'free_vs_pro' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sophia-after-dark-settings', 'tab' => 'free_vs_pro' ), 'themes.php' ) ) ); ?>">
<span class="dashicons dashicons-dashboard"></span> <?php esc_html_e( 'Free Vs Pro', 'sophia-after-dark' ); ?>
</a>
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'changelog' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sophia-after-dark-settings', 'tab' => 'changelog' ), 'themes.php' ) ) ); ?>">
<span class="dashicons dashicons-flag"></span> <?php esc_html_e( 'Changelog', 'sophia-after-dark' ); ?>
</a>
</div><!-- .nav-tab-wrapper -->
<?php
}
/**
* Get started screen page.
*/
public function get_started_screen() {
$current_tab = empty( $_GET['tab'] ) ? 'about' : sanitize_title( $_GET['tab'] );
// Look for a {$current_tab}_screen method.
if ( is_callable( array( $this, $current_tab . '_screen' ) ) ) {
return $this->{ $current_tab . '_screen' }();
}
// Fallback to about screen.
return $this->about_screen();
}
/**
* Output the about screen.
*/
public function about_screen() {
$theme = wp_get_theme( get_template() );
$theme_name = $theme->template;
$doc_url = 'https://docs.mysterythemes.com/color-blog';
$pro_theme_url = 'https://mysterythemes.com/wp-themes/color-blog-pro';
$support_url = 'https://wordpress.org/support/theme/'. $theme_name;
$review_url = 'https://wordpress.org/support/theme/'. $theme_name .'/reviews/?filter=5#new-post';
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
<div class="mt-nav-content-wrap">
<div class="theme-features-wrap welcome-panel">
<h4><?php esc_html_e( 'Here are some useful links for you to get started', 'sophia-after-dark' ); ?></h4>
<div class="under-the-hood two-col">
<div class="col">
<h3><?php esc_html_e( 'Next Steps', 'sophia-after-dark' ); ?></h3>
<ul>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[section]=title_tagline' ); ?>" target="_blank" class="welcome-icon dashicons-visibility"><?php esc_html_e( 'Set site logo', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[section]=sophia_after_dark_section_site' ); ?>" target="_blank" class="welcome-icon dashicons-admin-page"><?php esc_html_e( 'Setup site layout', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[panel]=sophia_after_dark_header_panel' ); ?>" target="_blank" class="welcome-icon dashicons-editor-kitchensink"><?php esc_html_e( 'Manage header section', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[section]=sophia_after_dark_section_post_settings' ); ?>" target="_blank" class="welcome-icon dashicons-text-page"><?php esc_html_e( 'Single page sidebar layouts', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[section]=sophia_after_dark_section_social_icons' ); ?>" target="_blank" class="welcome-icon dashicons-networking"><?php esc_html_e( 'Manage Social Icons', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'customize.php' ).'?autofocus[section]=sophia_after_dark_section_footer_widget_area' ); ?>" target="_blank" class="welcome-icon dashicons-archive"><?php esc_html_e( 'Manage footer widget area', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'nav-menus.php' ) ); ?>" target="_blank" class="welcome-icon welcome-menus"><?php esc_html_e( 'Manage menus', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( admin_url( 'widgets.php' ) ); ?>" target="_blank" class="welcome-icon welcome-widgets"><?php esc_html_e( 'Manage widgets', 'sophia-after-dark' ); ?></a>
</li>
</ul>
</div>
<div class="col">
<h3><?php esc_html_e( 'More Actions', 'sophia-after-dark' ); ?></h3>
<ul>
<li>
<a href="<?php echo esc_url( $doc_url ); ?>" target="_blank" class="welcome-icon dashicons-media-text"><?php esc_html_e( 'Documentation', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( $pro_theme_url ); ?>" target="_blank" class="welcome-icon dashicons-migrate"><?php esc_html_e( 'Premium version', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( $support_url ); ?>" target="_blank" class="welcome-icon dashicons-businesswoman"><?php esc_html_e( 'Need theme support?', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( $review_url ); ?>" target="_blank" class="welcome-icon dashicons-thumbs-up"><?php esc_html_e( 'Review theme', 'sophia-after-dark' ); ?></a>
</li>
<li>
<a href="<?php echo esc_url( 'https://wpallresources.com/' ); ?>" target="_blank" class="welcome-icon dashicons-admin-users"><?php esc_html_e( 'WP Tutorials', 'sophia-after-dark' ); ?></a>
</li>
</ul>
</div>
</div>
</div><!-- .theme-features-wrap -->
<div class="return-to-dashboard sophia-after-dark">
<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>">
<?php is_multisite() ? esc_html_e( 'Return to Updates', 'sophia-after-dark' ) : esc_html_e( 'Return to Dashboard &rarr; Updates', 'sophia-after-dark' ); ?>
</a> |
<?php endif; ?>
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? esc_html_e( 'Go to Dashboard &rarr; Home', 'sophia-after-dark' ) : esc_html_e( 'Go to Dashboard', 'sophia-after-dark' ); ?></a>
</div><!-- .return-to-dashboard -->
</div><!-- .mt-nav-content-wrap -->
</div><!-- .mt-nav-tab-content-wrapper -->
</div><!-- .about-wrap -->
<?php
}
/**
* Output the more themes screen
*/
public function demos_screen() {
$activated_theme = get_template();
$demodata = get_transient( 'sophia_after_dark_demo_packages' );
if ( empty( $demodata ) || $demodata == false ) {
$demodata = get_transient( 'mtdi_theme_packages' );
if ( $demodata ) {
set_transient( 'sophia_after_dark_demo_packages', $demodata, WEEK_IN_SECONDS );
}
}
$activated_demo_check = get_option( 'mtdi_activated_check' );
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
<div class="mt-nav-content-wrap">
<div class="mt-theme-demos rendered">
<?php $this->install_demo_import_plugin_popup(); ?>
<div class="demos wp-clearfix">
<?php
if ( isset( $demodata ) && empty( $demodata ) ) {
?>
<span class="configure-msg"><?php esc_html_e( 'No demos are configured for this theme, please contact the theme author', 'sophia-after-dark' ); ?></span>
<?php
} else {
?>
<div class="mt-demo-wrapper mtdi_gl js-ocdi-gl">
<div class="themes wp-clearfix">
<?php
foreach ( $demodata as $value ) {
$theme_name = $value['name'];
$theme_slug = $value['theme_slug'];
$preview_screenshot = $value['preview_screen'];
$demourl = $value['preview_url'];
if ( ( strpos( $activated_theme, 'pro' ) !== false && strpos( $theme_slug, 'pro' ) !== false ) || ( strpos( $activated_theme, 'pro' ) == false ) ) {
?>
<div class="mt-each-demo<?php if ( strpos( $activated_theme, 'pro' ) == false && strpos( $theme_slug, 'pro' ) !== false ) { echo ' mt-demo-pro'; } ?> theme mtdi_gl-item js-ocdi-gl-item" data-categories="ltrdemo" data-name="<?php echo esc_attr ( $theme_slug ); ?>" style="display: block;">
<div class="mtdi-preview-screenshot mtdi_gl-item-image-container">
<a href="<?php echo esc_url ( $demourl ); ?>" target="_blank">
<img class="mtdi_gl-item-image" src="<?php echo esc_url ( $preview_screenshot ); ?>" />
</a>
</div><!-- .mtdi-preview-screenshot -->
<div class="theme-id-container">
<h2 class="mtdi-theme-name theme-name" id="nokri-name"><?php echo esc_html ( $theme_name ); ?></h2>
<div class="mtdi-theme-actions theme-actions">
<?php
if ( $activated_demo_check != '' && $activated_demo_check == $theme_slug ) {
?>
<a class="button disabled button-primary hide-if-no-js" href="javascript:void(0);" data-name="<?php echo esc_attr ( $theme_name ); ?>" data-slug="<?php echo esc_attr ( $theme_slug ); ?>" aria-label="<?php printf ( esc_html__( 'Imported %1$s', 'sophia-after-dark' ), $theme_name ); ?>">
<?php esc_html_e( 'Imported', 'sophia-after-dark' ); ?>
</a>
<?php
} else {
if ( strpos( $activated_theme, 'pro' ) == false && strpos( $theme_slug, 'pro' ) !== false ) {
$s_slug = explode( "-pro", $theme_slug );
$purchaseurl = 'https://mysterythemes.com/wp-themes/'.$s_slug[0].'-pro';
?>
<a class="button button-primary mtdi-purchasenow" href="<?php echo esc_url( $purchaseurl ); ?>" target="_blank" data-name="<?php echo esc_attr ( $theme_name ); ?>" data-slug="<?php echo esc_attr ( $theme_slug ); ?>" aria-label="<?php printf ( esc_html__( 'Purchase Now', 'sophia-after-dark' ), $theme_name ); ?>">
<?php esc_html_e( 'Buy Now', 'sophia-after-dark' ); ?>
</a>
<?php
} else {
if ( is_plugin_active( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php' ) ) {
$button_tooltip = esc_html__( 'Click to import demo', 'sophia-after-dark' );
} else {
$button_tooltip = esc_html__( 'Demo importer plugin is not installed or activated', 'sophia-after-dark' );
}
?>
<a title="<?php echo esc_attr( $button_tooltip ); ?>" class="button button-primary hide-if-no-js mtdi-demo-import" href="javascript:void(0);" data-name="<?php echo esc_attr ( $theme_name ); ?>" data-slug="<?php echo esc_attr ( $theme_slug ); ?>" aria-label="<?php printf ( esc_attr__( 'Import %1$s', 'sophia-after-dark' ), $theme_name ); ?>">
<?php esc_html_e( 'Import', 'sophia-after-dark' ); ?>
</a>
<?php
}
}
?>
<a class="button preview install-demo-preview" target="_blank" href="<?php echo esc_url ( $demourl ); ?>">
<?php esc_html_e( 'View Demo', 'sophia-after-dark' ); ?>
</a>
</div><!-- .mtdi-theme-actions -->
</div><!-- .theme-id-container -->
</div><!-- .mtdi-each-demo -->
<?php
}
}
?>
</div><!-- .themes -->
</div><!-- .mtdi-demo-wrapper -->
<?php
}
?>
</div>
</div><!-- .theme-browser -->
</div><!-- .mt-nav-content-wrap -->
</div><!-- .mt-nav-tab-content-wrapper -->
</div><!-- .wrap.about-wrap -->
<?php
}
/**
* Output the changelog screen.
*/
public function changelog_screen() {
global $wp_filesystem;
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
<div class="mt-nav-content-wrap">
<h4><?php esc_html_e( 'View changelog below:', 'sophia-after-dark' ); ?></h4>
<?php
$changelog_file = apply_filters( 'sophia_after_dark_changelog_file', get_template_directory() . '/readme.txt' );
// Check if the changelog file exists and is readable.
if ( $changelog_file && is_readable( $changelog_file ) ) {
WP_Filesystem();
$changelog = $wp_filesystem->get_contents( $changelog_file );
$changelog_list = $this->parse_changelog( $changelog );
echo wp_kses_post( $changelog_list );
}
?>
</div><!-- .mt-nav-content-wrap -->
</div><!-- .mt-nav-tab-content-wrapper -->
</div>
<?php
}
/**
* Parse changelog from readme file.
* @param string $content
* @return string
*/
private function parse_changelog( $content ) {
$matches = null;
$regexp = '~==\s*Changelog\s*==(.*)($)~Uis';
$changelog = '';
if ( preg_match( $regexp, $content, $matches ) ) {
$changes = explode( '\r\n', trim( $matches[1] ) );
$changelog .= '<pre class="changelog">';
foreach ( $changes as $index => $line ) {
$changelog .= wp_kses_post( preg_replace( '~(=\s*(\d+(?:\.\d+)+)\s*=|$)~Uis', '<span class="title">${1}</span>', $line ) );
}
$changelog .= '</pre>';
}
return wp_kses_post( $changelog );
}
/**
* Output the free vs pro screen.
*/
public function free_vs_pro_screen() {
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
<div class="mt-nav-content-wrap">
<h4><?php esc_html_e( 'Upgrade to PRO version for more exciting features.', 'sophia-after-dark' ); ?></h4>
<table>
<thead>
<tr>
<th class="table-feature-title"><h3><?php esc_html_e( 'Features', 'sophia-after-dark' ); ?></h3></th>
<th><h3><?php esc_html_e( 'Sophia After Dark', 'sophia-after-dark' ); ?></h3></th>
<th><h3><?php esc_html_e( 'Color Blog Pro', 'sophia-after-dark' ); ?></h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><h3><?php esc_html_e( 'Price', 'sophia-after-dark' ); ?></h3></td>
<td><?php esc_html_e( 'Free', 'sophia-after-dark' ); ?></td>
<td><?php esc_html_e( '$59.99', 'sophia-after-dark' ); ?></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Import Demo Data', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Pre Loaders Layouts', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Header Layouts', 'sophia-after-dark' ); ?></h3></td>
<td><?php esc_html_e( '1', 'sophia-after-dark' ); ?></td>
<td><?php esc_html_e( '4', 'sophia-after-dark' ); ?></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Multiple Layouts', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Google Fonts', 'sophia-after-dark' ); ?></h3></td>
<td><?php esc_html_e( '2', 'sophia-after-dark' );?></td>
<td><?php esc_html_e( '600+', 'sophia-after-dark' ); ?></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'WordPress Page Builder Compatible', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Custom 404 Page', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Typography Options', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'Footer Layout Options', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'WooCommerce Plugin Compatible', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td><h3><?php esc_html_e( 'GDPR Compatible', 'sophia-after-dark' ); ?></h3></td>
<td><span class="dashicons mt-dashicons-no"></span></td>
<td><span class="dashicons mt-dashicons-yes"></span></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="btn-wrapper">
<a href="<?php echo esc_url( apply_filters( 'sophia-after-dark_theme_url', 'https://mysterythemes.com/wp-themes/color-blog-pro/' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Buy Pro', 'sophia-after-dark' ); ?></a>
</td>
</tr>
</tbody>
</table>
</div><!-- .mt-nav-content-wrap -->
</div><!-- .mt-nav-tab-content-wrapper -->
</div><!-- .about-wrap -->
<?php
}
/**
* Set the required option value as needed for theme review notice.
*/
public function sophia_after_dark_theme_rating_notice() {
// Set the installed time in `sophia_after_dark_theme_installed_time` option table.
$option = get_option( 'sophia_after_dark_theme_installed_time' );
if ( ! $option ) {
update_option( 'sophia_after_dark_theme_installed_time', time() );
}
add_action( 'admin_notices', array( $this, 'sophia_after_dark_theme_review_notice' ), 0 );
add_action( 'admin_init', array( $this, 'sophia_after_dark_ignore_theme_review_notice' ), 0 );
add_action( 'admin_init', array( $this, 'sophia_after_dark_ignore_theme_review_notice_partially' ), 0 );
}
/**
* Display the theme review notice.
*/
public function sophia_after_dark_theme_review_notice() {
global $current_user;
$user_id = $current_user->ID;
$ignored_notice = get_user_meta( $user_id, 'sophia_after_dark_ignore_theme_review_notice', true );
$ignored_notice_partially = get_user_meta( $user_id, 'mt_sophia_after_dark_ignore_theme_review_notice_partially', true );
/**
* Return from notice display if:
*
* 1. The theme installed is less than 15 days ago.
* 2. If the user has ignored the message partially for 15 days.
* 3. Dismiss always if clicked on 'I Already Did' button.
*/
if ( ( get_option( 'sophia_after_dark_theme_installed_time' ) > strtotime( '- 15 days' ) ) || ( $ignored_notice_partially > time() ) || ( $ignored_notice ) ) {
return;
}
?>
<div class="notice updated theme-review-notice">
<p>
<?php
printf( esc_html__(
'Howdy, %1$s! It seems that you have been using this theme for more than 15 days. We hope you are happy with everything that the theme has to offer. If you can spare a minute, please help us by leaving a 5-star review on WordPress.org. By spreading the love, we can continue to develop new amazing features in the future, for free!', 'sophia-after-dark'
),
'<strong>' . esc_html( $current_user->display_name ) . '</strong>'
);
?>
</p>
<div class="links">
<a href="https://wordpress.org/support/theme/sophia-after-dark/reviews/?filter=5#new-post" class="btn button-primary" target="_blank">
<span class="dashicons dashicons-thumbs-up"></span>
<span><?php esc_html_e( 'Sure', 'sophia-after-dark' ); ?></span>
</a>
<a href="?mt_sophia_after_dark_ignore_theme_review_notice_partially=0" class="btn button-secondary">
<span class="dashicons dashicons-calendar"></span>
<span><?php esc_html_e( 'Maybe later', 'sophia-after-dark' ); ?></span>
</a>
<a href="?mt_sophia_after_dark_ignore_theme_review_notice=0" class="btn button-secondary">
<span class="dashicons dashicons-smiley"></span>
<span><?php esc_html_e( 'I already did', 'sophia-after-dark' ); ?></span>
</a>
<a href="<?php echo esc_url( 'https://wordpress.org/support/theme/sophia-after-dark/' ); ?>" class="btn button-secondary" target="_blank">
<span class="dashicons dashicons-edit"></span>
<span><?php esc_html_e( 'Got theme support question?', 'sophia-after-dark' ); ?></span>
</a>
</div>
<a class="notice-dismiss" href="?mt_sophia_after_dark_ignore_theme_review_notice_partially=0"></a>
</div>
<?php
}
/**
* Function to remove the theme review notice permanently as requested by the user.
*/
public function sophia_after_dark_ignore_theme_review_notice() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['mt_sophia_after_dark_ignore_theme_review_notice'] ) && '0' == $_GET['mt_sophia_after_dark_ignore_theme_review_notice'] ) {
add_user_meta( $user_id, 'sophia_after_dark_ignore_theme_review_notice', 'true', true );
}
}
/**
* Function to remove the theme review notice partially as requested by the user.
*/
public function sophia_after_dark_ignore_theme_review_notice_partially() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['mt_sophia_after_dark_ignore_theme_review_notice_partially'] ) && '0' == $_GET['mt_sophia_after_dark_ignore_theme_review_notice_partially'] ) {
update_user_meta( $user_id, 'mt_sophia_after_dark_ignore_theme_review_notice_partially', strtotime( '+ 7 days' ) );
}
}
/**
* Remove the data set after the theme has been switched to other theme.
*/
public function sophia_after_dark_theme_rating_notice_data_remove() {
global $current_user;
$user_id = $current_user->ID;
$theme_installed_time = get_option( 'sophia_after_dark_theme_installed_time' );
$ignored_notice = get_user_meta( $user_id, 'sophia_after_dark_ignore_theme_review_notice', true );
$ignored_notice_partially = get_user_meta( $user_id, 'mt_sophia_after_dark_ignore_theme_review_notice_partially', true );
// Delete options data.
if ( $theme_installed_time ) {
delete_option( 'sophia_after_dark_theme_installed_time' );
}
// Delete permanent notice remove data.
if ( $ignored_notice ) {
delete_user_meta( $user_id, 'sophia_after_dark_ignore_theme_review_notice' );
}
// Delete partial notice remove data.
if ( $ignored_notice_partially ) {
delete_user_meta( $user_id, 'mt_sophia_after_dark_ignore_theme_review_notice_partially' );
}
}
/**
* Display custom text on theme settings page
*
* @param string $text
*/
public function sophia_after_dark_admin_footer_text( $text ) {
$screen = get_current_screen();
if ( 'appearance_page_sophia-after-dark-settings' == $screen->id ) {
$theme = wp_get_theme( get_template() );
$theme_name = $theme->get( 'Name' );
$text = sprintf( __( 'If you like <strong>%1$s</strong> please leave us a %2$s rating. A huge thank you from <strong>Mystery Themes</strong> in advance &#128515!', 'sophia-after-dark' ), esc_html( $theme_name ), '<a href="https://wordpress.org/support/theme/sophia-after-dark/reviews/?filter=5#new-post" class="theme-rating" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a>' );
}
return $text;
}
/**
* Popup alert for mystery themes demo importer plugin install.
*
* @since 1.0.7
*/
public function install_demo_import_plugin_popup() {
$demo_importer_plugin = WP_PLUGIN_DIR . '/mysterythemes-demo-importer/mysterythemes-demo-importer.php';
?>
<div id="mt-demo-import-plugin-popup">
<div class="mt-popup-inner-wrap">
<?php
if ( is_plugin_active( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php' ) ) {
echo '<span class="mt-plugin-message">'.esc_html__( 'You can import available demos now!', 'sophia-after-dark' ).'</span>';
} else {
if ( ! file_exists( $demo_importer_plugin ) ) {
?>
<span class="mt-plugin-message"><?php esc_html_e( 'Mystery Themes Demo Importer Plugin is not installed!', 'sophia-after-dark' ); ?></span>
<a href="javascript:void(0)" class="mt-install-demo-import-plugin" data-process="<?php esc_attr_e( 'Installing & Activating', 'sophia-after-dark' ); ?>" data-done="<?php esc_attr_e( 'Installed & Activated', 'sophia-after-dark' ); ?>">
<?php esc_html_e( 'Install and Activate', 'sophia-after-dark' ); ?>
</a>
<?php
} else {
?>
<span class="mt-plugin-message"><?php esc_html_e( 'Mystery Themes Demo Importer Plugin is installed but not activated!', 'sophia-after-dark' ); ?></span>
<a href="javascript:void(0)" class="mt-activate-demo-import-plugin" data-process="<?php esc_attr_e( 'Activating', 'sophia-after-dark' ); ?>" data-done="<?php esc_attr_e( 'Activated', 'sophia-after-dark' ); ?>">
<?php esc_html_e( 'Activate Now', 'sophia-after-dark' ); ?>
</a>
<?php
}
}
?>
</div><!-- .mt-popup-inner-wrap -->
</div><!-- .mt-demo-import-plugin-popup -->
<?php
}
/**
* Activate Demo Importer Plugins Ajax Method
*
* @since 1.0.7
*/
public function activate_demo_importer_plugin() {
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'sophia_after_dark_admin_plugin_install_nonce' ) ) {
die( 'This action was stopped for security purposes.' );
}
$result = activate_plugin( '/mysterythemes-demo-importer/mysterythemes-demo-importer.php' );
if ( is_wp_error( $result ) ) {
// Process Error
wp_send_json_error(
array(
'success' => false,
'message' => $result->get_error_message(),
)
);
} else {
wp_send_json_success(
array(
'success' => true,
'message' => __( 'Plugin Successfully Activated.', 'sophia-after-dark' ),
)
);
}
}
/**
* Activate Demo Importer Plugins Ajax Method
*
* @since 1.0.7
*/
function install_demo_importer_plugin() {
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'sophia_after_dark_admin_plugin_install_nonce' ) ) {
die( 'This action was stopped for security purposes.' );
}
if ( ! current_user_can( 'install_plugins' ) ) {
$status['message'] = __( 'Sorry, you are not allowed to install plugins on this site.', 'sophia-after-dark' );
wp_send_json_error( $status );
}
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
$api = plugins_api(
'plugin_information',
array(
'slug' => esc_html( 'mysterythemes-demo-importer' ),
'fields' => array(
'sections' => false,
),
)
);
if ( is_wp_error( $api ) ) {
$status['message'] = $api->get_error_message();
wp_send_json_error( $status );
}
$status['pluginName'] = $api->name;
$skin = new WP_Ajax_Upgrader_Skin();
$upgrader = new Plugin_Upgrader( $skin );
$result = $upgrader->install( $api->download_link );
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
$status['debug'] = $skin->get_upgrade_messages();
}
if ( is_wp_error( $result ) ) {
$status['errorCode'] = $result->get_error_code();
$status['message'] = $result->get_error_message();
wp_send_json_error( $status );
} elseif ( is_wp_error( $skin->result ) ) {
$status['errorCode'] = $skin->result->get_error_code();
$status['message'] = $skin->result->get_error_message();
wp_send_json_error( $status );
} elseif ( $skin->get_errors()->get_error_code() ) {
$status['message'] = $skin->get_error_messages();
wp_send_json_error( $status );
} elseif ( is_null( $result ) ) {
global $wp_filesystem;
$status['errorCode'] = 'unable_to_connect_to_filesystem';
$status['message'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.', 'sophia-after-dark' );
// Pass through the error from WP_Filesystem if one was raised.
if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
$status['message'] = esc_html( $wp_filesystem->errors->get_error_message() );
}
wp_send_json_error( $status );
}
if ( current_user_can( 'activate_plugin' ) ) {
$result = activate_plugin( '/mysterythemes-demo-importer/mysterythemes-demo-importer.php' );
if ( is_wp_error( $result ) ) {
$status['errorCode'] = $result->get_error_code();
$status['message'] = $result->get_error_message();
wp_send_json_error( $status );
}
}
$status['message'] = esc_html__( 'Plugin installed successfully', 'sophia-after-dark' );
wp_send_json_success( $status );
}
}
endif;
return new sophia_after_dark_Settings();

View File

@ -0,0 +1,168 @@
<?php
/**
* MT: Author Info
*
* Widget show the author information
*
* @package Sophia After Dark
* @since 1.0.0
*/
class sophia_after_dark_Author_Info extends WP_widget {
/**
* Register widget with WordPress.
*/
public function __construct() {
$widget_ops = array(
'classname' => 'sophia_after_dark_author_info',
'description' => __( 'Select the user to display the author info.', 'sophia-after-dark' ),
'customize_selective_refresh' => true,
);
parent::__construct( 'sophia_after_dark_author_info', __( 'MT: Author Info', 'sophia-after-dark' ), $widget_ops );
}
/**
* Helper function that holds widget fields
* Array is used in update and form functions
*/
private function widget_fields() {
$fields = array(
'widget_title' => array(
'sophia_after_dark_widgets_name' => 'widget_title',
'sophia_after_dark_widgets_title' => __( 'Widget title', 'sophia-after-dark' ),
'sophia_after_dark_widgets_field_type' => 'text'
),
'user_name' => array(
'sophia_after_dark_widgets_name' => 'user_name',
'sophia_after_dark_widgets_title' => __( 'User Name', 'sophia-after-dark' ),
'sophia_after_dark_widgets_field_type' => 'text'
),
'user_id' => array(
'sophia_after_dark_widgets_name' => 'user_id',
'sophia_after_dark_widgets_title' => __( 'Select Author', 'sophia-after-dark' ),
'sophia_after_dark_widgets_default' => '',
'sophia_after_dark_widgets_field_type' => 'user_dropdown'
),
'user_thumb' => array(
'sophia_after_dark_widgets_name' => 'user_thumb',
'sophia_after_dark_widgets_title' => __( 'Author Image', 'sophia-after-dark' ),
'sophia_after_dark_widgets_field_type' => 'upload'
),
);
return $fields;
}
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget( $args, $instance ) {
extract( $args );
if ( empty( $instance ) ) {
return ;
}
$sophia_after_dark_widget_title = empty( $instance['widget_title'] ) ? '' : $instance['widget_title'];
$sophia_after_dark_user_name = empty( $instance['user_name'] ) ? '' : $instance['user_name'];
$sophia_after_dark_user_id = empty( $instance['user_id'] ) ? '' : $instance['user_id'];
$sophia_after_dark_user_image = empty( $instance['user_thumb'] ) ? '' : $instance['user_thumb'];
echo $before_widget;
?>
<div class="mt-author-info-wrapper">
<?php
if ( ! empty( $sophia_after_dark_widget_title ) ) {
echo $before_title . esc_html( $sophia_after_dark_widget_title ) . $after_title;
}
?>
<div class="author-bio-wrap">
<div class="author-avatar">
<?php
if ( ! empty( $sophia_after_dark_user_image ) ) {
echo '<img src="'. esc_url( $sophia_after_dark_user_image ) .'" />';
} else {
echo get_avatar( $sophia_after_dark_user_id, '132' );
}
?>
</div>
<h3 class="author-name">
<?php
if ( empty( $sophia_after_dark_user_name ) ) {
echo wp_kses_post( get_the_author_meta( 'nickname', $sophia_after_dark_user_id ) );
} else {
echo esc_html( $sophia_after_dark_user_name );
}
?>
</h3>
<div class="author-description"><?php echo wp_kses_post( wpautop( get_the_author_meta( 'description', $sophia_after_dark_user_id ) ) ); ?></div>
<div class="author-social">
<?php sophia_after_dark_social_media_content(); ?>
</div><!-- .author-social -->
</div><!-- .author-bio-wrap -->
</div><!-- .mt-author-info-wrapper -->
<?php
echo $after_widget;
}
/**
* Sanitize widget form values as they are saved.
*
* @see WP_Widget::update()
*
* @param array $new_instance Values just sent to be saved.
* @param array $old_instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_updated_field_value() defined in mt-widget-fields.php
*
* @return array Updated safe values to be saved.
*/
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
extract( $widget_field );
// Use helper function to get updated field values
$instance[$sophia_after_dark_widgets_name] = sophia_after_dark_widgets_updated_field_value( $widget_field, $new_instance[$sophia_after_dark_widgets_name] );
}
return $instance;
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_show_widget_field() defined in mt-widget-fields.php
*/
public function form( $instance ) {
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
// Make array elements available as variables
extract( $widget_field );
$sophia_after_dark_widgets_field_value = !empty( $instance[$sophia_after_dark_widgets_name] ) ? wp_kses_post( $instance[$sophia_after_dark_widgets_name] ) : '';
sophia_after_dark_widgets_show_widget_field( $this, $widget_field, $sophia_after_dark_widgets_field_value );
}
}
}

View File

@ -0,0 +1,179 @@
<?php
/**
* MT: Latest Posts
*
* Widget show the latest post with thumbnail.
*
* @package Sophia After Dark
* @since 1.0.0
*/
class sophia_after_dark_Latest_Posts extends WP_widget {
/**
* Register widget with WordPress.
*/
public function __construct() {
$widget_ops = array(
'classname' => 'sophia_after_dark_latest_posts',
'description' => __( 'A widget to display the latest posts with thumbnail.', 'sophia-after-dark' ),
'customize_selective_refresh' => true,
);
parent::__construct( 'sophia_after_dark_latest_posts', __( 'MT: Latest Posts', 'sophia-after-dark' ), $widget_ops );
}
/**
* Helper function that holds widget fields
* Array is used in update and form functions
*/
private function widget_fields() {
$fields = array(
'widget_title' => array(
'sophia_after_dark_widgets_name' => 'widget_title',
'sophia_after_dark_widgets_title' => __( 'Widget title', 'sophia-after-dark' ),
'sophia_after_dark_widgets_field_type' => 'text'
),
'widget_post_order' => array(
'sophia_after_dark_widgets_name' => 'widget_post_order',
'sophia_after_dark_widgets_title' => __( 'Post Order', 'sophia-after-dark' ),
'sophia_after_dark_widgets_default' => 'default',
'sophia_after_dark_widgets_field_type' => 'select',
'sophia_after_dark_widgets_field_options' => array(
'default' => __( 'Default Order', 'sophia-after-dark' ),
'random' => __( 'Random Order', 'sophia-after-dark' ),
)
),
'widget_post_count' => array(
'sophia_after_dark_widgets_name' => 'widget_post_count',
'sophia_after_dark_widgets_title' => __( 'Post Count', 'sophia-after-dark' ),
'sophia_after_dark_widgets_default' => '5',
'sophia_after_dark_widgets_field_type' => 'number'
)
);
return $fields;
}
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget( $args, $instance ) {
extract( $args );
if ( empty( $instance ) ) {
return ;
}
$sophia_after_dark_widget_title = empty( $instance['widget_title'] ) ? '' : $instance['widget_title'];
$sophia_after_dark_post_order = empty( $instance['widget_post_order'] ) ? 'default' : $instance['widget_post_order'];
$sophia_after_dark_post_count = empty( $instance['widget_post_count'] ) ? '5' : $instance['widget_post_count'];
echo $before_widget;
?>
<div class="mt-latest-posts-wrapper">
<?php
if ( !empty( $sophia_after_dark_widget_title ) ) {
echo $before_title . esc_html( $sophia_after_dark_widget_title ) . $after_title;
}
?>
<div class="mt-posts-content-wrapper">
<?php
$sophia_after_dark_posts_args = array(
'posts_per_page' => absint( $sophia_after_dark_post_count ),
'ignore_sticky_posts' => 1,
);
if ( 'random' === $sophia_after_dark_post_order ) {
$sophia_after_dark_posts_args['orderby'] = 'rand';
}
$sophia_after_dark_posts_query = new WP_Query( $sophia_after_dark_posts_args );
if ( $sophia_after_dark_posts_query->have_posts() ) {
while ( $sophia_after_dark_posts_query->have_posts() ) {
$sophia_after_dark_posts_query->the_post();
?>
<div class="mt-single-post-wrap">
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<figure><div class="mt-post-thumb"><?php the_post_thumbnail( 'thumbnail' ); ?></div></figure>
</a>
<?php } ?>
<div class="mt-post-content">
<h5 class="mt-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<div class="entry-cat">
<?php
sophia_after_dark_posted_on();
sophia_after_dark_posted_by();
?>
</div>
<?php sophia_after_dark_widget_entry_footer(); ?>
</div>
</div><!-- .mt-single-post-wrap -->
<?php
}
}
?>
</div><!-- .mt-posts-content-wrapper -->
</div><!-- .mt-latest-posts-wrapper -->
<?php
echo $after_widget;
}
/**
* Sanitize widget form values as they are saved.
*
* @see WP_Widget::update()
*
* @param array $new_instance Values just sent to be saved.
* @param array $old_instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_updated_field_value() defined in mt-widget-fields.php
*
* @return array Updated safe values to be saved.
*/
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
extract( $widget_field );
// Use helper function to get updated field values
$instance[$sophia_after_dark_widgets_name] = sophia_after_dark_widgets_updated_field_value( $widget_field, $new_instance[$sophia_after_dark_widgets_name] );
}
return $instance;
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_show_widget_field() defined in mt-widget-fields.php
*/
public function form( $instance ) {
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
// Make array elements available as variables
extract( $widget_field );
$sophia_after_dark_widgets_field_value = !empty( $instance[$sophia_after_dark_widgets_name] ) ? wp_kses_post( $instance[$sophia_after_dark_widgets_name] ) : '';
sophia_after_dark_widgets_show_widget_field( $this, $widget_field, $sophia_after_dark_widgets_field_value );
}
}
}

View File

@ -0,0 +1,128 @@
<?php
/**
* MT: Social Media
*
* Widget show the social media icons.
*
* @package Sophia After Dark
* @since 1.0.0
*/
class sophia_after_dark_Social_Media extends WP_widget {
/**
* Register widget with WordPress.
*/
public function __construct() {
$widget_ops = array(
'classname' => 'sophia_after_dark_social_media',
'description' => __( 'A widget shows the social media icons.', 'sophia-after-dark' ),
'customize_selective_refresh' => true,
);
parent::__construct( 'sophia_after_dark_social_media', __( 'MT: Social Media', 'sophia-after-dark' ), $widget_ops );
}
/**
* Helper function that holds widget fields
* Array is used in update and form functions
*/
private function widget_fields() {
$fields = array(
'widget_title' => array(
'sophia_after_dark_widgets_name' => 'widget_title',
'sophia_after_dark_widgets_title' => __( 'Widget title', 'sophia-after-dark' ),
'sophia_after_dark_widgets_field_type' => 'text'
)
);
return $fields;
}
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget( $args, $instance ) {
extract( $args );
if ( empty( $instance ) ) {
return ;
}
$sophia_after_dark_widget_title = empty( $instance['widget_title'] ) ? '' : $instance['widget_title'];
$get_social_media_icons = get_theme_mod( 'social_media_icons', '' );
$get_decode_social_media = json_decode( $get_social_media_icons );
echo $before_widget;
?>
<div class="mt-aside-social-wrapper">
<?php
if ( ! empty( $sophia_after_dark_widget_title ) ) {
echo $before_title . esc_html( $sophia_after_dark_widget_title ) . $after_title;
}
?>
<div class="mt-social-icons-wrapper">
<?php sophia_after_dark_social_media_content(); ?>
</div><!-- .mt-social-icons-wrapper -->
</div><!-- .mt-aside-social-wrapper -->
<?php
echo $after_widget;
}
/**
* Sanitize widget form values as they are saved.
*
* @see WP_Widget::update()
*
* @param array $new_instance Values just sent to be saved.
* @param array $old_instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_updated_field_value() defined in mt-widget-fields.php
*
* @return array Updated safe values to be saved.
*/
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
extract( $widget_field );
// Use helper function to get updated field values
$instance[$sophia_after_dark_widgets_name] = sophia_after_dark_widgets_updated_field_value( $widget_field, $new_instance[$sophia_after_dark_widgets_name] );
}
return $instance;
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*
* @uses sophia_after_dark_widgets_show_widget_field() defined in mt-widget-fields.php
*/
public function form( $instance ) {
$widget_fields = $this->widget_fields();
// Loop through fields
foreach ( $widget_fields as $widget_field ) {
// Make array elements available as variables
extract( $widget_field );
$sophia_after_dark_widgets_field_value = !empty( $instance[$sophia_after_dark_widgets_name] ) ? wp_kses_post( $instance[$sophia_after_dark_widgets_name] ) : '';
sophia_after_dark_widgets_show_widget_field( $this, $widget_field, $sophia_after_dark_widgets_field_value );
}
}
}

View File

@ -0,0 +1,154 @@
<?php
/**
* Define custom fields for widgets
*
* @package Sophia After Dark
* @since 1.0.0
*/
function sophia_after_dark_widgets_show_widget_field( $instance = '', $widget_field = '', $sophia_after_dark_widget_field_value = '' ) {
extract( $widget_field );
switch ( $sophia_after_dark_widgets_field_type ) {
/**
* text widget field
*/
case 'text'
?>
<p>
<span class="field-label"><label for="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>"><?php echo esc_html( $sophia_after_dark_widgets_title ); ?></label></span>
<input class="widefat" id="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>" name="<?php echo esc_attr( $instance->get_field_name( $sophia_after_dark_widgets_name ) ); ?>" type="text" value="<?php echo esc_html( $sophia_after_dark_widget_field_value ); ?>" />
<?php if ( isset( $sophia_after_dark_widgets_description ) ) { ?>
<br />
<em><?php echo wp_kses_post( $sophia_after_dark_widgets_description ); ?></em>
<?php } ?>
</p>
<?php
break;
/**
* Select field
*/
case 'select' :
if ( empty( $sophia_after_dark_widget_field_value ) ) {
$sophia_after_dark_widget_field_value = $sophia_after_dark_widgets_default;
}
?>
<p>
<label for="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>"><?php echo esc_html( $sophia_after_dark_widgets_title ); ?>:</label>
<select name="<?php echo esc_attr( $instance->get_field_name( $sophia_after_dark_widgets_name ) ); ?>" id="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>" class="widefat">
<?php foreach ( $sophia_after_dark_widgets_field_options as $select_option_name => $select_option_title ) { ?>
<option value="<?php echo esc_attr( $select_option_name ); ?>" id="<?php echo esc_attr( $instance->get_field_id( $select_option_name ) ); ?>" <?php selected( $select_option_name, $sophia_after_dark_widget_field_value ); ?>><?php echo esc_html( $select_option_title ); ?></option>
<?php } ?>
</select>
<?php if ( isset( $sophia_after_dark_widgets_description ) ) { ?>
<br />
<small><?php echo esc_html( $sophia_after_dark_widgets_description ); ?></small>
<?php } ?>
</p>
<?php
break;
/**
* user dropdown widget field
*/
case 'user_dropdown' :
if ( empty( $sophia_after_dark_widget_field_value ) ) {
$sophia_after_dark_widget_field_value = $sophia_after_dark_widgets_default;
}
$select_field = 'name="'. esc_attr( $instance->get_field_name( $sophia_after_dark_widgets_name ) ) .'" id="'. esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ) .'" class="widefat"';
?>
<p>
<label for="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>"><?php echo esc_html( $sophia_after_dark_widgets_title ); ?>:</label>
<?php
$dropdown_args = wp_parse_args( array(
'show_option_none' => __( '- - Select User - -', 'sophia-after-dark' ),
'selected' => esc_attr( $sophia_after_dark_widget_field_value ),
) );
$dropdown_args['echo'] = false;
$dropdown = wp_dropdown_users( $dropdown_args );
$dropdown = str_replace( '<select', '<select ' . $select_field, $dropdown );
echo $dropdown;
?>
</p>
<?php
break;
/**
* number widget field
*/
case 'number' :
if ( empty( $sophia_after_dark_widget_field_value ) ) {
$sophia_after_dark_widget_field_value = $sophia_after_dark_widgets_default;
}
?>
<p>
<label for="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>"><?php echo esc_html( $sophia_after_dark_widgets_title ); ?></label>
<input name="<?php echo esc_attr( $instance->get_field_name( $sophia_after_dark_widgets_name ) ); ?>" type="number" step="1" min="1" id="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>" value="<?php echo esc_html( $sophia_after_dark_widget_field_value ); ?>" class="small-text" />
<?php if ( isset( $sophia_after_dark_widgets_description ) ) { ?>
<br />
<em><?php echo wp_kses_post( $sophia_after_dark_widgets_description ); ?></em>
<?php } ?>
</p>
<?php
break;
/**
* upload file field
*/
case 'upload':
$image = $image_class = "";
if ( $sophia_after_dark_widget_field_value ) {
$image = '<img src="'.esc_url( $sophia_after_dark_widget_field_value ).'" style="max-width:100%;"/>';
$image_class = ' hidden';
}
?>
<div class="attachment-media-view">
<label for="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>"><?php echo esc_html( $sophia_after_dark_widgets_title ); ?>:</label><br />
<div class="placeholder<?php echo esc_attr( $image_class ); ?>">
<?php esc_html_e( 'No image selected', 'sophia-after-dark' ); ?>
</div>
<div class="thumbnail thumbnail-image">
<?php echo $image; ?>
</div>
<div class="actions mt-clearfix">
<button type="button" class="button mt-delete-button align-left"><?php esc_html_e( 'Remove', 'sophia-after-dark' ); ?></button>
<button type="button" class="button mt-upload-button alignright"><?php esc_html_e( 'Select Image', 'sophia-after-dark' ); ?></button>
<input name="<?php echo esc_attr( $instance->get_field_name( $sophia_after_dark_widgets_name ) ); ?>" id="<?php echo esc_attr( $instance->get_field_id( $sophia_after_dark_widgets_name ) ); ?>" class="upload-id" type="hidden" value="<?php echo esc_url( $sophia_after_dark_widget_field_value ) ?>"/>
</div>
<?php if ( isset( $sophia_after_dark_widgets_description ) ) { ?>
<br />
<small><?php echo wp_kses_post( $sophia_after_dark_widgets_description ); ?></small>
<?php } ?>
</div>
<?php
break;
}
}
function sophia_after_dark_widgets_updated_field_value( $widget_field, $new_field_value ) {
extract( $widget_field );
if ( $sophia_after_dark_widgets_field_type == 'number') {
return absint( $new_field_value );
} elseif ( $sophia_after_dark_widgets_field_type == 'upload' ) {
return esc_url( $new_field_value );
} else {
return sanitize_text_field( $new_field_value );
}
}

View File

@ -0,0 +1,83 @@
<?php
/**
* custom function and work related to widgets.
*
* @package Sophia After Dark
* @since 1.0.0
*/
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function sophia_after_dark_widgets_init() {
/**
* Register default sidebar
*
* @since 1.0.0
*/
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'sophia-after-dark' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'sophia-after-dark' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
) );
/**
* Register Header Ads Section
*
* @since 1.0.0
*/
register_sidebar( array(
'name' => esc_html__( 'Header Ads Section', 'sophia-after-dark' ),
'id' => 'header-ads-section',
'description' => esc_html__( 'Add MT: Ads Banner widgets here.', 'sophia-after-dark' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
) );
/**
* Register 4 different footer area
*
* @since 1.0.0
*/
register_sidebars( 4 , array(
'name' => esc_html__( 'Footer %d', 'sophia-after-dark' ),
'id' => 'footer-sidebar',
'description' => esc_html__( 'Added widgets are display at Footer Widget Area.', 'sophia-after-dark' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
) );
// Author Info
register_widget( 'sophia_after_dark_Author_Info' );
// Latest Posts
register_widget( 'sophia_after_dark_Latest_Posts' );
//Social Media
register_widget( 'sophia_after_dark_Social_Media' );
}
add_action( 'widgets_init', 'sophia_after_dark_widgets_init' );
/*-----------------------------------------------------------------------------------------------------------------------*/
/**
* Load widget required files
*
* @since 1.0.0
*/
require get_template_directory() . '/inc/widgets/mt-widget-fields.php'; // Widget fields
require get_template_directory() . '/inc/widgets/mt-author-info.php'; // Author Info
require get_template_directory() . '/inc/widgets/mt-latest-posts.php'; // Latest Posts
require get_template_directory() . '/inc/widgets/mt-social-media.php'; // Social Media

66
index.php Normal file
View File

@ -0,0 +1,66 @@
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
get_header();
?>
<div class="mt-page-content-wrapper">
<div itemscope id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '<div class="archive-grid-post-wrapper">';
}
if ( have_posts() ) :
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
<div class="sophia-after-dark-content-masonry">
<div id="mt-masonry">
<?php
}
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
</div><!-- #mt-masonry -->
</div><!-- .sophia-after-dark-content-masonry -->
<?php
}
the_posts_pagination();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '</div>';
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .mt-page-content-wrapper -->
<?php
get_footer();

File diff suppressed because it is too large Load Diff

7
languages/readme.txt Normal file
View File

@ -0,0 +1,7 @@
Place your theme language files in this directory.
Please visit the following links to learn more about translating WordPress themes:
https://make.wordpress.org/polyglots/teams/
https://developer.wordpress.org/themes/functionality/localization/
https://developer.wordpress.org/reference/functions/load_theme_textdomain/

37
page.php Normal file
View File

@ -0,0 +1,37 @@
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
get_header();
?>
<div class="mt-page-content-wrapper">
<div itemscope id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'page' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .mt-page-content-wrapper -->
<?php
get_footer();

538
rtl.css Normal file
View File

@ -0,0 +1,538 @@
/* 146 of 1186 CSS properties converted by rtl.daskhat.ir
These properties should be override originals.
just load rtl css file after original css file.*/
/* body {direction:rtl;} */
caption, th, td{
text-align: right;
}
blockquote::before, q::before{
right: -20px;
}
blockquote:after, q:after{
left: 0;
}
blockquote cite::before{
margin-left: 10px;
}
ul, ol{
margin: 0 20px 15px 0 ;
}
li>ul, li>ol{
margin-right: 15px;
}
textarea{
padding-right: 3px;
}
.screen-reader-text:hover, .screen-reader-text:active, .screen-reader-text:focus{
right: 5px;
}
.alignleft{
float: right;
margin-left: 15px;
}
.alignright{
float: left;
margin-right: 15px;
}
.posted-on a {
margin-left: 46px;
margin-right: auto;
}
.posted-on a::before {
left: -86px;
right: auto;
}
.comments-link{
float: left;
}
.edit-link .post-edit-link:before{
margin-left: 5px;
}
article.hentry .entry-footer>span{
margin-left: 15px;
}
.nav-links .nav-next{
text-align: right;
}
.nav-links .nav-previous{
text-align: left;
}
.nav-links .nav-previous a:before{
margin-left: 5px;
}
.nav-links .nav-next a:after{
margin-right: 5px;
}
.entry-thumbnail{
float: right;
}
.entry-exrecpt{
float: left;
}
.short-content+.bttn{
float: left;
}
.gallery{
margin-right: -2%;
}
.comment-form-cookies-consent label{
margin-right: 14px;
}
.comments-area ol.children{
margin: 0 15px 0 0 ;
}
.comment-list .comment-body{
text-align: right;
}
.comment-author img{
margin-left: 15px;
}
.widget_meta a::before,
.widget_nav_menu li a::before {
content: "\f104";
}
.comment-metadata{
padding-right: 50px;
}
.comment-content{
padding-right: 50px;
}
.commentmetadata{
float: left;
}
.reply .comment-reply-link{
background: none repeat scroll right 0 #dd3333;
}
#cancel-comment-reply-link:before{
margin: 0 20px 0 5px ;
}
.mt-column-wrapper{
margin-right: -3%;
}
.mt-column-1{
margin-left: -4px;
margin-right: 3%;
}
.mt-column-2{
margin-left: -4px;
margin-right: 3%;
}
.mt-column-3{
margin-left: -4px;
margin-right: 3%;
}
.mt-column-4{
margin-left: -4px;
margin-right: 3%;
}
.mt-column-5{
margin-left: -4px;
margin-right: 3%;
}
.widget_archive a, .widget_categories a, .widget_recent_entries a, .widget_meta a, .widget_recent_comments li, .widget_rss li, .widget_pages li a, .widget_nav_menu li a{
padding-right: 22px;
}
.widget_archive a::before, .widget_categories a::before, .widget_recent_entries a::before, .widget_meta a::before, .widget_recent_comments li::before, .widget_rss li:before, .widget_pages li a:before, .widget_nav_menu li a:before{
right: 0;
}
.widget_search .search-field{
float: right;
}
.widget_recent_entries .post-date{
padding-right: 24px;
}
.widget_nav_menu .sub-menu{
margin: 10px 10px 0 0 ;
}
#primary, .home.blog #primary{
float: right;
}
#secondary, .home.blog #secondary{
float: left;
}
.left-sidebar #primary, .home.left-sidebar #primary{
float: left;
}
.left-sidebar #secondary, .home.left-sidebar #secondary{
float: right;
}
body.site-layout--boxed{
background: #f4f4f4 none repeat scroll right 0;
}
#page{
background: #fff none repeat scroll right 0;
}
.trending-wrapper{
float: right;
}
.wrap-label{
float: right;
margin-left: 20px;
}
.wrap-label i{
margin-left: 5px;
}
.tags-wrapper{
float: right;
}
.tags-wrapper a{
margin-left: 16px;
}
.trending-wrapper.tag-before-icon .tags-wrapper a::before{
margin-left: 2px;
}
.top-header-nav{
float: left;
}
#top-navigation ul li{
margin: 0 12px 0 0 ;
}
.header-widget-wrapper{
float: left;
}
.mt-header-social-wrapper, .mt-header-extra-icons{
float: right;
}
.mt-social-icon-wrap{
float: left;
}
.mt-social-icon-wrap li{
margin-left: 12px;
}
.site-branding{
float: right;
}
#site-navigation{
float: right;
margin-left: 20px;
}
.mt-social-search-wrapper{
float: left;
}
.mt-social-wrapper{
float: right;
}
.mt-follow-title{
margin-left: 10px;
}
.mt-menu-search{
float: left;
}
.mt-search-icon{
margin: 15px 40px 15px 0 ;
}
.mt-search-icon i{
margin-right: 5px;
}
.mt-menu-search .mt-form-wrap{
right: 0;
}
.mt-menu-search .mt-form-wrap .search-form{
right: 50%;
margin-right: -50%;
}
.mt-form-close{
left: 40px;
}
.menu-toggle{
float: right;
}
.menu-toggle i{
margin-left: 7px;
}
#site-navigation ul#primary-menu > li:first-child a{
padding-right: 0;
}
#site-navigation ul#primary-menu > li:first-child ul a{
padding-right: 30px;
}
#site-navigation ul li a::after{
left: 0;
}
#site-navigation ul li .sub-menu, #site-navigation ul li .children{
text-align: right;
right: 0;
}
#site-navigation ul li .sub-menu ul, #site-navigation ul li .children ul{
right: 100%;
}
#site-navigation ul li .sub-menu li a, #site-navigation ul li .children li a{
border-left: none;
}
#site-navigation .menu-item-description {
left: -20px;
right: auto;
}
#site-navigation .menu-item-description::after{
right: 0;
border-width: 3px 0 0 3px ;
border-color: #dd3333 transparent transparent transparent ;
}
.front-slider-block{
float: right;
}
.top-featured-post-main-wrapper{
float: left;
}
.post-info-wrap{
background: linear-gradient(to bottom,rgba(0,0,0,0) 100% 100%);
padding: 140px 30px 20px 30px ;
direction: rtl;
}
.front-slider-block .posted-on a::before{
left: -86px;
right: auto;
}
.slider-post-wrap .post-thumbnail > a{
right: 0;
}
.post-categories li{
margin-left: 5px;
}
.post-cats-list a{
margin-left: 5px;
}
.front-slider-block .lSAction{
left: 20px;
}
.front-slider-block .lSAction > a{
background: rgba(0, 0, 0, 0.7) none repeat scroll right 0;
}
.features-post-title{
padding-right: 40px;
}
.top-featured-post-wrap .post-thumbnail{
float: right;
}
.top-featured-post-wrap .mt-post-content{
float: left;
}
.top-featured-post-wrap .post-thumbnail .post-number{
right: 0;
}
.entry-footer .mt-readmore-btn i, .btn-wrapper a i , .mt-readmore-btn i{
margin-right: 5px;
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.entry-footer .mt-readmore-btn:hover i, .btn-wrapper a:hover i, .mt-readmore-btn:hover i{
margin-right: 10px;
}
article.sticky::before{
right: 20px;
}
.widget_recent_entries a::before {
content: "\f100";
}
.archive-grid-post-wrapper, .mt-archive--masonry-style .sophia-after-dark-content-masonry{
margin-right: -3%;
}
.mt-archive--block-grid-style article, .mt-archive--masonry-style #mt-masonry article{
margin-right: 3%;
margin-left: -4px;
}
.mt-archive--masonry-style #mt-masonry article{
margin-left: 0;
}
#secondary .widget .widget-title, .mt-related-post-title, #colophon .widget .widget-title{
padding-right: 35px;
}
#secondary .widget .widget-title::before, .mt-related-post-title:before, #colophon .widget .widget-title:before, .features-post-title:before{
right: 0;
}
.mt-author-box{
text-align: right;
}
.single .mt-author-box .mt-author__avatar{
float: right;
margin-left: 2%;
}
.single .mt-author-box .mt-author-info{
float: right;
}
.error-404.not-found{
padding: 30px 0 40px 0 ;
}
.error-num span{
margin-right: 10px;
}
.error404 .section-title{
margin-right: 3%;
}
.breadcrumbs .trail-items li::after {
content: "\f100";
}
.breadcrumbs .trail-items li::after{
left: -10px;
}
#top-footer .mt-footer-widget-wrapper{
margin-right: -3%;
}
#top-footer.footer-column-one .mt-footer-widget, #top-footer.footer-column-two .mt-footer-widget, #top-footer.footer-column-three .mt-footer-widget, #top-footer.footer-column-four .mt-footer-widget{
margin-right: 3%;
margin-left: -4px;
}
#footer-navigation{
float: left;
}
#footer-menu li a{
border-right: 1px solid #e1e1e1;
}
.site-info{
float: right;
}
.sophia_after_dark_latest_posts .mt-single-post-wrap > a{
float: right;
}
.sophia_after_dark_latest_posts .mt-post-content{
float: left;
}
.mt-related-posts-wrapper{
margin-right: -3%;
}
.mt-related-posts-wrapper article{
margin-right: 3%;
margin-left: -4px;
}
#mt-scrollup{
left: 40px;
margin-left: 0;
}
#mt-scrollup::before{
left: -36px;
padding: 3px 6px 2px 4px ;
}
.search-no-results #primary input, .search-no-results #primary input[type="text"]:focus, .search-no-results #primary input[type="email"]:focus, .search-no-results #primary input[type="url"]:focus, .search-no-results #primary input[type="password"]:focus, .search-no-results #primary input[type="search"]:focus, .search-no-results #primary textarea:focus{
border-right: 0px;
border-left: 0px;
}

1
screenshot.png Normal file
View File

@ -0,0 +1 @@
‰PNG

58
search.php Normal file
View File

@ -0,0 +1,58 @@
<?php
/**
* The template for displaying search results pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Sophia After Dark
* @since 1.0.0
*/
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
get_header();
?>
<div class="mt-page-content-wrapper">
<section id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '<div class="archive-grid-post-wrapper">';
}
if ( have_posts() ) :
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
<div class="sophia-after-dark-content-masonry">
<div id="mt-masonry">
<?php
}
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'search' );
endwhile;
if ( 'mt-archive--masonry-style' === $archive_style ) {
?>
</div><!-- #mt-masonry -->
</div><!-- .sophia-after-dark-content-masonry -->
<?php
}
the_posts_pagination();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
if ( 'mt-archive--block-grid-style' === $archive_style ) {
echo '</div>';
}
?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .mt-page-content-wrapper -->
<?php
get_footer();

54
sidebar-footer.php Normal file
View File

@ -0,0 +1,54 @@
<?php
/**
* The Sidebar containing the footer widget areas.
*
* @package Sophia After Dark
* @since 1.0.0
*/
/**
* The footer widget area is triggered if any of the areas
* have widgets. So let's check that first.
*
* If none of the sidebars have widgets, then let's bail early.
*/
if ( ! is_active_sidebar( 'footer-sidebar' ) &&
! is_active_sidebar( 'footer-sidebar-2' ) &&
! is_active_sidebar( 'footer-sidebar-3' ) &&
! is_active_sidebar( 'footer-sidebar-4' ) ) {
return;
}
$sophia_after_dark_widget_area_layout = get_theme_mod( 'sophia_after_dark_widget_area_layout', 'column-three' );
?>
<div id="top-footer" class="footer-widgets-wrapper footer-<?php echo esc_attr( $sophia_after_dark_widget_area_layout ); ?> mt-clearfix">
<div class="mt-container">
<div class="footer-widgets-area mt-clearfix">
<div class="mt-footer-widget-wrapper mt-column-wrapper mt-clearfix">
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.3s">
<?php dynamic_sidebar( 'footer-sidebar' ); ?>
</div>
<?php if ( $sophia_after_dark_widget_area_layout != 'column-one' ){ ?>
<div class="mt-footer-widget wow fadeInLeft" data-woww-duration="0.6s">
<?php dynamic_sidebar( 'footer-sidebar-2' ); ?>
</div>
<?php } ?>
<?php if ( $sophia_after_dark_widget_area_layout == 'column-three' || $sophia_after_dark_widget_area_layout == 'column-four' ){ ?>
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.9s">
<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
</div>
<?php } ?>
<?php if ( $sophia_after_dark_widget_area_layout == 'column-four' ){ ?>
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="1.2s">
<?php dynamic_sidebar( 'footer-sidebar-4' ); ?>
</div>
<?php } ?>
</div><!-- .mt-footer-widget-wrapper -->
</div><!-- .footer-widgets-area -->
</div><!-- .mt-container -->
</div><!-- .footer-widgets-wrapper -->

17
sidebar.php Normal file
View File

@ -0,0 +1,17 @@
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Sophia After Dark
* @since 1.0.0
*/
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;
}
?>
<aside id="secondary" class="widget-area">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</aside><!-- #secondary -->

40
single.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Sophia After Dark
* @since 1.0.0
*/
get_header();
?>
<div class="mt-page-content-wrapper">
<div itemscope id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'single' );
the_post_navigation();
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
$related_posts_option = get_theme_mod( 'sophia_after_dark_enable_related_posts', true );
if ( true === $related_posts_option && 'post' === get_post_type() ) {
get_template_part( 'template-parts/related/related', 'posts' );
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .mt-page-content-wrapper -->
<?php
get_footer();

3112
style.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
<?php
/**
* Displays Author bio on single post
*
* @package Sophia After Dark
* @since 1.0.0
*/
$author_id = get_the_author_meta( 'ID' );
$author_avatar = get_avatar( $author_id, 'thumbnail' );
$author_post_link = get_the_author_posts_link();
$author_bio = get_the_author_meta( 'description' );
$author_url = get_the_author_meta( 'user_url' );
?>
<div class="mt-author-box">
<?php if ( $author_avatar ) { ?>
<div itemprop="image" class="mt-author__avatar">
<?php echo wp_kses_post( $author_avatar ); ?>
</div><!-- .mt-author-avatar -->
<?php } ?>
<div class="mt-author-info">
<?php if ( $author_post_link ) { ?>
<h5 itemprop="name" class="mt-author-name"><?php echo wp_kses_post( $author_post_link ); ?></h5>
<?php } ?>
<?php if ( $author_bio ) { ?>
<div class="mt-author-bio">
<?php echo wp_kses_post( $author_bio ); ?>
</div><!-- .mt-author-bio -->
<?php } ?>
<div class="mt-author-meta">
<?php if ( $author_url ) { ?>
<div class="mt-author-website">
<span><?php esc_html_e( 'Website', 'sophia-after-dark' ); ?>&#58;</span>
<a href="<?php echo esc_url( $author_url ); ?>" target="_blank"><?php echo esc_url( $author_url ); ?></a>
</div><!-- .mt-author-website -->
<?php } ?>
</div><!-- .mt-author-meta -->
</div><!-- .mt-author-info -->
</div><!-- .mt-author-bio -->

View File

@ -0,0 +1,45 @@
<?php
/**
* Template part for displaying a message that posts cannot be found
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'sophia-after-dark' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) :
printf(
'<p>' . wp_kses(
/* translators: 1: link to WP admin new post page. */
__( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'sophia-after-dark' ),
array(
'a' => array(
'href' => array(),
),
)
) . '</p>',
esc_url( admin_url( 'post-new.php' ) )
);
elseif ( is_search() ) :
?>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'sophia-after-dark' ); ?></p>
<?php
get_search_form();
else :
?>
<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'sophia-after-dark' ); ?></p>
<?php
get_search_form();
endif;
?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -0,0 +1,45 @@
<?php
/**
* Template part for displaying page content in page.php
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Sophia After Dark
* @since 1.0.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php sophia_after_dark_post_thumbnail(); ?>
<div class="entry-content">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'sophia-after-dark' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-<?php the_ID(); ?> -->

Some files were not shown because too many files have changed in this diff Show More