Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0e9321b01a
|
|||
|
c6bb1b7c7b
|
|||
|
c11d3aa945
|
|||
|
5b61ac08fa
|
|||
| fde9ad204d | |||
| 04f8e589dc | |||
|
3d2230f068
|
|||
|
79970b34e9
|
|||
|
a78c887697
|
|||
|
faaaaafb39
|
|||
|
0869581510
|
|||
|
0cd241571f
|
|||
|
b7cdf496b6
|
|||
|
ce3e0f2e75
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
vendor
|
||||||
|
composer.lock
|
||||||
16
404.php
16
404.php
@@ -26,11 +26,11 @@ $sophia_after_dark_pnf_latest_posts = get_theme_mod( 'sophia_after_dark_enable_p
|
|||||||
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'sophia-after-dark' ); ?></p>
|
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'sophia-after-dark' ); ?></p>
|
||||||
</div><!-- .page-content -->
|
</div>
|
||||||
</section><!-- .error-404 -->
|
</section>
|
||||||
|
|
||||||
<?php if ( true === $sophia_after_dark_pnf_latest_posts ) : ?>
|
<?php if ( true === $sophia_after_dark_pnf_latest_posts ) : ?>
|
||||||
<div class="page-extra-content mt-404-latest-posts-wrapper">
|
<div class="page-extra-content sad-404-latest-posts-wrapper">
|
||||||
<?php
|
<?php
|
||||||
$sophia_after_dark_pnf_latest_post_count = get_theme_mod( 'sophia_after_dark_pnf_latest_post_count', 3 );
|
$sophia_after_dark_pnf_latest_post_count = get_theme_mod( 'sophia_after_dark_pnf_latest_post_count', 3 );
|
||||||
$sophia_after_dark_pnf_args = array(
|
$sophia_after_dark_pnf_args = array(
|
||||||
@@ -41,9 +41,9 @@ $sophia_after_dark_pnf_latest_posts = get_theme_mod( 'sophia_after_dark_enable_p
|
|||||||
$sophia_after_dark_pnf_query = new WP_Query( $sophia_after_dark_pnf_args );
|
$sophia_after_dark_pnf_query = new WP_Query( $sophia_after_dark_pnf_args );
|
||||||
|
|
||||||
if ( $sophia_after_dark_pnf_query->have_posts() ) :
|
if ( $sophia_after_dark_pnf_query->have_posts() ) :
|
||||||
echo '<div class="mt-pnf-latest-posts-wrapper mt-related-posts-wrapper">';
|
echo '<div class="sad-pnf-latest-posts-wrapper sad-related-posts-wrapper">';
|
||||||
$sophia_after_dark_404_latest_title = get_theme_mod( 'sophia_after_dark_pnf_latest_title', __( 'You May Like', 'sophia-after-dark' ) );
|
$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>';
|
echo '<h2 class="section-title sad-related-post-title">' . esc_html( $sophia_after_dark_404_latest_title ) . '</h2>';
|
||||||
|
|
||||||
while ( $sophia_after_dark_pnf_query->have_posts() ) :
|
while ( $sophia_after_dark_pnf_query->have_posts() ) :
|
||||||
$sophia_after_dark_pnf_query->the_post();
|
$sophia_after_dark_pnf_query->the_post();
|
||||||
@@ -55,11 +55,11 @@ $sophia_after_dark_pnf_latest_posts = get_theme_mod( 'sophia_after_dark_enable_p
|
|||||||
|
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
?>
|
?>
|
||||||
</div><!-- .mt-404-latest-posts-wrapper -->
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</main><!-- #main -->
|
</main>
|
||||||
</div><!-- #primary -->
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer();
|
get_footer();
|
||||||
|
|||||||
32
archive.php
32
archive.php
@@ -8,22 +8,22 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
get_header();
|
get_header();
|
||||||
?>
|
?>
|
||||||
<div class="mt-page-content-wrapper">
|
<div class="sad-page-content-wrapper">
|
||||||
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/CollectionPage">
|
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/CollectionPage">
|
||||||
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Archive Content', 'sophia-after-dark' ); ?>">
|
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Archive Content', 'sophia-after-dark' ); ?>">
|
||||||
|
|
||||||
<?php if ( 'mt-archive--block-grid-style' === $archive_style ) : ?>
|
<?php if ( 'sad-archive--block-grid-style' === $archive_style ) : ?>
|
||||||
<div class="archive-grid-post-wrapper">
|
<div class="archive-grid-post-wrapper">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ( have_posts() ) : ?>
|
<?php if ( have_posts() ) : ?>
|
||||||
|
|
||||||
<?php if ( 'mt-archive--masonry-style' === $archive_style ) : ?>
|
<?php if ( 'sad-archive--masonry-style' === $archive_style ) : ?>
|
||||||
<div class="sophia-after-dark-content-masonry">
|
<div class="sophia-after-dark-content-masonry">
|
||||||
<div id="mt-masonry">
|
<div id="sad-masonry">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -37,18 +37,20 @@ get_header();
|
|||||||
endwhile;
|
endwhile;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ( 'mt-archive--masonry-style' === $archive_style ) : ?>
|
<?php if ( 'sad-archive--masonry-style' === $archive_style ) : ?>
|
||||||
</div><!-- #mt-masonry -->
|
</div>
|
||||||
</div><!-- .sophia-after-dark-content-masonry -->
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Archive pagination
|
// Archive pagination
|
||||||
the_posts_pagination( array(
|
the_posts_pagination(
|
||||||
|
array(
|
||||||
'prev_text' => __( 'Previous', 'sophia-after-dark' ),
|
'prev_text' => __( 'Previous', 'sophia-after-dark' ),
|
||||||
'next_text' => __( 'Next', 'sophia-after-dark' ),
|
'next_text' => __( 'Next', 'sophia-after-dark' ),
|
||||||
'before_page_number' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'sophia-after-dark' ) . ' </span>',
|
'before_page_number' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'sophia-after-dark' ) . ' </span>',
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
@@ -57,14 +59,14 @@ get_header();
|
|||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ( 'mt-archive--block-grid-style' === $archive_style ) : ?>
|
<?php if ( 'sad-archive--block-grid-style' === $archive_style ) : ?>
|
||||||
</div><!-- .archive-grid-post-wrapper -->
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</main><!-- #main -->
|
</main>
|
||||||
</div><!-- #primary -->
|
</div>
|
||||||
|
|
||||||
<?php get_sidebar(); ?>
|
<?php get_sidebar(); ?>
|
||||||
</div><!-- .mt-page-content-wrapper -->
|
</div>
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
#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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.mt-meta-options-wrap .ui-button {
|
.sad-meta-options-wrap .ui-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
box-shadow: none
|
box-shadow: none
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-meta-options-wrap .ui-button-text {
|
.sad-meta-options-wrap .ui-button-text {
|
||||||
padding: 0
|
padding: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-meta-options-wrap img {
|
.sad-meta-options-wrap img {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
@@ -19,22 +19,22 @@
|
|||||||
border: 4px solid transparent
|
border: 4px solid transparent
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-meta-options-wrap img:focus,
|
.sad-meta-options-wrap img:focus,
|
||||||
.mt-meta-options-wrap img:hover {
|
.sad-meta-options-wrap img:hover {
|
||||||
border-color: #ddd
|
border-color: #ddd
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-meta-options-wrap .ui-state-active img {
|
.sad-meta-options-wrap .ui-state-active img {
|
||||||
border-color: #00a0d2
|
border-color: #00a0d2
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-clearfix:after,
|
.sad-clearfix:after,
|
||||||
.mt-clearfix:before {
|
.sad-clearfix:before {
|
||||||
content: '';
|
content: '';
|
||||||
display: table
|
display: table
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-clearfix:after {
|
.sad-clearfix:after {
|
||||||
clear: both
|
clear: both
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,24 +2,24 @@
|
|||||||
* Customizer styles
|
* Customizer styles
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.customize-control-mt-toggle label {
|
.customize-control-sad-toggle label {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle label .customize-control-title {
|
.customize-control-sad-toggle label .customize-control-title {
|
||||||
width: calc(100% - 55px);
|
width: calc(100% - 55px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle label .description {
|
.customize-control-sad-toggle label .description {
|
||||||
order: 99;
|
order: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle input[type=checkbox] {
|
.customize-control-sad-toggle input[type=checkbox] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle .switch {
|
.customize-control-sad-toggle .switch {
|
||||||
border: 1px solid rgba(0, 0, 0, .1);
|
border: 1px solid rgba(0, 0, 0, .1);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 35px;
|
width: 35px;
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
transition: background 350ms ease;
|
transition: background 350ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle .switch:after,
|
.customize-control-sad-toggle .switch:after,
|
||||||
.customize-control-mt-toggle .switch:before {
|
.customize-control-sad-toggle .switch:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
@@ -46,51 +46,51 @@
|
|||||||
transition: all 350ms cubic-bezier(0, .95, .38, .98), background 150ms ease;
|
transition: all 350ms cubic-bezier(0, .95, .38, .98), background 150ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle .switch:before {
|
.customize-control-sad-toggle .switch:before {
|
||||||
background: rgba(0, 0, 0, .2);
|
background: rgba(0, 0, 0, .2);
|
||||||
transform: translate3d(0, -50%, 0) scale(0);
|
transform: translate3d(0, -50%, 0) scale(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle .switch:after {
|
.customize-control-sad-toggle .switch:after {
|
||||||
background: #999;
|
background: #999;
|
||||||
border: 1px solid rgba(0, 0, 0, .1);
|
border: 1px solid rgba(0, 0, 0, .1);
|
||||||
transform: translate3d(0, -50%, 0);
|
transform: translate3d(0, -50%, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle .switch:active:before {
|
.customize-control-sad-toggle .switch:active:before {
|
||||||
transform: translate3d(0, -50%, 0) scale(3);
|
transform: translate3d(0, -50%, 0) scale(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle input:checked+.switch {
|
.customize-control-sad-toggle input:checked+.switch {
|
||||||
background: rgba(52, 152, 222, .3);
|
background: rgba(52, 152, 222, .3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle input:checked+.switch:before {
|
.customize-control-sad-toggle input:checked+.switch:before {
|
||||||
background: rgba(52, 152, 222, .075);
|
background: rgba(52, 152, 222, .075);
|
||||||
transform: translate3d(100%, -50%, 0) scale(1);
|
transform: translate3d(100%, -50%, 0) scale(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle input:checked+.switch:after {
|
.customize-control-sad-toggle input:checked+.switch:after {
|
||||||
background: #3498de;
|
background: #3498de;
|
||||||
transform: translate3d(100%, -50%, 0);
|
transform: translate3d(100%, -50%, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-toggle input:checked+.switch:active:before {
|
.customize-control-sad-toggle input:checked+.switch:active:before {
|
||||||
background: rgba(52, 152, 222, .075);
|
background: rgba(52, 152, 222, .075);
|
||||||
transform: translate3d(100%, -50%, 0) scale(3);
|
transform: translate3d(100%, -50%, 0) scale(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image>.image {
|
.customize-control-sad-radio-image>.image {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image label {
|
.customize-control-sad-radio-image label {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image label .image-label {
|
.customize-control-sad-radio-image label .image-label {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image label .image-label .inner {
|
.customize-control-sad-radio-image label .image-label .inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -109,25 +109,25 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image label:hover .image-label {
|
.customize-control-sad-radio-image label:hover .image-label {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input {
|
.customize-control-sad-radio-image input {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input img {
|
.customize-control-sad-radio-image input img {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input:checked+label img {
|
.customize-control-sad-radio-image input:checked+label img {
|
||||||
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
|
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .25);
|
||||||
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;
|
border: 1px solid #3498db;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input+label .image-clickable {
|
.customize-control-sad-radio-image input+label .image-clickable {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -151,15 +151,15 @@
|
|||||||
border: 1px solid #3498db;
|
border: 1px solid #3498db;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input+label .image-clickable {
|
.customize-control-sad-radio-image input+label .image-clickable {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
background: 0 0;
|
background: 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input+label .image-clickable,
|
.customize-control-sad-radio-image input+label .image-clickable,
|
||||||
.customize-control-mt-radio-image input:checked+label img {
|
.customize-control-sad-radio-image input:checked+label img {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
@@ -167,54 +167,54 @@
|
|||||||
border: 3px solid transparent;
|
border: 3px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input+label .image-clickable:focus,
|
.customize-control-sad-radio-image input+label .image-clickable:focus,
|
||||||
.customize-control-mt-radio-image input+label .image-clickable:hover {
|
.customize-control-sad-radio-image input+label .image-clickable:hover {
|
||||||
border-color: #ddd;
|
border-color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input:checked+label img {
|
.customize-control-sad-radio-image input:checked+label img {
|
||||||
border-color: #00a0d2;
|
border-color: #00a0d2;
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image .image label {
|
.customize-control-sad-radio-image .image label {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image input:checked+label img {
|
.customize-control-sad-radio-image input:checked+label img {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-radio-image>.image {
|
.customize-control-sad-radio-image>.image {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-clearfix:after,
|
.sad-clearfix:after,
|
||||||
.mt-clearfix:before {
|
.sad-clearfix:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-clearfix:after {
|
.sad-clearfix:after {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-control {
|
.sad-repeater-field-control {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-footer {
|
.sad-repeater-footer {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-control:first-child .mt-repeater-footer {
|
.sad-repeater-field-control:first-child .sad-repeater-footer {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-title {
|
.sad-repeater-field-title {
|
||||||
padding: 13px 15px;
|
padding: 13px 15px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-title:after {
|
.sad-repeater-field-title:after {
|
||||||
content: "\f142";
|
content: "\f142";
|
||||||
font: 400 20px/1 dashicons;
|
font: 400 20px/1 dashicons;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -242,11 +242,11 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-control.expanded .mt-repeater-field-title:after {
|
.sad-repeater-field-control.expanded .sad-repeater-field-title:after {
|
||||||
content: "\f140"
|
content: "\f140"
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-fields {
|
.sad-repeater-fields {
|
||||||
padding: 0 10px 10px;
|
padding: 0 10px 10px;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
@@ -255,19 +255,19 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-fields .customize-control-title {
|
.sad-repeater-fields .customize-control-title {
|
||||||
margin-top: 10px
|
margin-top: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-field-control.expanded .mt-repeater-fields {
|
.sad-repeater-field-control.expanded .sad-repeater-fields {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-reapeater-add-control-field {
|
.sad-reapeater-add-control-field {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-reapeater-add-add-control-field:before {
|
.sad-reapeater-add-add-control-field:before {
|
||||||
content: "\f132";
|
content: "\f132";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -277,11 +277,11 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-type-icon {
|
.sad-repeater-type-icon {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-selected-icon {
|
.sad-repeater-selected-icon {
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
line-height: 45px;
|
line-height: 45px;
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-selected-icon span {
|
.sad-repeater-selected-icon span {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
right: -45px;
|
right: -45px;
|
||||||
@@ -304,15 +304,15 @@
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-selected-icon i {
|
.sad-repeater-selected-icon i {
|
||||||
margin-top: 3%;
|
margin-top: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-selected-icon span i {
|
.sad-repeater-selected-icon span i {
|
||||||
margin-top: 24%;
|
margin-top: 24%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-icon-list {
|
.sad-repeater-icon-list {
|
||||||
height: 215px;
|
height: 215px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-icon-list li {
|
.sad-repeater-icon-list li {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 4% 3% 0;
|
margin: 4% 3% 0;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -337,23 +337,23 @@
|
|||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-icon-list li:hover {
|
.sad-repeater-icon-list li:hover {
|
||||||
background: #333;
|
background: #333;
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-repeater-icon-list li.icon-active {
|
.sad-repeater-icon-list li.icon-active {
|
||||||
background: #0073aa;
|
background: #0073aa;
|
||||||
border: 1px solid #0073aa;
|
border: 1px solid #0073aa;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-repeater .mt-limit-msg {
|
.customize-control-sad-repeater .sad-limit-msg {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customize-control-mt-repeater span.mt-limit-msg:nth-of-type(2) {
|
.customize-control-sad-repeater span.sad-limit-msg:nth-of-type(2) {
|
||||||
display: block;
|
display: block;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
@media (max-width:1400px) {
|
@media (max-width:1400px) {
|
||||||
|
|
||||||
.mt-container,
|
.sad-container,
|
||||||
.site-layout--boxed #page {
|
.site-layout--boxed #page {
|
||||||
width: 1200px
|
width: 1200px
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#colophon .widget .widget-title,
|
#colophon .widget .widget-title,
|
||||||
#secondary .widget .widget-title,
|
#secondary .widget .widget-title,
|
||||||
.mt-related-post-title {
|
.sad-related-post-title {
|
||||||
font-size: 17px
|
font-size: 17px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,24 +23,24 @@
|
|||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-related-posts-wrapper .entry-title {
|
.single .sad-related-posts-wrapper .entry-title {
|
||||||
font-size: 19px
|
font-size: 19px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close {
|
.sad-form-close {
|
||||||
font-size: 50px
|
font-size: 50px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:1200px) {
|
@media (max-width:1200px) {
|
||||||
|
|
||||||
.mt-container,
|
.sad-container,
|
||||||
.site-layout--boxed #page {
|
.site-layout--boxed #page {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin: 0 2%
|
margin: 0 2%
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-layout--boxed .mt-container {
|
.site-layout--boxed .sad-container {
|
||||||
padding: 0 10px
|
padding: 0 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
position: relative
|
position: relative
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-follow-title {
|
.sad-follow-title {
|
||||||
display: none
|
display: none
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
width: 30%
|
width: 30%
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-post-content {
|
.top-featured-post-wrap .sad-post-content {
|
||||||
width: 66%
|
width: 66%
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,20 +105,20 @@
|
|||||||
margin-right: 28px
|
margin-right: 28px
|
||||||
}
|
}
|
||||||
|
|
||||||
#mt-scrollup {
|
#sad-scrollup {
|
||||||
right: 10px
|
right: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
#colophon .widget .widget-title,
|
#colophon .widget .widget-title,
|
||||||
#secondary .widget .widget-title,
|
#secondary .widget .widget-title,
|
||||||
.mt-related-post-title {
|
.sad-related-post-title {
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
}
|
}
|
||||||
|
|
||||||
#colophon .widget .widget-title::before,
|
#colophon .widget .widget-title::before,
|
||||||
#secondary .widget .widget-title::before,
|
#secondary .widget .widget-title::before,
|
||||||
.features-post-title::before,
|
.features-post-title::before,
|
||||||
.mt-related-post-title::before {
|
.sad-related-post-title::before {
|
||||||
height: 2px;
|
height: 2px;
|
||||||
top: 7px
|
top: 7px
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-field {
|
.sad-menu-search .sad-form-wrap .search-form .search-field {
|
||||||
height: 54px;
|
height: 54px;
|
||||||
font-size: 20px
|
font-size: 20px
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-menu-wrapper {
|
.sad-social-menu-wrapper {
|
||||||
position: relative
|
position: relative
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
z-index: 9999
|
z-index: 9999
|
||||||
}
|
}
|
||||||
|
|
||||||
#site-navigation .mt-container {
|
#site-navigation .sad-container {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0
|
padding: 0
|
||||||
}
|
}
|
||||||
@@ -334,13 +334,13 @@
|
|||||||
display: none
|
display: none
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--block-grid-style article,
|
.sad-archive--block-grid-style article,
|
||||||
.mt-archive--masonry-style #mt-masonry article {
|
.sad-archive--masonry-style #sad-masonry article {
|
||||||
width: 97%
|
width: 97%
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-sidebar.mt-archive--block-grid-style article,
|
.no-sidebar.sad-archive--block-grid-style article,
|
||||||
.no-sidebar.mt-archive--masonry-style #mt-masonry article {
|
.no-sidebar.sad-archive--masonry-style #sad-masonry article {
|
||||||
width: 47%
|
width: 47%
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,11 +372,11 @@
|
|||||||
font-size: 12px
|
font-size: 12px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-author-bio {
|
.sad-author-bio {
|
||||||
font-size: 13px
|
font-size: 13px
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-related-posts-wrapper .entry-title {
|
.single .sad-related-posts-wrapper .entry-title {
|
||||||
font-size: 15px
|
font-size: 15px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,14 +442,14 @@
|
|||||||
margin-right: -3%
|
margin-right: -3%
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-single-post-wrap {
|
.top-featured-post-wrap .sad-single-post-wrap {
|
||||||
width: 47%;
|
width: 47%;
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
margin-right: 3%
|
margin-right: 3%
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-four .mt-footer-widget {
|
#top-footer.footer-column-four .sad-footer-widget {
|
||||||
width: 47%
|
width: 47%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,16 +487,16 @@
|
|||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-submit {
|
.sad-menu-search .sad-form-wrap .search-form .search-submit {
|
||||||
padding: 16px 46px
|
padding: 16px 46px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-field {
|
.sad-menu-search .sad-form-wrap .search-form .search-field {
|
||||||
height: 48px;
|
height: 48px;
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close {
|
.sad-form-close {
|
||||||
font-size: 40px
|
font-size: 40px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@
|
|||||||
height: 450px
|
height: 450px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-live-link {
|
.sad-live-link {
|
||||||
float: none;
|
float: none;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
margin-top: -50px;
|
margin-top: -50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logged-in .is-sticky .mt-social-menu-wrapper {
|
.logged-in .is-sticky .sad-social-menu-wrapper {
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,20 +560,20 @@
|
|||||||
margin-right: 0
|
margin-right: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-single-post-wrap {
|
.top-featured-post-wrap .sad-single-post-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-right: 0
|
margin-right: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.archive-grid-post-wrapper,
|
.archive-grid-post-wrapper,
|
||||||
.mt-archive--masonry-style .sophia-after-dark-content-masonry {
|
.sad-archive--masonry-style .sophia-after-dark-content-masonry {
|
||||||
margin-left: 0
|
margin-left: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--block-grid-style article,
|
.sad-archive--block-grid-style article,
|
||||||
.mt-archive--masonry-style #mt-masonry article,
|
.sad-archive--masonry-style #sad-masonry article,
|
||||||
.no-sidebar.mt-archive--block-grid-style article,
|
.no-sidebar.sad-archive--block-grid-style article,
|
||||||
.no-sidebar.mt-archive--masonry-style #mt-masonry article {
|
.no-sidebar.sad-archive--masonry-style #sad-masonry article {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-left: 0
|
margin-left: 0
|
||||||
}
|
}
|
||||||
@@ -590,17 +590,17 @@
|
|||||||
padding: 28px 0
|
padding: 28px 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper {
|
.sad-related-posts-wrapper {
|
||||||
margin-left: 0
|
margin-left: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper article {
|
.sad-related-posts-wrapper article {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper .post-cats-list a {
|
.sad-related-posts-wrapper .post-cats-list a {
|
||||||
margin-top: 10px
|
margin-top: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,13 +632,13 @@
|
|||||||
font-size: 28px
|
font-size: 28px
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-three .mt-footer-widget {
|
#top-footer.footer-column-three .sad-footer-widget {
|
||||||
width: 97%
|
width: 97%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:480px) {
|
@media (max-width:480px) {
|
||||||
.mt-social-icon-wrap li {
|
.sad-social-icon-wrap li {
|
||||||
margin-right: 8px
|
margin-right: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,11 +650,11 @@
|
|||||||
margin-top: 10px
|
margin-top: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-wrapper {
|
.sad-social-wrapper {
|
||||||
margin: 12px 0 12px
|
margin: 12px 0 12px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon {
|
.sad-search-icon {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 12px 0 12px 8px
|
margin: 12px 0 12px 8px
|
||||||
}
|
}
|
||||||
@@ -664,15 +664,15 @@
|
|||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author-info .mt-author-name {
|
.single .sad-author-box .sad-author-info .sad-author-name {
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-author-bio {
|
.sad-author-bio {
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-author-meta {
|
.sad-author-meta {
|
||||||
font-size: 13px
|
font-size: 13px
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,8 +715,8 @@
|
|||||||
font-size: 20px
|
font-size: 20px
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-four .mt-footer-widget,
|
#top-footer.footer-column-four .sad-footer-widget,
|
||||||
#top-footer.footer-column-two .mt-footer-widget {
|
#top-footer.footer-column-two .sad-footer-widget {
|
||||||
width: 97%
|
width: 97%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,9 +51,9 @@ jQuery(($) => {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Initialize jQuery UI buttonset for radio image controls
|
// Initialize jQuery UI buttonset for radio image controls
|
||||||
$('.mt-meta-options-wrap .buttonset').buttonset();
|
$('.sad-meta-options-wrap .buttonset').buttonset();
|
||||||
|
|
||||||
// Initialize image upload/delete functionality
|
// Initialize image upload/delete functionality
|
||||||
initUploadMediaImage('.mt-upload-button');
|
initUploadMediaImage('.sad-upload-button');
|
||||||
initDeleteMediaImage('.mt-delete-button');
|
initDeleteMediaImage('.sad-delete-button');
|
||||||
});
|
});
|
||||||
@@ -26,10 +26,10 @@ jQuery(document).ready(function($) {
|
|||||||
/**
|
/**
|
||||||
* Header Search script
|
* Header Search script
|
||||||
*/
|
*/
|
||||||
const $searchIcon = $('.mt-menu-search .mt-search-icon');
|
const $searchIcon = $('.sad-menu-search .sad-search-icon');
|
||||||
$searchIcon.click(function() {
|
$searchIcon.click(function() {
|
||||||
$('.mt-form-wrap').toggleClass('search-activate').find('.search-field').focus();
|
$('.sad-form-wrap').toggleClass('search-activate').find('.search-field').focus();
|
||||||
const $element = $('.mt-form-wrap.search-activate');
|
const $element = $('.sad-form-wrap.search-activate');
|
||||||
if ($element.length) {
|
if ($element.length) {
|
||||||
$(document).on('keydown', function(e) {
|
$(document).on('keydown', function(e) {
|
||||||
const focusable = $element.find('input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
|
const focusable = $element.find('input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
|
||||||
@@ -57,9 +57,9 @@ jQuery(document).ready(function($) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.mt-form-wrap .mt-form-close').click(function() {
|
$('.sad-form-wrap .sad-form-close').click(function() {
|
||||||
$('.mt-form-wrap').toggleClass('search-activate');
|
$('.sad-form-wrap').toggleClass('search-activate');
|
||||||
$(this).parents('.mt-menu-search').find('.mt-search-icon a').focus();
|
$(this).parents('.sad-menu-search').find('.sad-search-icon a').focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +68,7 @@ jQuery(document).ready(function($) {
|
|||||||
$(document).on('keydown', function(event) {
|
$(document).on('keydown', function(event) {
|
||||||
if (event.keyCode === 27) {
|
if (event.keyCode === 27) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$('.mt-menu-search .mt-form-wrap').removeClass('search-activate');
|
$('.sad-menu-search .sad-form-wrap').removeClass('search-activate');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ jQuery(document).ready(function($) {
|
|||||||
*/
|
*/
|
||||||
if (sophia_after_darkObject.menu_sticky === 'on') {
|
if (sophia_after_darkObject.menu_sticky === 'on') {
|
||||||
const wpAdminBar = $('#wpadminbar').length ? $('#wpadminbar') : 0;
|
const wpAdminBar = $('#wpadminbar').length ? $('#wpadminbar') : 0;
|
||||||
$(".mt-social-menu-wrapper").sticky({
|
$(".sad-social-menu-wrapper").sticky({
|
||||||
topSpacing: wpAdminBar.length ? wpAdminBar.height() : 0
|
topSpacing: wpAdminBar.length ? wpAdminBar.height() : 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -94,13 +94,13 @@ jQuery(document).ready(function($) {
|
|||||||
*/
|
*/
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
if ($(this).scrollTop() > 1000) {
|
if ($(this).scrollTop() > 1000) {
|
||||||
$('#mt-scrollup').fadeIn('slow');
|
$('#sad-scrollup').fadeIn('slow');
|
||||||
} else {
|
} else {
|
||||||
$('#mt-scrollup').fadeOut('slow');
|
$('#sad-scrollup').fadeOut('slow');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mt-scrollup').click(function() {
|
$('#sad-scrollup').click(function() {
|
||||||
$("html, body").animate({
|
$("html, body").animate({
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}, 600);
|
}, 600);
|
||||||
@@ -128,14 +128,14 @@ jQuery(document).ready(function($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initializeSlider('.front-slider');
|
initializeSlider('.front-slider');
|
||||||
initializeSlider('.mt-gallery-slider', false);
|
initializeSlider('.sad-gallery-slider', false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsive menu
|
* Responsive menu
|
||||||
*/
|
*/
|
||||||
$('.mt-social-menu-wrapper .menu-toggle').click(function() {
|
$('.sad-social-menu-wrapper .menu-toggle').click(function() {
|
||||||
$('#site-navigation').toggleClass('isActive').slideToggle('slow');
|
$('#site-navigation').toggleClass('isActive').slideToggle('slow');
|
||||||
const $element = $('.mt-header-menu-wrap');
|
const $element = $('.sad-header-menu-wrap');
|
||||||
if ($element.length) {
|
if ($element.length) {
|
||||||
$(document).on('keydown', function(e) {
|
$(document).on('keydown', function(e) {
|
||||||
if ($('#site-navigation.isActive').length) {
|
if ($('#site-navigation.isActive').length) {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
( function( api ) {
|
( function( api ) {
|
||||||
|
|
||||||
api.sectionConstructor['mt-upsell'] = api.Section.extend( {
|
api.sectionConstructor['sad-upsell'] = api.Section.extend( {
|
||||||
|
|
||||||
// No events for this type of section.
|
// No events for this type of section.
|
||||||
attachEvents: function () {},
|
attachEvents: function () {},
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
} )( wp.customize );
|
} )( wp.customize );
|
||||||
|
|
||||||
wp.customize.controlConstructor['mt-toggle'] = wp.customize.Control.extend({
|
wp.customize.controlConstructor['sad-toggle'] = wp.customize.Control.extend({
|
||||||
ready: function(){
|
ready: function(){
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@@ -37,12 +37,12 @@ jQuery(document).ready(function($) {
|
|||||||
* Function for repeater field
|
* Function for repeater field
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_refresh_repeater_values(){
|
function sophia_after_dark_refresh_repeater_values(){
|
||||||
$(".mt-repeater-field-control-wrap").each(function(){
|
$(".sad-repeater-field-control-wrap").each(function(){
|
||||||
|
|
||||||
var values = [];
|
var values = [];
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
$this.find(".mt-repeater-field-control").each(function(){
|
$this.find(".sad-repeater-field-control").each(function(){
|
||||||
var valueToPush = {};
|
var valueToPush = {};
|
||||||
|
|
||||||
$(this).find('[data-name]').each(function(){
|
$(this).find('[data-name]').each(function(){
|
||||||
@@ -55,21 +55,21 @@ jQuery(document).ready(function($) {
|
|||||||
values.push(valueToPush);
|
values.push(valueToPush);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this.next('.mt-repeater-collector').val(JSON.stringify(values)).trigger('change');
|
$this.next('.sad-repeater-collector').val(JSON.stringify(values)).trigger('change');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#customize-theme-controls').on('click','.mt-repeater-field-title',function(){
|
$('#customize-theme-controls').on('click','.sad-repeater-field-title',function(){
|
||||||
$(this).next().slideToggle();
|
$(this).next().slideToggle();
|
||||||
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
|
$(this).closest('.sad-repeater-field-control').toggleClass('expanded');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#customize-theme-controls').on('click', '.mt-repeater-field-close', function(){
|
$('#customize-theme-controls').on('click', '.sad-repeater-field-close', function(){
|
||||||
$(this).closest('.mt-repeater-fields').slideUp();;
|
$(this).closest('.sad-repeater-fields').slideUp();;
|
||||||
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
|
$(this).closest('.sad-repeater-field-control').toggleClass('expanded');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click",'.mt-repeater-add-control-field', function(){
|
$("body").on("click",'.sad-repeater-add-control-field', function(){
|
||||||
|
|
||||||
var fLimit = $(this).parent().find('.field-limit').val();
|
var fLimit = $(this).parent().find('.field-limit').val();
|
||||||
var fCount = $(this).parent().find('.field-count').val();
|
var fCount = $(this).parent().find('.field-count').val();
|
||||||
@@ -77,14 +77,14 @@ jQuery(document).ready(function($) {
|
|||||||
fCount++;
|
fCount++;
|
||||||
$(this).parent().find('.field-count').val(fCount);
|
$(this).parent().find('.field-count').val(fCount);
|
||||||
} else {
|
} else {
|
||||||
$(this).before('<span class="mt-limit-msg"><em>Only '+fLimit+' repeater field will be permitted.</em></span>');
|
$(this).before('<span class="sad-limit-msg"><em>Only '+fLimit+' repeater field will be permitted.</em></span>');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $this = $(this).parent();
|
var $this = $(this).parent();
|
||||||
if(typeof $this != 'undefined') {
|
if(typeof $this != 'undefined') {
|
||||||
|
|
||||||
var field = $this.find(".mt-repeater-field-control:first").clone();
|
var field = $this.find(".sad-repeater-field-control:first").clone();
|
||||||
if(typeof field != 'undefined'){
|
if(typeof field != 'undefined'){
|
||||||
|
|
||||||
field.find("input[type='text'][data-name]").each(function(){
|
field.find("input[type='text'][data-name]").each(function(){
|
||||||
@@ -112,10 +112,10 @@ jQuery(document).ready(function($) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
field.find(".mt-repeater-icon-list").each(function(){
|
field.find(".sad-repeater-icon-list").each(function(){
|
||||||
var defaultValue = $(this).next('input[data-name]').attr('data-default');
|
var defaultValue = $(this).next('input[data-name]').attr('data-default');
|
||||||
$(this).next('input[data-name]').val(defaultValue);
|
$(this).next('input[data-name]').val(defaultValue);
|
||||||
$(this).prev('.mt-repeater-selected-icon').children('i').attr('class','').addClass(defaultValue);
|
$(this).prev('.sad-repeater-selected-icon').children('i').attr('class','').addClass(defaultValue);
|
||||||
|
|
||||||
$(this).find('li').each(function(){
|
$(this).find('li').each(function(){
|
||||||
var icon_class = $(this).find('i').attr('class');
|
var icon_class = $(this).find('i').attr('class');
|
||||||
@@ -127,9 +127,9 @@ jQuery(document).ready(function($) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
field.find('.mt-repeater-fields').show();
|
field.find('.sad-repeater-fields').show();
|
||||||
$this.find('.mt-repeater-field-control-wrap').append(field);
|
$this.find('.sad-repeater-field-control-wrap').append(field);
|
||||||
field.addClass('expanded').find('.mt-repeater-fields').show();
|
field.addClass('expanded').find('.sad-repeater-fields').show();
|
||||||
$('.accordion-section-content').animate({ scrollTop: $this.height() }, 1000);
|
$('.accordion-section-content').animate({ scrollTop: $this.height() }, 1000);
|
||||||
sophia_after_dark_refresh_repeater_values();
|
sophia_after_dark_refresh_repeater_values();
|
||||||
}
|
}
|
||||||
@@ -138,9 +138,9 @@ jQuery(document).ready(function($) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#customize-theme-controls").on("click", ".mt-repeater-field-remove",function(){
|
$("#customize-theme-controls").on("click", ".sad-repeater-field-remove",function(){
|
||||||
if( typeof $(this).parent() != 'undefined'){
|
if( typeof $(this).parent() != 'undefined'){
|
||||||
$(this).closest('.mt-repeater-field-control').slideUp('normal', function(){
|
$(this).closest('.sad-repeater-field-control').slideUp('normal', function(){
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
sophia_after_dark_refresh_repeater_values();
|
sophia_after_dark_refresh_repeater_values();
|
||||||
});
|
});
|
||||||
@@ -156,7 +156,7 @@ jQuery(document).ready(function($) {
|
|||||||
/**
|
/**
|
||||||
* Drag and drop to change order
|
* Drag and drop to change order
|
||||||
*/
|
*/
|
||||||
$(".mt-repeater-field-control-wrap").sortable({
|
$(".sad-repeater-field-control-wrap").sortable({
|
||||||
orientation: "vertical",
|
orientation: "vertical",
|
||||||
update: function( event, ui ) {
|
update: function( event, ui ) {
|
||||||
sophia_after_dark_refresh_repeater_values();
|
sophia_after_dark_refresh_repeater_values();
|
||||||
@@ -169,11 +169,11 @@ jQuery(document).ready(function($) {
|
|||||||
var mtFrame;
|
var mtFrame;
|
||||||
|
|
||||||
//Add image
|
//Add image
|
||||||
$('.customize-control-mt-repeater').on( 'click', '.mt-upload-button', function( event ){
|
$('.customize-control-sad-repeater').on( 'click', '.sad-upload-button', function( event ){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
|
var imgContainer = $(this).closest('.sad-fields-wrap').find( '.thumbnail-image'),
|
||||||
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
|
placeholder = $(this).closest('.sad-fields-wrap').find( '.placeholder'),
|
||||||
imgIdInput = $(this).siblings('.upload-id');
|
imgIdInput = $(this).siblings('.upload-id');
|
||||||
|
|
||||||
mtFrame = wp.media({
|
mtFrame = wp.media({
|
||||||
@@ -195,10 +195,10 @@ jQuery(document).ready(function($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// DELETE IMAGE LINK
|
// DELETE IMAGE LINK
|
||||||
$('.customize-control-mt-repeater').on( 'click', '.mt-delete-button', function( event ){
|
$('.customize-control-sad-repeater').on( 'click', '.sad-delete-button', function( event ){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
|
var imgContainer = $(this).closest('.sad-fields-wrap').find( '.thumbnail-image'),
|
||||||
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
|
placeholder = $(this).closest('.sad-fields-wrap').find( '.placeholder'),
|
||||||
imgIdInput = $(this).siblings('.upload-id');
|
imgIdInput = $(this).siblings('.upload-id');
|
||||||
imgContainer.find('img').remove();
|
imgContainer.find('img').remove();
|
||||||
placeholder.removeClass('hidden');
|
placeholder.removeClass('hidden');
|
||||||
@@ -208,15 +208,15 @@ jQuery(document).ready(function($) {
|
|||||||
/**
|
/**
|
||||||
* Repeater icon selector
|
* Repeater icon selector
|
||||||
*/
|
*/
|
||||||
$('body').on('click', '.mt-repeater-icon-list li', function(){
|
$('body').on('click', '.sad-repeater-icon-list li', function(){
|
||||||
var icon_class = $(this).find('i').attr('class');
|
var icon_class = $(this).find('i').attr('class');
|
||||||
$(this).addClass('icon-active').siblings().removeClass('icon-active');
|
$(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('.sad-repeater-icon-list').prev('.sad-repeater-selected-icon').children('i').attr('class','').addClass(icon_class);
|
||||||
$(this).parent('.mt-repeater-icon-list').next('input').val(icon_class).trigger('change');
|
$(this).parent('.sad-repeater-icon-list').next('input').val(icon_class).trigger('change');
|
||||||
sophia_after_dark_refresh_repeater_values();
|
sophia_after_dark_refresh_repeater_values();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.mt-repeater-selected-icon', function(){
|
$('body').on('click', '.sad-repeater-selected-icon', function(){
|
||||||
$(this).next().slideToggle();
|
$(this).next().slideToggle();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
28
comments.php
28
comments.php
@@ -21,14 +21,14 @@ if ( post_password_required() ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove URL field from comment form
|
// Remove URL field from comment form
|
||||||
function sophia_after_dark_remove_url_comments($fields) {
|
function sophia_after_dark_remove_url_comments( $fields ) {
|
||||||
unset($fields['url']);
|
unset( $fields['url'] );
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
add_filter('comment_form_default_fields', 'sophia_after_dark_remove_url_comments');
|
add_filter( 'comment_form_default_fields', 'sophia_after_dark_remove_url_comments' );
|
||||||
|
|
||||||
// Modify cookie consent field
|
// Modify cookie consent field
|
||||||
function sophia_after_dark_comment_form_change_cookies($fields) {
|
function sophia_after_dark_comment_form_change_cookies( $fields ) {
|
||||||
$commenter = wp_get_current_commenter();
|
$commenter = wp_get_current_commenter();
|
||||||
$consent = ! empty( $commenter['comment_author_email'] );
|
$consent = ! empty( $commenter['comment_author_email'] );
|
||||||
|
|
||||||
@@ -40,23 +40,23 @@ function sophia_after_dark_comment_form_change_cookies($fields) {
|
|||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
add_filter('comment_form_default_fields', 'sophia_after_dark_comment_form_change_cookies');
|
add_filter( 'comment_form_default_fields', 'sophia_after_dark_comment_form_change_cookies' );
|
||||||
|
|
||||||
// Add comment notes above form
|
// Add comment notes above form
|
||||||
function sophia_after_dark_modify_text_before_comment_form($arg) {
|
function sophia_after_dark_modify_text_before_comment_form( $arg ) {
|
||||||
$arg['comment_notes_before'] = wp_kses_post(
|
$arg['comment_notes_before'] = wp_kses_post(
|
||||||
'<p class="comment-notes">' .
|
'<p class="comment-notes">' .
|
||||||
esc_html__('All comments are manually reviewed and moderated.', 'sophia-after-dark') .
|
esc_html__( 'All comments are manually reviewed and moderated.', 'sophia-after-dark' ) .
|
||||||
'<br><span class="required-field-message">' .
|
'<br><span class="required-field-message">' .
|
||||||
esc_html__('Required fields are marked ', 'sophia-after-dark') .
|
esc_html__( 'Required fields are marked ', 'sophia-after-dark' ) .
|
||||||
'<span class="required">*</span></span></p>'
|
'<span class="required">*</span></span></p>'
|
||||||
);
|
);
|
||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
add_filter('comment_form_defaults', 'sophia_after_dark_modify_text_before_comment_form');
|
add_filter( 'comment_form_defaults', 'sophia_after_dark_modify_text_before_comment_form' );
|
||||||
|
|
||||||
// Add privacy policy consent note below form
|
// Add privacy policy consent note below form
|
||||||
function sophia_after_dark_modify_text_comment_form($post_id) {
|
function sophia_after_dark_modify_text_comment_form( $post_id ) {
|
||||||
$link = '<a href="/privacy-policy">' . esc_html__( 'Privacy Policy', 'sophia-after-dark' ) . '</a>';
|
$link = '<a href="/privacy-policy">' . esc_html__( 'Privacy Policy', 'sophia-after-dark' ) . '</a>';
|
||||||
printf(
|
printf(
|
||||||
'<span class="submit-comment-note">%s</span>',
|
'<span class="submit-comment-note">%s</span>',
|
||||||
@@ -69,7 +69,7 @@ function sophia_after_dark_modify_text_comment_form($post_id) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
add_action('comment_form', 'sophia_after_dark_modify_text_comment_form');
|
add_action( 'comment_form', 'sophia_after_dark_modify_text_comment_form' );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -99,11 +99,13 @@ add_action('comment_form', 'sophia_after_dark_modify_text_comment_form');
|
|||||||
|
|
||||||
<ol class="comment-list">
|
<ol class="comment-list">
|
||||||
<?php
|
<?php
|
||||||
wp_list_comments( array(
|
wp_list_comments(
|
||||||
|
array(
|
||||||
'style' => 'ol',
|
'style' => 'ol',
|
||||||
'short_ping' => true,
|
'short_ping' => true,
|
||||||
'reply_text' => __( 'Reply', 'sophia-after-dark' ),
|
'reply_text' => __( 'Reply', 'sophia-after-dark' ),
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
|||||||
13
composer.json
Normal file
13
composer.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"require-dev": {
|
||||||
|
"squizlabs/php_codesniffer": "^3.13",
|
||||||
|
"wp-coding-standards/wpcs": "^3.1",
|
||||||
|
"phpcsstandards/phpcsutils": "^1.1",
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": "^1.1"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ if ( ! function_exists( 'sophia_after_dark_setup' ) ) :
|
|||||||
* runs before the init hook. The init hook is too late for some features, such
|
* runs before the init hook. The init hook is too late for some features, such
|
||||||
* as indicating support for post thumbnails.
|
* as indicating support for post thumbnails.
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_setup(){
|
function sophia_after_dark_setup() {
|
||||||
/*
|
/*
|
||||||
* Make theme available for translation.
|
* Make theme available for translation.
|
||||||
* Translations can be filed in the /languages/ directory.
|
* Translations can be filed in the /languages/ directory.
|
||||||
@@ -49,30 +49,35 @@ if ( ! function_exists( 'sophia_after_dark_setup' ) ) :
|
|||||||
add_image_size( 'sophia-after-dark-slider-post', 1200, 700, true );
|
add_image_size( 'sophia-after-dark-slider-post', 1200, 700, true );
|
||||||
|
|
||||||
// This theme uses wp_nav_menu() in one location.
|
// This theme uses wp_nav_menu() in one location.
|
||||||
register_nav_menus( array(
|
register_nav_menus(
|
||||||
|
array(
|
||||||
'top_header_menu' => esc_html__( 'Top Header', 'sophia-after-dark' ),
|
'top_header_menu' => esc_html__( 'Top Header', 'sophia-after-dark' ),
|
||||||
'primary_menu' => esc_html__( 'Primary', 'sophia-after-dark' ),
|
'primary_menu' => esc_html__( 'Primary', 'sophia-after-dark' ),
|
||||||
'footer_menu' => esc_html__( 'Footer', 'sophia-after-dark' ),
|
'footer_menu' => esc_html__( 'Footer', 'sophia-after-dark' ),
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Switch default core markup for search form, comment form, and comments
|
* Switch default core markup for search form, comment form, and comments
|
||||||
* to output valid HTML5.
|
* to output valid HTML5.
|
||||||
*/
|
*/
|
||||||
add_theme_support( 'html5', array(
|
add_theme_support(
|
||||||
|
'html5',
|
||||||
|
array(
|
||||||
'search-form',
|
'search-form',
|
||||||
'comment-form',
|
'comment-form',
|
||||||
'comment-list',
|
'comment-list',
|
||||||
'gallery',
|
'gallery',
|
||||||
'caption',
|
'caption',
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// Set up the WordPress core custom background feature.
|
// Set up the WordPress core custom background feature.
|
||||||
// Disabled in V1.4.3
|
// Disabled in V1.4.3
|
||||||
//add_theme_support( 'custom-background', apply_filters( 'sophia_after_dark_custom_background_args', array(
|
// add_theme_support( 'custom-background', apply_filters( 'sophia_after_dark_custom_background_args', array(
|
||||||
//'default-color' => 'ffffff',
|
// 'default-color' => 'ffffff',
|
||||||
//'default-image' => '',
|
// 'default-image' => '',
|
||||||
//) ) );
|
// ) ) );
|
||||||
|
|
||||||
// Add theme support for selective refresh for widgets.
|
// Add theme support for selective refresh for widgets.
|
||||||
add_theme_support( 'customize-selective-refresh-widgets' );
|
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||||
@@ -82,17 +87,20 @@ if ( ! function_exists( 'sophia_after_dark_setup' ) ) :
|
|||||||
*
|
*
|
||||||
* @link https://codex.wordpress.org/Theme_Logo
|
* @link https://codex.wordpress.org/Theme_Logo
|
||||||
*/
|
*/
|
||||||
add_theme_support( 'custom-logo', array(
|
add_theme_support(
|
||||||
|
'custom-logo',
|
||||||
|
array(
|
||||||
'height' => 250,
|
'height' => 250,
|
||||||
'width' => 250,
|
'width' => 250,
|
||||||
'flex-width' => true,
|
'flex-width' => true,
|
||||||
'flex-height' => true,
|
'flex-height' => true,
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an editor stylesheet for the theme.
|
* Registers an editor stylesheet for the theme.
|
||||||
*/
|
*/
|
||||||
add_editor_style( 'assets/css/mt-editor-style.css' );
|
add_editor_style( 'assets/css/sad-editor-style.css' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restoring the classic Widgets Editor
|
* Restoring the classic Widgets Editor
|
||||||
@@ -135,10 +143,9 @@ add_action( 'after_setup_theme', 'sophia_after_dark_theme_version_info', 0 );
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function for displaying menu item description
|
* Function for displaying menu item description
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_nav_description( $item_output, $item, $depth, $menu_args ) {
|
function sophia_after_dark_nav_description( $item_output, $item, $depth, $menu_args ) {
|
||||||
if ( !empty( $item->description ) ) {
|
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 );
|
$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;
|
return $item_output;
|
||||||
@@ -149,7 +156,7 @@ add_filter( 'walker_nav_menu_start_el', 'sophia_after_dark_nav_description', 10,
|
|||||||
* Implement the Custom Header feature.
|
* Implement the Custom Header feature.
|
||||||
* Disabled in V1.4.3
|
* Disabled in V1.4.3
|
||||||
*/
|
*/
|
||||||
//require get_template_directory() . '/inc/custom-header.php';
|
// require get_template_directory() . '/inc/custom-header.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom template tags for this theme.
|
* Custom template tags for this theme.
|
||||||
@@ -164,7 +171,7 @@ require get_template_directory() . '/inc/template-functions.php';
|
|||||||
/**
|
/**
|
||||||
* Customizer additions.
|
* Customizer additions.
|
||||||
*/
|
*/
|
||||||
require get_template_directory() . '/inc/customizer/mt-customizer.php';
|
require get_template_directory() . '/inc/customizer/sad-customizer.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load Jetpack compatibility file.
|
* Load Jetpack compatibility file.
|
||||||
@@ -176,35 +183,38 @@ if ( defined( 'JETPACK__VERSION' ) ) {
|
|||||||
/**
|
/**
|
||||||
* Load custom hook file
|
* Load custom hook file
|
||||||
*/
|
*/
|
||||||
require get_template_directory() . '/inc/hooks/mt-custom-hooks.php';
|
require get_template_directory() . '/inc/hooks/sad-custom-hooks.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load custom hook top header file
|
* Load custom hook top header file
|
||||||
*/
|
*/
|
||||||
require get_template_directory() . '/inc/hooks/mt-top-header-hooks.php';
|
require get_template_directory() . '/inc/hooks/sad-top-header-hooks.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load widget functions file
|
* Load widget functions file
|
||||||
*/
|
*/
|
||||||
require get_template_directory() . '/inc/widgets/mt-widget-functions.php';
|
require get_template_directory() . '/inc/widgets/sad-widget-functions.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load metaboxes
|
* Load metaboxes
|
||||||
*/
|
*/
|
||||||
require get_template_directory() . '/inc/metaboxes/mt-post-sidebar-meta.php';
|
require get_template_directory() . '/inc/metaboxes/sad-post-sidebar-meta.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load breadcrumbs class
|
* Load breadcrumbs class
|
||||||
*/
|
*/
|
||||||
if ( ! function_exists( 'breadcrumb_trail' ) ) {
|
if ( ! function_exists( 'breadcrumb_trail' ) ) {
|
||||||
require get_template_directory() . '/inc/mt-class-breadcrumbs.php';
|
require get_template_directory() . '/inc/sad-class-breadcrumbs.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to allow images in WordPress comments
|
// Function to allow images in WordPress comments
|
||||||
function allow_images_in_comments($comment_content) {
|
function allow_images_in_comments( $comment_content ) {
|
||||||
// Allow only specific HTML tags, including <img>
|
// Allow only specific HTML tags, including <img>
|
||||||
$allowed_tags = array(
|
$allowed_tags = array(
|
||||||
'a' => array('href' => array(), 'title' => array()),
|
'a' => array(
|
||||||
|
'href' => array(),
|
||||||
|
'title' => array(),
|
||||||
|
),
|
||||||
'em' => array(),
|
'em' => array(),
|
||||||
'strong' => array(),
|
'strong' => array(),
|
||||||
'img' => array(
|
'img' => array(
|
||||||
@@ -217,14 +227,14 @@ function allow_images_in_comments($comment_content) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Strip out disallowed tags but keep allowed ones
|
// Strip out disallowed tags but keep allowed ones
|
||||||
return wp_kses($comment_content, $allowed_tags);
|
return wp_kses( $comment_content, $allowed_tags );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook to filter the comment text before displaying it
|
// Hook to filter the comment text before displaying it
|
||||||
add_filter('comment_text', 'allow_images_in_comments');
|
add_filter( 'comment_text', 'allow_images_in_comments' );
|
||||||
|
|
||||||
// Function to make URLs for images clickable in comments
|
// Function to make URLs for images clickable in comments
|
||||||
function clickable_images_in_comments($comment_content) {
|
function clickable_images_in_comments( $comment_content ) {
|
||||||
// Automatically convert image URLs to HTML <img> tags
|
// Automatically convert image URLs to HTML <img> tags
|
||||||
$comment_content = preg_replace(
|
$comment_content = preg_replace(
|
||||||
'/(http:\/\/[^\s"]+\.(jpg|jpeg|png|gif))/i',
|
'/(http:\/\/[^\s"]+\.(jpg|jpeg|png|gif))/i',
|
||||||
@@ -235,4 +245,4 @@ function clickable_images_in_comments($comment_content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hook to make image URLs clickable
|
// Hook to make image URLs clickable
|
||||||
add_filter('comment_text', 'clickable_images_in_comments');
|
add_filter( 'comment_text', 'clickable_images_in_comments' );
|
||||||
|
|||||||
@@ -87,4 +87,4 @@ do_action( 'sophia_after_dark_before_page' );
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="content" class="site-content">
|
<div id="content" class="site-content">
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
*
|
*
|
||||||
* You can add an optional custom header image to header.php like so ...
|
* You can add an optional custom header image to header.php like so ...
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
|
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
|
||||||
*
|
*
|
||||||
* @package Sophia After Dark
|
* @package Sophia After Dark
|
||||||
@@ -18,7 +17,11 @@
|
|||||||
* @uses sophia_after_dark_header_style()
|
* @uses sophia_after_dark_header_style()
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_custom_header_setup() {
|
function sophia_after_dark_custom_header_setup() {
|
||||||
add_theme_support( 'custom-header', apply_filters( 'sophia_after_dark_custom_header_args', array(
|
add_theme_support(
|
||||||
|
'custom-header',
|
||||||
|
apply_filters(
|
||||||
|
'sophia_after_dark_custom_header_args',
|
||||||
|
array(
|
||||||
'default-image' => '',
|
'default-image' => '',
|
||||||
'default-text-color' => '000000',
|
'default-text-color' => '000000',
|
||||||
'width' => 1000,
|
'width' => 1000,
|
||||||
@@ -26,7 +29,9 @@ function sophia_after_dark_custom_header_setup() {
|
|||||||
'flex-height' => true,
|
'flex-height' => true,
|
||||||
'flex-width' => true,
|
'flex-width' => true,
|
||||||
'wp-head-callback' => 'sophia_after_dark_header_style',
|
'wp-head-callback' => 'sophia_after_dark_header_style',
|
||||||
) ) );
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
add_action( 'after_setup_theme', 'sophia_after_dark_custom_header_setup' );
|
add_action( 'after_setup_theme', 'sophia_after_dark_custom_header_setup' );
|
||||||
|
|
||||||
|
|||||||
@@ -1,176 +0,0 @@
|
|||||||
<?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;
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<?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,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,303 +0,0 @@
|
|||||||
<?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',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
<?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__( '©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',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
<?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',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
<?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 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,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$wp_customize->add_control(new WP_Customize_Image_control(
|
|
||||||
$wp_customize, 'sophia_after_dark_home_og_image', array(
|
|
||||||
'label' => __('Home Page Open Graph Image', 'sophia_after_dark'),
|
|
||||||
'section' => 'sophia_after_dark_section_site',
|
|
||||||
'settings' => 'sophia_after_dark_home_og_image',
|
|
||||||
'priority' => 15,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$users = get_users();
|
|
||||||
$user_choices = array();
|
|
||||||
foreach ($users as $user) {
|
|
||||||
$user_choices[$user->ID] = $user->display_name;
|
|
||||||
}
|
|
||||||
$wp_customize->add_control('sophia_after_dark_home_og_user', array(
|
|
||||||
'label' => __('Select User for Open Graph Tags', 'sophia_after_dark'),
|
|
||||||
'section' => 'sophia_after_dark_section_site',
|
|
||||||
'settings' => 'sophia_after_dark_home_og_user',
|
|
||||||
'type' => 'select',
|
|
||||||
'choices' => $user_choices,
|
|
||||||
'priority' => 20,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
/**
|
|
||||||
* 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' => 25,
|
|
||||||
'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' => 25,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,327 +0,0 @@
|
|||||||
<?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,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?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' ),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
<?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' );
|
|
||||||
$wp_customize->add_setting('sophia_after_dark_home_og_image', array('default' => '','sanitize_callback' => 'esc_url_raw','type' => 'option',));
|
|
||||||
$wp_customize->add_setting('sophia_after_dark_home_og_user', array('default' => 1,'sanitize_callback' => 'absint','type' => 'option',));
|
|
||||||
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_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-additional-open-graph.php';
|
|
||||||
|
|
||||||
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';
|
|
||||||
176
inc/customizer/sad-callback.php
Normal file
176
inc/customizer/sad-callback.php
Normal 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;
|
||||||
118
inc/customizer/sad-customizer-additional-panel-options.php
Normal file
118
inc/customizer/sad-customizer-additional-panel-options.php
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
<?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,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
* @access public
|
* @access public
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $type = 'mt-toggle';
|
public $type = 'sad-toggle';
|
||||||
|
|
||||||
public $tooltip = '';
|
public $tooltip = '';
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
|
|
||||||
if ( isset( $this->default ) ) {
|
if ( isset( $this->default ) ) {
|
||||||
$this->json['default'] = $this->default;
|
$this->json['default'] = $this->default;
|
||||||
} else{
|
} else {
|
||||||
$this->json['default'] = $this->setting->default;
|
$this->json['default'] = $this->setting->default;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
}
|
}
|
||||||
} //Ends sophia_after_dark_Control_Toggle
|
} //Ends sophia_after_dark_Control_Toggle
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||||
if ( ! class_exists( 'sophia_after_dark_Control_Radio_Image' ) ) {
|
if ( ! class_exists( 'sophia_after_dark_Control_Radio_Image' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +85,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
* @access public
|
* @access public
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $type = 'mt-radio-image';
|
public $type = 'sad-radio-image';
|
||||||
|
|
||||||
public $tooltip = '';
|
public $tooltip = '';
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||||
if ( ! class_exists( 'sophia_after_dark_Control_Repeater' ) ) {
|
if ( ! class_exists( 'sophia_after_dark_Control_Repeater' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,7 +155,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
* @access public
|
* @access public
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $type = 'mt-repeater';
|
public $type = 'sad-repeater';
|
||||||
|
|
||||||
public $sophia_after_dark_box_label = '';
|
public $sophia_after_dark_box_label = '';
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
public function __construct( $manager, $id, $args = array(), $fields = array() ) {
|
public function __construct( $manager, $id, $args = array(), $fields = array() ) {
|
||||||
|
|
||||||
$this->fields = $fields;
|
$this->fields = $fields;
|
||||||
$this->sophia_after_dark_box_label = $args['sophia_after_dark_box_label_text'] ;
|
$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'];
|
$this->sophia_after_dark_box_add_control = $args['sophia_after_dark_box_add_control_text'];
|
||||||
parent::__construct( $manager, $id, $args );
|
parent::__construct( $manager, $id, $args );
|
||||||
}
|
}
|
||||||
@@ -196,14 +196,14 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
</span>
|
</span>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<ul class="mt-repeater-field-control-wrap">
|
<ul class="sad-repeater-field-control-wrap">
|
||||||
<?php $this->sophia_after_dark_get_fields(); ?>
|
<?php $this->sophia_after_dark_get_fields(); ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<input type="hidden" <?php $this->link(); ?> class="mt-repeater-collector" value="<?php echo esc_attr( $this->value() ); ?>" />
|
<input type="hidden" <?php $this->link(); ?> class="sad-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="<?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">
|
<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>
|
<button type="button" class="button sad-repeater-add-control-field"><?php echo esc_html( $this->sophia_after_dark_box_add_control ); ?></button>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,16 +212,16 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
$values = json_decode( $this->value() );
|
$values = json_decode( $this->value() );
|
||||||
|
|
||||||
if ( is_array( $values ) ) {
|
if ( is_array( $values ) ) {
|
||||||
foreach( $values as $value ) {
|
foreach ( $values as $value ) {
|
||||||
?>
|
?>
|
||||||
<li class="mt-repeater-field-control">
|
<li class="sad-repeater-field-control">
|
||||||
<h3 class="mt-repeater-field-title"><?php echo esc_html( $this->sophia_after_dark_box_label ); ?></h3>
|
<h3 class="sad-repeater-field-title"><?php echo esc_html( $this->sophia_after_dark_box_label ); ?></h3>
|
||||||
<div class="mt-repeater-fields">
|
<div class="sad-repeater-fields">
|
||||||
<?php
|
<?php
|
||||||
foreach ( $fields as $key => $field ) {
|
foreach ( $fields as $key => $field ) {
|
||||||
$class = isset( $field['class'] ) ? $field['class'] : '';
|
$class = isset( $field['class'] ) ? $field['class'] : '';
|
||||||
?>
|
?>
|
||||||
<div class="mt-repeater-field mt-repeater-type-<?php echo esc_attr( $field['type'] ).' '.esc_attr( $class ); ?>">
|
<div class="sad-repeater-field sad-repeater-type-<?php echo esc_attr( $field['type'] ) . ' ' . esc_attr( $class ); ?>">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$label = isset( $field['label'] ) ? $field['label'] : '';
|
$label = isset( $field['label'] ) ? $field['label'] : '';
|
||||||
@@ -241,21 +241,21 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
* Text field
|
* Text field
|
||||||
*/
|
*/
|
||||||
case 'text':
|
case 'text':
|
||||||
echo '<input data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'" type="text" value="'.esc_attr( $new_value ).'"/>';
|
echo '<input data-default="' . esc_attr( $default ) . '" data-name="' . esc_attr( $key ) . '" type="text" value="' . esc_attr( $new_value ) . '"/>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Textarea field
|
* Textarea field
|
||||||
*/
|
*/
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
echo '<textarea data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'">'.esc_attr( $new_value ).'</textarea>';
|
echo '<textarea data-default="' . esc_attr( $default ) . '" data-name="' . esc_attr( $key ) . '">' . esc_attr( $new_value ) . '</textarea>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL field
|
* URL field
|
||||||
*/
|
*/
|
||||||
case 'url':
|
case 'url':
|
||||||
echo '<input data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'" type="text" value="'.esc_url( $new_value ).'"/>';
|
echo '<input data-default="' . esc_attr( $default ) . '" data-name="' . esc_attr( $key ) . '" type="text" value="' . esc_url( $new_value ) . '"/>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,12 +263,12 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
*/
|
*/
|
||||||
case 'icon':
|
case 'icon':
|
||||||
$sophia_after_dark_fork_awesome_icon_array = sophia_after_dark_fork_awesome_icon_array();
|
$sophia_after_dark_fork_awesome_icon_array = sophia_after_dark_fork_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">';
|
echo '<div class="sad-repeater-selected-icon"><i class="' . esc_attr( $new_value ) . '"></i><span><i class="fa fa-angle-down"></i></span></div><ul class="sad-repeater-icon-list sad-clearfix">';
|
||||||
foreach ( $sophia_after_dark_fork_awesome_icon_array as $sophia_after_dark_fork_awesome_icon ) {
|
foreach ( $sophia_after_dark_fork_awesome_icon_array as $sophia_after_dark_fork_awesome_icon ) {
|
||||||
$icon_class = $new_value == $sophia_after_dark_fork_awesome_icon ? 'icon-active' : '';
|
$icon_class = $new_value == $sophia_after_dark_fork_awesome_icon ? 'icon-active' : '';
|
||||||
echo '<li class='.esc_attr( $icon_class ).'><i class="'.esc_attr( $sophia_after_dark_fork_awesome_icon ).'"></i></li>';
|
echo '<li class=' . esc_attr( $icon_class ) . '><i class="' . esc_attr( $sophia_after_dark_fork_awesome_icon ) . '"></i></li>';
|
||||||
}
|
}
|
||||||
echo '</ul><input data-default="'.esc_attr( $default ).'" type="hidden" value="'.esc_attr( $new_value ).'" data-name="'.esc_attr( $key ).'"/>';
|
echo '</ul><input data-default="' . esc_attr( $default ) . '" type="hidden" value="' . esc_attr( $new_value ) . '" data-name="' . esc_attr( $key ) . '"/>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,12 +276,12 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
*/
|
*/
|
||||||
case 'social_icon':
|
case 'social_icon':
|
||||||
$sophia_after_dark_fork_awesome_social_icon_array = sophia_after_dark_fork_awesome_social_icon_array();
|
$sophia_after_dark_fork_awesome_social_icon_array = sophia_after_dark_fork_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">';
|
echo '<div class="sad-repeater-selected-icon"><i class="' . esc_attr( $new_value ) . '"></i><span><i class="fa fa-angle-down"></i></span></div><ul class="sad-repeater-icon-list sad-clearfix">';
|
||||||
foreach ( $sophia_after_dark_fork_awesome_social_icon_array as $sophia_after_dark_fork_awesome_icon ) {
|
foreach ( $sophia_after_dark_fork_awesome_social_icon_array as $sophia_after_dark_fork_awesome_icon ) {
|
||||||
$icon_class = $new_value == $sophia_after_dark_fork_awesome_icon ? 'icon-active' : '';
|
$icon_class = $new_value == $sophia_after_dark_fork_awesome_icon ? 'icon-active' : '';
|
||||||
echo '<li class='.esc_attr( $icon_class ).'><i class="'.esc_attr( $sophia_after_dark_fork_awesome_icon ).'"></i></li>';
|
echo '<li class=' . esc_attr( $icon_class ) . '><i class="' . esc_attr( $sophia_after_dark_fork_awesome_icon ) . '"></i></li>';
|
||||||
}
|
}
|
||||||
echo '</ul><input data-default="'.esc_attr( $default ).'" type="hidden" value="'.esc_attr( $new_value ).'" data-name="'.esc_attr( $key ).'"/>';
|
echo '</ul><input data-default="' . esc_attr( $default ) . '" type="hidden" value="' . esc_attr( $new_value ) . '" data-name="' . esc_attr( $key ) . '"/>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -289,9 +289,8 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
*/
|
*/
|
||||||
case 'select':
|
case 'select':
|
||||||
$options = $field['options'];
|
$options = $field['options'];
|
||||||
echo '<select data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'">';
|
echo '<select data-default="' . esc_attr( $default ) . '" data-name="' . esc_attr( $key ) . '">';
|
||||||
foreach ( $options as $option => $val )
|
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 ) );
|
printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $option ), selected( $new_value, $option, false ), esc_html( $val ) );
|
||||||
}
|
}
|
||||||
echo '</select>';
|
echo '</select>';
|
||||||
@@ -302,7 +301,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
*/
|
*/
|
||||||
case 'dropdown_pages':
|
case 'dropdown_pages':
|
||||||
$show_option_none = esc_html__( '— Select a page —', 'sophia-after-dark' );
|
$show_option_none = esc_html__( '— Select a page —', 'sophia-after-dark' );
|
||||||
$select_field ='data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'"';
|
$select_field = 'data-default="' . esc_attr( $default ) . '" data-name="' . esc_attr( $key ) . '"';
|
||||||
$option_none_value = '';
|
$option_none_value = '';
|
||||||
$dropdown = wp_dropdown_pages(
|
$dropdown = wp_dropdown_pages(
|
||||||
array(
|
array(
|
||||||
@@ -310,7 +309,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
'echo' => '',
|
'echo' => '',
|
||||||
'show_option_none' => esc_html( $show_option_none ),
|
'show_option_none' => esc_html( $show_option_none ),
|
||||||
'option_none_value' => esc_attr( $option_none_value ),
|
'option_none_value' => esc_attr( $option_none_value ),
|
||||||
'selected' => esc_attr( $new_value )
|
'selected' => esc_attr( $new_value ),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -329,15 +328,15 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
* Upload field
|
* Upload field
|
||||||
*/
|
*/
|
||||||
case 'upload':
|
case 'upload':
|
||||||
$image_class = "";
|
$image_class = '';
|
||||||
$upload_btn_label = esc_html__( 'Select Image', 'sophia-after-dark' );
|
$upload_btn_label = esc_html__( 'Select Image', 'sophia-after-dark' );
|
||||||
$remove_btn_label = esc_html__( 'Remove', 'sophia-after-dark' );
|
$remove_btn_label = esc_html__( 'Remove', 'sophia-after-dark' );
|
||||||
if ( $new_value ) {
|
if ( $new_value ) {
|
||||||
$image_class = ' hidden';
|
$image_class = ' hidden';
|
||||||
}
|
}
|
||||||
echo '<div class="mt-fields-wrap"><div class="attachment-media-view"><div class="placeholder'. esc_attr( $image_class ).'">';
|
echo '<div class="sad-fields-wrap"><div class="attachment-media-view"><div class="placeholder' . esc_attr( $image_class ) . '">';
|
||||||
esc_html_e( 'No image selected', 'sophia-after-dark' );
|
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>';
|
echo '</div><div class="thumbnail thumbnail-image"><img src="' . esc_url( $new_value ) . '" style="max-width:100%;"/></div><div class="actions sad-clearfix"><button type="button" class="button sad-delete-button align-left">' . esc_html( $remove_btn_label ) . '</button><button type="button" class="button sad-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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -347,10 +346,10 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="mt-clearfix mt-repeater-footer">
|
<div class="sad-clearfix sad-repeater-footer">
|
||||||
<div class="alignright">
|
<div class="alignright">
|
||||||
<a class="mt-repeater-field-remove" href="#remove"><?php esc_html_e( 'Delete', 'sophia-after-dark' ) ?></a> |
|
<a class="sad-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>
|
<a class="sad-repeater-field-close" href="#close"><?php esc_html_e( 'Close', 'sophia-after-dark' ); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -361,7 +360,7 @@ if ( ! function_exists( 'sophia_after_dark_register_custom_controls' ) ) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}// Ends sophia_after_dark_register_custom_controls
|
}//end sophia_after_dark_register_custom_controls()
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||||
331
inc/customizer/sad-customizer-design-panel-options.php
Normal file
331
inc/customizer/sad-customizer-design-panel-options.php
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
<?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' => 'sad-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(
|
||||||
|
'sad-archive--block-grid-style' => get_template_directory_uri() . '/assets/images/archive-block-grid.png',
|
||||||
|
'sad-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',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
169
inc/customizer/sad-customizer-footer-panel-options.php
Normal file
169
inc/customizer/sad-customizer-footer-panel-options.php
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<?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__( '©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',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
197
inc/customizer/sad-customizer-front-panel-options.php
Normal file
197
inc/customizer/sad-customizer-front-panel-options.php
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<?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',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
138
inc/customizer/sad-customizer-general-panel-options.php
Normal file
138
inc/customizer/sad-customizer-general-panel-options.php
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?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 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,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$wp_customize->add_control(
|
||||||
|
new WP_Customize_Image_control(
|
||||||
|
$wp_customize,
|
||||||
|
'sophia_after_dark_home_og_image',
|
||||||
|
array(
|
||||||
|
'label' => __( 'Home Page Open Graph Image', 'sophia_after_dark' ),
|
||||||
|
'section' => 'sophia_after_dark_section_site',
|
||||||
|
'settings' => 'sophia_after_dark_home_og_image',
|
||||||
|
'priority' => 15,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$users = get_users();
|
||||||
|
$user_choices = array();
|
||||||
|
foreach ( $users as $user ) {
|
||||||
|
$user_choices[ $user->ID ] = $user->display_name;
|
||||||
|
}
|
||||||
|
$wp_customize->add_control(
|
||||||
|
'sophia_after_dark_home_og_user',
|
||||||
|
array(
|
||||||
|
'label' => __( 'Select User for Open Graph Tags', 'sophia_after_dark' ),
|
||||||
|
'section' => 'sophia_after_dark_section_site',
|
||||||
|
'settings' => 'sophia_after_dark_home_og_user',
|
||||||
|
'type' => 'select',
|
||||||
|
'choices' => $user_choices,
|
||||||
|
'priority' => 20,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
/**
|
||||||
|
* 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' => 25,
|
||||||
|
'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' => 25,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
346
inc/customizer/sad-customizer-header-panel-options.php
Normal file
346
inc/customizer/sad-customizer-header-panel-options.php
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
<?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,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
91
inc/customizer/sad-customizer-panels.php
Normal file
91
inc/customizer/sad-customizer-panels.php
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
<?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' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
123
inc/customizer/sad-customizer.php
Normal file
123
inc/customizer/sad-customizer.php
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<?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' );
|
||||||
|
$wp_customize->add_setting(
|
||||||
|
'sophia_after_dark_home_og_image',
|
||||||
|
array(
|
||||||
|
'default' => '',
|
||||||
|
'sanitize_callback' => 'esc_url_raw',
|
||||||
|
'type' => 'option',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$wp_customize->add_setting(
|
||||||
|
'sophia_after_dark_home_og_user',
|
||||||
|
array(
|
||||||
|
'default' => 1,
|
||||||
|
'sanitize_callback' => 'absint',
|
||||||
|
'type' => 'option',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
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/sad-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_script( 'sophia-after-dark--admin-customizer-script', get_template_directory_uri() . '/assets/js/sad-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/sad-customizer-additional-open-graph.php';
|
||||||
|
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-custom-classes.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-panels.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-sanitize.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-callback.php';
|
||||||
|
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-general-panel-options.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-header-panel-options.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-front-panel-options.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-additional-panel-options.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-design-panel-options.php';
|
||||||
|
require get_template_directory() . '/inc/customizer/sad-customizer-footer-panel-options.php';
|
||||||
@@ -13,7 +13,7 @@ if ( ! function_exists( 'sophia_after_dark_main_header_start' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_main_header_start() {
|
function sophia_after_dark_main_header_start() {
|
||||||
echo '<header id="masthead" class="site-header">';
|
echo '<header id="masthead" class="site-header">';
|
||||||
echo '<div class="mt-logo-row-wrapper mt-clearfix">';
|
echo '<div class="sad-logo-row-wrapper sad-clearfix">';
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -24,9 +24,9 @@ if ( ! function_exists( 'sophia_after_dark_site_branding' ) ) :
|
|||||||
* function to display site branding
|
* function to display site branding
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_site_branding() {
|
function sophia_after_dark_site_branding() {
|
||||||
?>
|
?>
|
||||||
<div class="logo-ads-wrap">
|
<div class="logo-ads-wrap">
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
<div class="site-branding">
|
<div class="site-branding">
|
||||||
<?php
|
<?php
|
||||||
the_custom_logo();
|
the_custom_logo();
|
||||||
@@ -52,7 +52,7 @@ if ( ! function_exists( 'sophia_after_dark_site_branding' ) ) :
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -63,8 +63,8 @@ if ( ! function_exists( 'sophia_after_dark_menu_wrapper_start' ) ) :
|
|||||||
* function to start menu wrapper
|
* function to start menu wrapper
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_menu_wrapper_start() {
|
function sophia_after_dark_menu_wrapper_start() {
|
||||||
echo '<div class="mt-social-menu-wrapper">';
|
echo '<div class="sad-social-menu-wrapper">';
|
||||||
echo '<div class="mt-container">';
|
echo '<div class="sad-container">';
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -76,19 +76,21 @@ if ( ! function_exists( 'sophia_after_dark_header_main_menu' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_header_main_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' ) );
|
$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="sad-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>
|
<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">
|
<nav itemscope id="site-navigation" class="main-navigation">
|
||||||
<?php
|
<?php
|
||||||
wp_nav_menu( array(
|
wp_nav_menu(
|
||||||
|
array(
|
||||||
'theme_location' => 'primary_menu',
|
'theme_location' => 'primary_menu',
|
||||||
'menu_id' => 'primary-menu',
|
'menu_id' => 'primary-menu',
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -99,7 +101,7 @@ if ( ! function_exists( 'sophia_after_dark_menu_icon_wrapper_start' ) ) :
|
|||||||
* function to start icon wrapper
|
* function to start icon wrapper
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_menu_icon_wrapper_start() {
|
function sophia_after_dark_menu_icon_wrapper_start() {
|
||||||
echo '<div class="mt-social-search-wrapper">';
|
echo '<div class="sad-social-search-wrapper">';
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -115,12 +117,12 @@ if ( ! function_exists( 'sophia_after_dark_menu_social_icons' ) ) :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$sophia_after_dark_menu_social_icons_label = apply_filters( 'sophia_after_dark_menu_social_icons_label', __( 'Follow Us: ', 'sophia-after-dark' ) );
|
$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">
|
<div class="sad-social-wrapper">
|
||||||
<span class="mt-follow-title"><?php echo esc_html( $sophia_after_dark_menu_social_icons_label ); ?></span>
|
<span class="sad-follow-title"><?php echo esc_html( $sophia_after_dark_menu_social_icons_label ); ?></span>
|
||||||
<?php sophia_after_dark_social_media_content(); ?>
|
<?php sophia_after_dark_social_media_content(); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -136,17 +138,17 @@ if ( ! function_exists( 'sophia_after_dark_menu_search_icon' ) ) :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$sophia_after_dark_menu_search_icon_lable = apply_filters( 'sophia_after_dark_menu_search_icon_lable', __( 'Search', 'sophia-after-dark' ) );
|
$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="sad-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="sad-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">
|
<div class="sad-form-wrap">
|
||||||
|
|
||||||
<?php get_search_form(); ?>
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
<div class="mt-form-close"><a href="javascript:void(0)"><i class="fa fa-close"></i></a></div>
|
<div class="sad-form-close"><a href="javascript:void(0)"><i class="fa fa-close"></i></a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -207,10 +209,15 @@ if ( ! function_exists( 'sophia_after_dark_header_categories_lists_content' ) )
|
|||||||
* function to display categories lists
|
* function to display categories lists
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_header_categories_lists_content() {
|
function sophia_after_dark_header_categories_lists_content() {
|
||||||
$get_categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) );
|
$get_categories = get_categories(
|
||||||
?>
|
array(
|
||||||
<div class="mt-header-cat-list-wrapper">
|
'orderby' => 'name',
|
||||||
<ul class="sticky-header-sidebar-menu mt-slide-cat-lists">
|
'order' => 'ASC',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<div class="sad-header-cat-list-wrapper">
|
||||||
|
<ul class="sticky-header-sidebar-menu sad-slide-cat-lists">
|
||||||
<?php
|
<?php
|
||||||
$count = 1;
|
$count = 1;
|
||||||
$cat_list_items = apply_filters( 'sophia_after_dark_menu_cat_list_items', 5 );
|
$cat_list_items = apply_filters( 'sophia_after_dark_menu_cat_list_items', 5 );
|
||||||
@@ -224,7 +231,7 @@ if ( ! function_exists( 'sophia_after_dark_header_categories_lists_content' ) )
|
|||||||
<a href="<?php echo esc_url( $cat_link ); ?>">
|
<a href="<?php echo esc_url( $cat_link ); ?>">
|
||||||
<?php
|
<?php
|
||||||
echo esc_html( $cat_name );
|
echo esc_html( $cat_name );
|
||||||
echo '<span>'. esc_html( $cat_count ) .'</span>';
|
echo '<span>' . esc_html( $cat_count ) . '</span>';
|
||||||
?>
|
?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -234,7 +241,7 @@ if ( ! function_exists( 'sophia_after_dark_header_categories_lists_content' ) )
|
|||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -247,7 +254,7 @@ if ( ! function_exists( 'sophia_after_dark_header_author_box_content' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_header_author_box_content() {
|
function sophia_after_dark_header_author_box_content() {
|
||||||
$sophia_after_dark_user_id = apply_filters( 'sophia_after_dark_header_user_id', 1 );
|
$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 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>
|
<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>
|
<h3 itemprop="name" class="author-name"><?php echo esc_html( get_the_author_meta( 'nicename', $sophia_after_dark_user_id ) ); ?></h3>
|
||||||
@@ -256,7 +263,7 @@ if ( ! function_exists( 'sophia_after_dark_header_author_box_content' ) ) :
|
|||||||
<?php sophia_after_dark_social_media_content(); ?>
|
<?php sophia_after_dark_social_media_content(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -274,7 +281,7 @@ if ( ! function_exists( 'sophia_after_dark_scroll_top_content' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_scroll_top_content() {
|
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' ) );
|
$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>';
|
echo '<div id="sad-scrollup" class="animated arrow-hide">' . esc_html( $sophia_after_dark_scroll_top_text ) . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -288,15 +295,15 @@ if ( ! function_exists( 'sophia_after_dark_innerpage_header_start' ) ) :
|
|||||||
function sophia_after_dark_innerpage_header_start() {
|
function sophia_after_dark_innerpage_header_start() {
|
||||||
$inner_header_attribute = '';
|
$inner_header_attribute = '';
|
||||||
$inner_header_attribute = apply_filters( 'sophia_after_dark_inner_header_style_attribute', $inner_header_attribute );
|
$inner_header_attribute = apply_filters( 'sophia_after_dark_inner_header_style_attribute', $inner_header_attribute );
|
||||||
if ( !empty( $inner_header_attribute ) ) {
|
if ( ! empty( $inner_header_attribute ) ) {
|
||||||
$header_class = 'has-bg-img';
|
$header_class = 'has-bg-img';
|
||||||
} else {
|
} else {
|
||||||
$header_class = 'no-bg-img';
|
$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="custom-header <?php echo esc_attr( $header_class ); ?>" <?php echo ( ! empty( $inner_header_attribute ) ) ? ' style="' . esc_attr( $inner_header_attribute ) . '" ' : ''; ?>>
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -317,7 +324,7 @@ if ( ! function_exists( 'sophia_after_dark_innerpage_header_title' ) ) :
|
|||||||
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'sophia-after-dark' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
|
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'sophia-after-dark' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
|
||||||
<?php
|
<?php
|
||||||
} elseif ( is_404() ) {
|
} elseif ( is_404() ) {
|
||||||
echo '<h1 class="entry-title">'. esc_html( 'Error 404', 'sophia-after-dark' ) .'</h1>';
|
echo '<h1 class="entry-title">' . esc_html( 'Error 404', 'sophia-after-dark' ) . '</h1>';
|
||||||
} elseif ( is_home() ) {
|
} elseif ( is_home() ) {
|
||||||
$page_for_posts_id = get_option( 'page_for_posts' );
|
$page_for_posts_id = get_option( 'page_for_posts' );
|
||||||
$page_title = get_the_title( $page_for_posts_id );
|
$page_title = get_the_title( $page_for_posts_id );
|
||||||
@@ -339,18 +346,20 @@ if ( ! function_exists( 'sophia_after_dark_breadcrumb_content' ) ) :
|
|||||||
if ( false === $sophia_after_dark_breadcrumb_option ) {
|
if ( false === $sophia_after_dark_breadcrumb_option ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<nav id="breadcrumb" class="mt-breadcrumb">
|
<nav id="breadcrumb" class="sad-breadcrumb">
|
||||||
<?php
|
<?php
|
||||||
breadcrumb_trail( array(
|
breadcrumb_trail(
|
||||||
|
array(
|
||||||
'container' => 'div',
|
'container' => 'div',
|
||||||
'before' => '<div class="mt-container">',
|
'before' => '<div class="sad-container">',
|
||||||
'after' => '</div>',
|
'after' => '</div>',
|
||||||
'show_browse' => false,
|
'show_browse' => false,
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</nav>
|
</nav>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -361,10 +370,10 @@ if ( ! function_exists( 'sophia_after_dark_innerpage_header_end' ) ) :
|
|||||||
* function to manage ending div of section
|
* function to manage ending div of section
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_innerpage_header_end() {
|
function sophia_after_dark_innerpage_header_end() {
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -383,7 +392,6 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function displaying front slider section
|
* Function displaying front slider section
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_front_slider() {
|
function sophia_after_dark_front_slider() {
|
||||||
$sophia_after_dark_section_slider_option = get_theme_mod( 'sophia_after_dark_section_slider_option', false );
|
$sophia_after_dark_section_slider_option = get_theme_mod( 'sophia_after_dark_section_slider_option', false );
|
||||||
@@ -396,9 +404,9 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
} else {
|
} else {
|
||||||
$slider_class = 'no-featured-slider full-width--slider';
|
$slider_class = 'no-featured-slider full-width--slider';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="front-slider-wrapper <?php echo esc_attr( $slider_class ); ?>">
|
<div class="front-slider-wrapper <?php echo esc_attr( $slider_class ); ?>">
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
<div class="front-slider-block">
|
<div class="front-slider-block">
|
||||||
<div class="front-slider cS-hidden">
|
<div class="front-slider cS-hidden">
|
||||||
<?php
|
<?php
|
||||||
@@ -407,16 +415,16 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
$slider_args = array(
|
$slider_args = array(
|
||||||
'category_name' => esc_attr( $slider_cat_slug ),
|
'category_name' => esc_attr( $slider_cat_slug ),
|
||||||
'meta_key' => '_thumbnail_id',
|
'meta_key' => '_thumbnail_id',
|
||||||
'posts_per_page' => absint( $slide_post_count )
|
'posts_per_page' => absint( $slide_post_count ),
|
||||||
);
|
);
|
||||||
$slider_post_query = new WP_Query( $slider_args );
|
$slider_post_query = new WP_Query( $slider_args );
|
||||||
if ( $slider_post_query->have_posts() ) :
|
if ( $slider_post_query->have_posts() ) :
|
||||||
while ( $slider_post_query-> have_posts() ) :
|
while ( $slider_post_query->have_posts() ) :
|
||||||
$slider_post_query -> the_post();
|
$slider_post_query->the_post();
|
||||||
$post_id = get_the_ID();
|
$post_id = get_the_ID();
|
||||||
$image_url = get_the_post_thumbnail_url( $post_id, 'large' );
|
$image_url = get_the_post_thumbnail_url( $post_id, 'large' );
|
||||||
if ( ! empty( $image_url ) ) {
|
if ( ! empty( $image_url ) ) {
|
||||||
$slider_style = 'style="background:url('. esc_url( $image_url ) .') no-repeat scroll center center; background-size:cover"';
|
$slider_style = 'style="background:url(' . esc_url( $image_url ) . ') no-repeat scroll center center; background-size:cover"';
|
||||||
} else {
|
} else {
|
||||||
$slider_style = '';
|
$slider_style = '';
|
||||||
}
|
}
|
||||||
@@ -447,7 +455,7 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
$sophia_after_dark_top_featured_posts_title = get_theme_mod( 'sophia_after_dark_top_featured_posts_title', __( 'Featured News', 'sophia-after-dark' ) );
|
$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">';
|
echo '<div class="top-featured-post-main-wrapper">';
|
||||||
if ( ! empty( $sophia_after_dark_top_featured_posts_title ) ) {
|
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>';
|
echo '<div class="features-post-title">' . esc_html( $sophia_after_dark_top_featured_posts_title ) . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sophia_after_dark_top_featured_post_order = get_theme_mod( 'sophia_after_dark_top_featured_post_order', 'default' );
|
$sophia_after_dark_top_featured_post_order = get_theme_mod( 'sophia_after_dark_top_featured_post_order', 'default' );
|
||||||
@@ -460,18 +468,19 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
$top_featured_post_args['orderby'] = 'rand';
|
$top_featured_post_args['orderby'] = 'rand';
|
||||||
}
|
}
|
||||||
$top_featured_post_query = new WP_Query( $top_featured_post_args );
|
$top_featured_post_query = new WP_Query( $top_featured_post_args );
|
||||||
if ( $top_featured_post_query -> have_posts() ) :
|
if ( $top_featured_post_query->have_posts() ) :
|
||||||
echo '<div class="top-featured-post-wrap">';
|
echo '<div class="top-featured-post-wrap">';
|
||||||
$featured_post_count = 1;
|
$featured_post_count = 1;
|
||||||
while ( $top_featured_post_query -> have_posts() ) : $top_featured_post_query -> the_post();
|
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 id="post-<?php the_ID(); ?>" class="sad-single-post-wrap sad-clearfix">
|
||||||
<div class="post-thumbnail">
|
<div class="post-thumbnail">
|
||||||
<span class="post-number"><?php echo absint( $featured_post_count ); ?></span>
|
<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 style="background: no-repeat center top url(<?php echo get_the_post_thumbnail_url(); ?>); background-size: cover; height: 100px;">
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-post-content">
|
<div class="sad-post-content">
|
||||||
<div class="entry-meta">
|
<div class="entry-meta">
|
||||||
<?php
|
<?php
|
||||||
sophia_after_dark_posted_on();
|
sophia_after_dark_posted_on();
|
||||||
@@ -484,7 +493,7 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$featured_post_count ++;
|
++$featured_post_count;
|
||||||
endwhile;
|
endwhile;
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
endif;
|
endif;
|
||||||
@@ -493,7 +502,7 @@ if ( ! function_exists( 'sophia_after_dark_front_slider' ) ) :
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -531,21 +540,23 @@ if ( ! function_exists( 'sophia_after_dark_bottom_footer' ) ) :
|
|||||||
* function to display bottom footer section
|
* function to display bottom footer section
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_bottom_footer() {
|
function sophia_after_dark_bottom_footer() {
|
||||||
?>
|
?>
|
||||||
<div id="bottom-footer">
|
<div id="bottom-footer">
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
<?php
|
<?php
|
||||||
$sophia_after_dark_enable_footer_menu = get_theme_mod( 'sophia_after_dark_enable_footer_menu', true );
|
$sophia_after_dark_enable_footer_menu = get_theme_mod( 'sophia_after_dark_enable_footer_menu', true );
|
||||||
if ( true === $sophia_after_dark_enable_footer_menu ) {
|
if ( true === $sophia_after_dark_enable_footer_menu ) {
|
||||||
?>
|
?>
|
||||||
<nav id="footer-navigation" class="footer-navigation">
|
<nav id="footer-navigation" class="footer-navigation">
|
||||||
<?php
|
<?php
|
||||||
wp_nav_menu( array(
|
wp_nav_menu(
|
||||||
|
array(
|
||||||
'theme_location' => 'footer_menu',
|
'theme_location' => 'footer_menu',
|
||||||
'menu_id' => 'footer-menu',
|
'menu_id' => 'footer-menu',
|
||||||
'fallback_cb' => false,
|
'fallback_cb' => false,
|
||||||
'depth' => 1
|
'depth' => 1,
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</nav>
|
</nav>
|
||||||
<?php
|
<?php
|
||||||
@@ -553,14 +564,14 @@ if ( ! function_exists( 'sophia_after_dark_bottom_footer' ) ) :
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="site-info">
|
<div class="site-info">
|
||||||
<span class="mt-copyright-text">
|
<span class="sad-copyright-text">
|
||||||
<?php
|
<?php
|
||||||
$sophia_after_dark_footer_copyright = get_theme_mod( 'sophia_after_dark_footer_copyright', __( 'Sophia After Dark', 'sophia-after-dark' ) );
|
$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 );
|
echo esc_html( $sophia_after_dark_footer_copyright );
|
||||||
?>
|
?>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<span class="mt-disclaimer-text">
|
<span class="sad-disclaimer-text">
|
||||||
<?php
|
<?php
|
||||||
$sophia_after_dark_footer_disclaimer = get_theme_mod( 'sophia_after_dark_footer_disclaimer', __( 'Sophia After Dark', 'sophia-after-dark' ) );
|
$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 );
|
echo esc_html( $sophia_after_dark_footer_disclaimer );
|
||||||
@@ -569,7 +580,7 @@ if ( ! function_exists( 'sophia_after_dark_bottom_footer' ) ) :
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -12,8 +12,8 @@ if ( ! function_exists( 'sophia_after_dark_top_header_start' ) ) :
|
|||||||
* function to start top header section
|
* function to start top header section
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_top_header_start() {
|
function sophia_after_dark_top_header_start() {
|
||||||
echo '<div id="top-header" class="top-header-wrap mt-clearfix">';
|
echo '<div id="top-header" class="top-header-wrap sad-clearfix">';
|
||||||
echo '<div class="mt-container">';
|
echo '<div class="sad-container">';
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -34,43 +34,44 @@ if ( ! function_exists( 'sophia_after_dark_trending_section' ) ) :
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* function to display the trending tags sections
|
* function to display the trending tags sections
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_trending_section() {
|
function sophia_after_dark_trending_section() {
|
||||||
$sophia_after_dark_enable_trending = get_theme_mod( 'sophia_after_dark_enable_trending', false );
|
$sophia_after_dark_enable_trending = get_theme_mod( 'sophia_after_dark_enable_trending', false );
|
||||||
if ( false === $sophia_after_dark_enable_trending ){
|
if ( false === $sophia_after_dark_enable_trending ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$sophia_after_dark_enable_trending_tag_before_icon = get_theme_mod( 'sophia_after_dark_enable_trending_tag_before_icon', true );
|
$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 ){
|
if ( $sophia_after_dark_enable_trending_tag_before_icon === true ) {
|
||||||
$before_icon = 'tag-before-icon';
|
$before_icon = 'tag-before-icon';
|
||||||
}else{
|
} else {
|
||||||
$before_icon = '';
|
$before_icon = '';
|
||||||
}
|
}
|
||||||
$trending_label = get_theme_mod( 'sophia_after_dark_trending_label', __( 'Trending Now', 'sophia-after-dark' ) );
|
$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 ); ?>">
|
<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>
|
<span class="wrap-label"><i class="fa fa-bolt" aria-hidden="true"></i> <?php echo esc_html( $trending_label ); ?></span>
|
||||||
<div class="tags-wrapper">
|
<div class="tags-wrapper">
|
||||||
<?php
|
<?php
|
||||||
$sophia_after_dark_trending_tags_orderby = get_theme_mod( 'sophia_after_dark_trending_tags_orderby', '' );
|
$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' );
|
$sophia_after_dark_trending_tags_count = get_theme_mod( 'sophia_after_dark_trending_tags_count', '5' );
|
||||||
$get_tags_lists = get_tags( array(
|
$get_tags_lists = get_tags(
|
||||||
|
array(
|
||||||
'order' => 'DESC',
|
'order' => 'DESC',
|
||||||
'orderby'=> esc_attr( $sophia_after_dark_trending_tags_orderby ),
|
'orderby' => esc_attr( $sophia_after_dark_trending_tags_orderby ),
|
||||||
'number' => absint( $sophia_after_dark_trending_tags_count ),
|
'number' => absint( $sophia_after_dark_trending_tags_count ),
|
||||||
));
|
)
|
||||||
if ( !empty( $get_tags_lists ) ) {
|
);
|
||||||
|
if ( ! empty( $get_tags_lists ) ) {
|
||||||
echo '<span class="head-tags-links">';
|
echo '<span class="head-tags-links">';
|
||||||
foreach( $get_tags_lists as $tag ) {
|
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 '<a href="' . esc_html( get_tag_link( $tag->term_id ) ) . '" rel="tag">' . esc_html( $tag->name ) . '</a>';
|
||||||
}
|
}
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -88,7 +89,7 @@ if ( ! function_exists( 'sophia_after_dark_top_header_nav' ) ) :
|
|||||||
$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_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' );
|
$sophia_after_dark_live_now_link = get_theme_mod( 'sophia_after_dark_live_now_link' );
|
||||||
?>
|
?>
|
||||||
<div class="mt-live-link">
|
<div class="sad-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>
|
<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>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
@@ -97,11 +98,13 @@ if ( ! function_exists( 'sophia_after_dark_top_header_nav' ) ) :
|
|||||||
<div class="top-header-nav">
|
<div class="top-header-nav">
|
||||||
<nav itemscope id="top-navigation" class="main-navigation">
|
<nav itemscope id="top-navigation" class="main-navigation">
|
||||||
<?php
|
<?php
|
||||||
wp_nav_menu( array(
|
wp_nav_menu(
|
||||||
|
array(
|
||||||
'theme_location' => 'top_header_menu',
|
'theme_location' => 'top_header_menu',
|
||||||
'menu_id' => 'top-header-menu',
|
'menu_id' => 'top-header-menu',
|
||||||
'fallback_cb' => false,
|
'fallback_cb' => false,
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://jetpack.com
|
* @link https://jetpack.com
|
||||||
*
|
*
|
||||||
* @package Color Blo Dark
|
* @package Sophia After Dark
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -17,17 +17,22 @@
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_jetpack_setup() {
|
function sophia_after_dark_jetpack_setup() {
|
||||||
// Add theme support for Infinite Scroll.
|
// Add theme support for Infinite Scroll.
|
||||||
add_theme_support( 'infinite-scroll', array(
|
add_theme_support(
|
||||||
|
'infinite-scroll',
|
||||||
|
array(
|
||||||
'container' => 'main',
|
'container' => 'main',
|
||||||
'render' => 'sophia_after_dark_infinite_scroll_render',
|
'render' => 'sophia_after_dark_infinite_scroll_render',
|
||||||
'footer' => 'page'
|
'footer' => 'page',
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// Add theme support for Responsive Videos.
|
// Add theme support for Responsive Videos.
|
||||||
add_theme_support( 'jetpack-responsive-videos' );
|
add_theme_support( 'jetpack-responsive-videos' );
|
||||||
|
|
||||||
// Add theme support for Content Options
|
// Add theme support for Content Options
|
||||||
add_theme_support( 'jetpack-content-options', array(
|
add_theme_support(
|
||||||
|
'jetpack-content-options',
|
||||||
|
array(
|
||||||
'post-details' => array(
|
'post-details' => array(
|
||||||
'stylesheet' => 'sophia-after-dark-style',
|
'stylesheet' => 'sophia-after-dark-style',
|
||||||
'date' => '.posted-on',
|
'date' => '.posted-on',
|
||||||
@@ -41,7 +46,8 @@ function sophia_after_dark_jetpack_setup() {
|
|||||||
'post' => true,
|
'post' => true,
|
||||||
'page' => true,
|
'page' => true,
|
||||||
),
|
),
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
add_action( 'after_setup_theme', 'sophia_after_dark_jetpack_setup' );
|
add_action( 'after_setup_theme', 'sophia_after_dark_jetpack_setup' );
|
||||||
|
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
<?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>
|
|
||||||
</div>
|
|
||||||
<?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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
115
inc/metaboxes/sad-post-sidebar-meta.php
Normal file
115
inc/metaboxes/sad-post-sidebar-meta.php
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<?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="sad-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>
|
||||||
|
</div>
|
||||||
|
<?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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?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;
|
|
||||||
@@ -35,8 +35,9 @@ function breadcrumb_trail( $args = array() ) {
|
|||||||
|
|
||||||
$breadcrumb = apply_filters( 'breadcrumb_trail_object', null, $args );
|
$breadcrumb = apply_filters( 'breadcrumb_trail_object', null, $args );
|
||||||
|
|
||||||
if ( ! is_object( $breadcrumb ) )
|
if ( ! is_object( $breadcrumb ) ) {
|
||||||
$breadcrumb = new Breadcrumb_Trail( $args );
|
$breadcrumb = new Breadcrumb_Trail( $args );
|
||||||
|
}
|
||||||
|
|
||||||
return $breadcrumb->trail();
|
return $breadcrumb->trail();
|
||||||
}
|
}
|
||||||
@@ -137,7 +138,7 @@ class Breadcrumb_Trail {
|
|||||||
'show_browse' => true,
|
'show_browse' => true,
|
||||||
'labels' => array(),
|
'labels' => array(),
|
||||||
'post_taxonomy' => array(),
|
'post_taxonomy' => array(),
|
||||||
'echo' => true
|
'echo' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Parse the arguments with the deaults.
|
// Parse the arguments with the deaults.
|
||||||
@@ -210,11 +211,12 @@ class Breadcrumb_Trail {
|
|||||||
// Add list item classes.
|
// Add list item classes.
|
||||||
$item_class = 'trail-item';
|
$item_class = 'trail-item';
|
||||||
|
|
||||||
if ( 1 === $item_position && 1 < $item_count )
|
if ( 1 === $item_position && 1 < $item_count ) {
|
||||||
$item_class .= ' trail-begin';
|
$item_class .= ' trail-begin';
|
||||||
|
|
||||||
elseif ( $item_count === $item_position )
|
} elseif ( $item_count === $item_position ) {
|
||||||
$item_class .= ' trail-end';
|
$item_class .= ' trail-end';
|
||||||
|
}
|
||||||
|
|
||||||
// Create list item attributes.
|
// Create list item attributes.
|
||||||
$attributes = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="' . $item_class . '"';
|
$attributes = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="' . $item_class . '"';
|
||||||
@@ -223,7 +225,7 @@ class Breadcrumb_Trail {
|
|||||||
$meta = sprintf( '<meta itemprop="position" content="%s" />', absint( $item_position ) );
|
$meta = sprintf( '<meta itemprop="position" content="%s" />', absint( $item_position ) );
|
||||||
|
|
||||||
// Build the list item.
|
// Build the list item.
|
||||||
$breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s</%1$s>', tag_escape( $this->args['item_tag'] ),$attributes, $item, $meta );
|
$breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s</%1$s>', tag_escape( $this->args['item_tag'] ), $attributes, $item, $meta );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the unordered list.
|
// Close the unordered list.
|
||||||
@@ -243,8 +245,9 @@ class Breadcrumb_Trail {
|
|||||||
// Allow developers to filter the breadcrumb trail HTML.
|
// Allow developers to filter the breadcrumb trail HTML.
|
||||||
$breadcrumb = apply_filters( 'breadcrumb_trail', $breadcrumb, $this->args );
|
$breadcrumb = apply_filters( 'breadcrumb_trail', $breadcrumb, $this->args );
|
||||||
|
|
||||||
if ( false === $this->args['echo'] )
|
if ( false === $this->args['echo'] ) {
|
||||||
return $breadcrumb;
|
return $breadcrumb;
|
||||||
|
}
|
||||||
|
|
||||||
echo $breadcrumb;
|
echo $breadcrumb;
|
||||||
}
|
}
|
||||||
@@ -301,8 +304,9 @@ class Breadcrumb_Trail {
|
|||||||
$defaults = array();
|
$defaults = array();
|
||||||
|
|
||||||
// If post permalink is set to `%postname%`, use the `category` taxonomy.
|
// If post permalink is set to `%postname%`, use the `category` taxonomy.
|
||||||
if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) )
|
if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) ) {
|
||||||
$defaults['post'] = 'category';
|
$defaults['post'] = 'category';
|
||||||
|
}
|
||||||
|
|
||||||
$this->post_taxonomy = apply_filters( 'breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) );
|
$this->post_taxonomy = apply_filters( 'breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) );
|
||||||
}
|
}
|
||||||
@@ -342,39 +346,40 @@ class Breadcrumb_Trail {
|
|||||||
// If viewing an archive page.
|
// If viewing an archive page.
|
||||||
elseif ( is_archive() ) {
|
elseif ( is_archive() ) {
|
||||||
|
|
||||||
if ( is_post_type_archive() )
|
if ( is_post_type_archive() ) {
|
||||||
$this->add_post_type_archive_items();
|
$this->add_post_type_archive_items();
|
||||||
|
|
||||||
elseif ( is_category() || is_tag() || is_tax() )
|
} elseif ( is_category() || is_tag() || is_tax() ) {
|
||||||
$this->add_term_archive_items();
|
$this->add_term_archive_items();
|
||||||
|
|
||||||
elseif ( is_author() )
|
} elseif ( is_author() ) {
|
||||||
$this->add_user_archive_items();
|
$this->add_user_archive_items();
|
||||||
|
|
||||||
elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
|
} elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) {
|
||||||
$this->add_minute_hour_archive_items();
|
$this->add_minute_hour_archive_items();
|
||||||
|
|
||||||
elseif ( get_query_var( 'minute' ) )
|
} elseif ( get_query_var( 'minute' ) ) {
|
||||||
$this->add_minute_archive_items();
|
$this->add_minute_archive_items();
|
||||||
|
|
||||||
elseif ( get_query_var( 'hour' ) )
|
} elseif ( get_query_var( 'hour' ) ) {
|
||||||
$this->add_hour_archive_items();
|
$this->add_hour_archive_items();
|
||||||
|
|
||||||
elseif ( is_day() )
|
} elseif ( is_day() ) {
|
||||||
$this->add_day_archive_items();
|
$this->add_day_archive_items();
|
||||||
|
|
||||||
elseif ( get_query_var( 'w' ) )
|
} elseif ( get_query_var( 'w' ) ) {
|
||||||
$this->add_week_archive_items();
|
$this->add_week_archive_items();
|
||||||
|
|
||||||
elseif ( is_month() )
|
} elseif ( is_month() ) {
|
||||||
$this->add_month_archive_items();
|
$this->add_month_archive_items();
|
||||||
|
|
||||||
elseif ( is_year() )
|
} elseif ( is_year() ) {
|
||||||
$this->add_year_archive_items();
|
$this->add_year_archive_items();
|
||||||
|
|
||||||
else
|
} else {
|
||||||
$this->add_default_archive_items();
|
$this->add_default_archive_items();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If viewing a search results page.
|
// If viewing a search results page.
|
||||||
elseif ( is_search() ) {
|
elseif ( is_search() ) {
|
||||||
@@ -404,9 +409,10 @@ class Breadcrumb_Trail {
|
|||||||
protected function add_rewrite_front_items() {
|
protected function add_rewrite_front_items() {
|
||||||
global $wp_rewrite;
|
global $wp_rewrite;
|
||||||
|
|
||||||
if ( $wp_rewrite->front )
|
if ( $wp_rewrite->front ) {
|
||||||
$this->add_path_parents( $wp_rewrite->front );
|
$this->add_path_parents( $wp_rewrite->front );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the page/paged number to the items array.
|
* Adds the page/paged number to the items array.
|
||||||
@@ -418,17 +424,20 @@ class Breadcrumb_Trail {
|
|||||||
protected function add_paged_items() {
|
protected function add_paged_items() {
|
||||||
|
|
||||||
// If viewing a paged singular post.
|
// If viewing a paged singular post.
|
||||||
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] )
|
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) );
|
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If viewing a singular post with paged comments.
|
// If viewing a singular post with paged comments.
|
||||||
elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) )
|
elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) ) {
|
||||||
$this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) );
|
$this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If viewing a paged archive-type page.
|
// If viewing a paged archive-type page.
|
||||||
elseif ( is_paged() && true === $this->args['show_title'] )
|
elseif ( is_paged() && true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) );
|
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the network (all sites) home page link to the items array.
|
* Adds the network (all sites) home page link to the items array.
|
||||||
@@ -439,9 +448,10 @@ class Breadcrumb_Trail {
|
|||||||
*/
|
*/
|
||||||
protected function add_network_home_link() {
|
protected function add_network_home_link() {
|
||||||
|
|
||||||
if ( is_multisite() && ! is_main_site() && true === $this->args['network'] )
|
if ( is_multisite() && ! is_main_site() && true === $this->args['network'] ) {
|
||||||
$this->items[] = sprintf( '<a href="%s" rel="home">%s</a>', esc_url( network_home_url() ), $this->labels['home'] );
|
$this->items[] = sprintf( '<a href="%s" rel="home">%s</a>', esc_url( network_home_url() ), $this->labels['home'] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the current site's home page link to the items array.
|
* Adds the current site's home page link to the items array.
|
||||||
@@ -475,14 +485,16 @@ class Breadcrumb_Trail {
|
|||||||
$this->add_network_home_link();
|
$this->add_network_home_link();
|
||||||
|
|
||||||
// If on a paged view, add the site home link.
|
// If on a paged view, add the site home link.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->add_site_home_link();
|
$this->add_site_home_link();
|
||||||
|
}
|
||||||
|
|
||||||
// If on the main front page, add the network home title.
|
// If on the main front page, add the network home title.
|
||||||
elseif ( true === $this->args['show_title'] )
|
elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home'];
|
$this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds items for the posts page (i.e., is_home()) to the items array.
|
* Adds items for the posts page (i.e., is_home()) to the items array.
|
||||||
@@ -498,19 +510,21 @@ class Breadcrumb_Trail {
|
|||||||
$post = get_post( $post_id );
|
$post = get_post( $post_id );
|
||||||
|
|
||||||
// If the post has parents, add them to the trail.
|
// If the post has parents, add them to the trail.
|
||||||
if ( 0 < $post->post_parent )
|
if ( 0 < $post->post_parent ) {
|
||||||
$this->add_post_parents( $post->post_parent );
|
$this->add_post_parents( $post->post_parent );
|
||||||
|
}
|
||||||
|
|
||||||
// Get the page title.
|
// Get the page title.
|
||||||
$title = get_the_title( $post_id );
|
$title = get_the_title( $post_id );
|
||||||
|
|
||||||
// Add the posts page item.
|
// Add the posts page item.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $title );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $title );
|
||||||
|
|
||||||
elseif ( $title && true === $this->args['show_title'] )
|
} elseif ( $title && true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $title;
|
$this->items[] = $title;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds singular post items to the items array.
|
* Adds singular post items to the items array.
|
||||||
@@ -526,27 +540,31 @@ class Breadcrumb_Trail {
|
|||||||
$post_id = get_queried_object_id();
|
$post_id = get_queried_object_id();
|
||||||
|
|
||||||
// If the post has a parent, follow the parent trail.
|
// If the post has a parent, follow the parent trail.
|
||||||
if ( 0 < $post->post_parent )
|
if ( 0 < $post->post_parent ) {
|
||||||
$this->add_post_parents( $post->post_parent );
|
$this->add_post_parents( $post->post_parent );
|
||||||
|
}
|
||||||
|
|
||||||
// If the post doesn't have a parent, get its hierarchy based off the post type.
|
// If the post doesn't have a parent, get its hierarchy based off the post type.
|
||||||
else
|
else {
|
||||||
$this->add_post_hierarchy( $post_id );
|
$this->add_post_hierarchy( $post_id );
|
||||||
|
}
|
||||||
|
|
||||||
// Display terms for specific post type taxonomy if requested.
|
// Display terms for specific post type taxonomy if requested.
|
||||||
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) )
|
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) {
|
||||||
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
||||||
|
}
|
||||||
|
|
||||||
// End with the post title.
|
// End with the post title.
|
||||||
if ( $post_title = single_post_title( '', false ) ) {
|
if ( $post_title = single_post_title( '', false ) ) {
|
||||||
|
|
||||||
if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) )
|
if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $post_title );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $post_title );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $post_title;
|
$this->items[] = $post_title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for taxonomy term archives.
|
* Adds the items to the trail items array for taxonomy term archives.
|
||||||
@@ -568,8 +586,9 @@ class Breadcrumb_Trail {
|
|||||||
if ( false !== $taxonomy->rewrite ) {
|
if ( false !== $taxonomy->rewrite ) {
|
||||||
|
|
||||||
// If 'with_front' is true, dd $wp_rewrite->front to the trail.
|
// If 'with_front' is true, dd $wp_rewrite->front to the trail.
|
||||||
if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front )
|
if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) {
|
||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
}
|
||||||
|
|
||||||
// Get parent pages by path if they exist.
|
// Get parent pages by path if they exist.
|
||||||
$this->add_path_parents( $taxonomy->rewrite['slug'] );
|
$this->add_path_parents( $taxonomy->rewrite['slug'] );
|
||||||
@@ -629,8 +648,9 @@ class Breadcrumb_Trail {
|
|||||||
if ( 'post' === $taxonomy->object_type[0] ) {
|
if ( 'post' === $taxonomy->object_type[0] ) {
|
||||||
$post_id = get_option( 'page_for_posts' );
|
$post_id = get_option( 'page_for_posts' );
|
||||||
|
|
||||||
if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id )
|
if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If the post type is not 'post'.
|
// If the post type is not 'post'.
|
||||||
} else {
|
} else {
|
||||||
@@ -646,16 +666,18 @@ class Breadcrumb_Trail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the taxonomy is hierarchical, list its parent terms.
|
// If the taxonomy is hierarchical, list its parent terms.
|
||||||
if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent )
|
if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) {
|
||||||
$this->add_term_parents( $term->parent, $term->taxonomy );
|
$this->add_term_parents( $term->parent, $term->taxonomy );
|
||||||
|
}
|
||||||
|
|
||||||
// Add the term name to the trail end.
|
// Add the term name to the trail end.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = single_term_title( '', false );
|
$this->items[] = single_term_title( '', false );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for post type archives.
|
* Adds the items to the trail items array for post type archives.
|
||||||
@@ -672,25 +694,29 @@ class Breadcrumb_Trail {
|
|||||||
if ( false !== $post_type_object->rewrite ) {
|
if ( false !== $post_type_object->rewrite ) {
|
||||||
|
|
||||||
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
||||||
if ( $post_type_object->rewrite['with_front'] )
|
if ( $post_type_object->rewrite['with_front'] ) {
|
||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
}
|
||||||
|
|
||||||
// If there's a rewrite slug, check for parents.
|
// If there's a rewrite slug, check for parents.
|
||||||
if ( ! empty( $post_type_object->rewrite['slug'] ) )
|
if ( ! empty( $post_type_object->rewrite['slug'] ) ) {
|
||||||
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add the post type [plural] name to the trail end.
|
// Add the post type [plural] name to the trail end.
|
||||||
if ( is_paged() || is_author() )
|
if ( is_paged() || is_author() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = post_type_archive_title( '', false );
|
$this->items[] = post_type_archive_title( '', false );
|
||||||
|
}
|
||||||
|
|
||||||
// If viewing a post type archive by author.
|
// If viewing a post type archive by author.
|
||||||
if ( is_author() )
|
if ( is_author() ) {
|
||||||
$this->add_user_archive_items();
|
$this->add_user_archive_items();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for user (author) archives.
|
* Adds the items to the trail items array for user (author) archives.
|
||||||
@@ -710,16 +736,18 @@ class Breadcrumb_Trail {
|
|||||||
$user_id = get_query_var( 'author' );
|
$user_id = get_query_var( 'author' );
|
||||||
|
|
||||||
// If $author_base exists, check for parent pages.
|
// If $author_base exists, check for parent pages.
|
||||||
if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() )
|
if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() ) {
|
||||||
$this->add_path_parents( $wp_rewrite->author_base );
|
$this->add_path_parents( $wp_rewrite->author_base );
|
||||||
|
}
|
||||||
|
|
||||||
// Add the author's display name to the trail end.
|
// Add the author's display name to the trail end.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = get_the_author_meta( 'display_name', $user_id );
|
$this->items[] = get_the_author_meta( 'display_name', $user_id );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for minute + hour archives.
|
* Adds the items to the trail items array for minute + hour archives.
|
||||||
@@ -734,9 +762,10 @@ class Breadcrumb_Trail {
|
|||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
|
||||||
// Add the minute + hour item.
|
// Add the minute + hour item.
|
||||||
if ( true === $this->args['show_title'] )
|
if ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'sophia-after-dark' ) ) );
|
$this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'sophia-after-dark' ) ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for minute archives.
|
* Adds the items to the trail items array for minute archives.
|
||||||
@@ -751,9 +780,10 @@ class Breadcrumb_Trail {
|
|||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
|
||||||
// Add the minute item.
|
// Add the minute item.
|
||||||
if ( true === $this->args['show_title'] )
|
if ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'sophia-after-dark' ) ) );
|
$this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'sophia-after-dark' ) ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for hour archives.
|
* Adds the items to the trail items array for hour archives.
|
||||||
@@ -768,9 +798,10 @@ class Breadcrumb_Trail {
|
|||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
|
||||||
// Add the hour item.
|
// Add the hour item.
|
||||||
if ( true === $this->args['show_title'] )
|
if ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'sophia-after-dark' ) ) );
|
$this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'sophia-after-dark' ) ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for day archives.
|
* Adds the items to the trail items array for day archives.
|
||||||
@@ -794,12 +825,13 @@ class Breadcrumb_Trail {
|
|||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
||||||
|
|
||||||
// Add the day item.
|
// Add the day item.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $day;
|
$this->items[] = $day;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for week archives.
|
* Adds the items to the trail items array for week archives.
|
||||||
@@ -821,12 +853,25 @@ class Breadcrumb_Trail {
|
|||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
||||||
|
|
||||||
// Add the week item.
|
// Add the week item.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false ) );
|
$this->items[] = esc_url(
|
||||||
|
get_archives_link(
|
||||||
|
add_query_arg(
|
||||||
|
array(
|
||||||
|
'm' => get_the_time( 'Y' ),
|
||||||
|
'w' => get_the_time( 'W' ),
|
||||||
|
),
|
||||||
|
home_url()
|
||||||
|
),
|
||||||
|
$week,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $week;
|
$this->items[] = $week;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for month archives.
|
* Adds the items to the trail items array for month archives.
|
||||||
@@ -848,12 +893,13 @@ class Breadcrumb_Trail {
|
|||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
||||||
|
|
||||||
// Add the month item.
|
// Add the month item.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $month;
|
$this->items[] = $month;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for year archives.
|
* Adds the items to the trail items array for year archives.
|
||||||
@@ -871,12 +917,13 @@ class Breadcrumb_Trail {
|
|||||||
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sophia-after-dark' ) ) );
|
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sophia-after-dark' ) ) );
|
||||||
|
|
||||||
// Add the year item.
|
// Add the year item.
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $year;
|
$this->items[] = $year;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for archives that don't have a more specific method
|
* Adds the items to the trail items array for archives that don't have a more specific method
|
||||||
@@ -889,12 +936,14 @@ class Breadcrumb_Trail {
|
|||||||
protected function add_default_archive_items() {
|
protected function add_default_archive_items() {
|
||||||
|
|
||||||
// If this is a date-/time-based archive, add $wp_rewrite->front to the trail.
|
// If this is a date-/time-based archive, add $wp_rewrite->front to the trail.
|
||||||
if ( is_date() || is_time() )
|
if ( is_date() || is_time() ) {
|
||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
}
|
||||||
|
|
||||||
if ( true === $this->args['show_title'] )
|
if ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $this->labels['archives'];
|
$this->items[] = $this->labels['archives'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for search results.
|
* Adds the items to the trail items array for search results.
|
||||||
@@ -905,12 +954,13 @@ class Breadcrumb_Trail {
|
|||||||
*/
|
*/
|
||||||
protected function add_search_items() {
|
protected function add_search_items() {
|
||||||
|
|
||||||
if ( is_paged() )
|
if ( is_paged() ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) );
|
||||||
|
|
||||||
elseif ( true === $this->args['show_title'] )
|
} elseif ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = sprintf( $this->labels['search'], get_search_query() );
|
$this->items[] = sprintf( $this->labels['search'], get_search_query() );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items to the trail items array for 404 pages.
|
* Adds the items to the trail items array for 404 pages.
|
||||||
@@ -921,9 +971,10 @@ class Breadcrumb_Trail {
|
|||||||
*/
|
*/
|
||||||
protected function add_404_items() {
|
protected function add_404_items() {
|
||||||
|
|
||||||
if ( true === $this->args['show_title'] )
|
if ( true === $this->args['show_title'] ) {
|
||||||
$this->items[] = $this->labels['error_404'];
|
$this->items[] = $this->labels['error_404'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a specific post's parents to the items array.
|
* Adds a specific post's parents to the items array.
|
||||||
@@ -942,15 +993,17 @@ class Breadcrumb_Trail {
|
|||||||
$post = get_post( $post_id );
|
$post = get_post( $post_id );
|
||||||
|
|
||||||
// If we hit a page that's set as the front page, bail.
|
// If we hit a page that's set as the front page, bail.
|
||||||
if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) )
|
if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the formatted post link to the array of parents.
|
// Add the formatted post link to the array of parents.
|
||||||
$parents[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
$parents[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
||||||
|
|
||||||
// If there's no longer a post parent, break out of the loop.
|
// If there's no longer a post parent, break out of the loop.
|
||||||
if ( 0 >= $post->post_parent )
|
if ( 0 >= $post->post_parent ) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Change the post ID to the parent post to continue looping.
|
// Change the post ID to the parent post to continue looping.
|
||||||
$post_id = $post->post_parent;
|
$post_id = $post->post_parent;
|
||||||
@@ -960,8 +1013,9 @@ class Breadcrumb_Trail {
|
|||||||
$this->add_post_hierarchy( $post_id );
|
$this->add_post_hierarchy( $post_id );
|
||||||
|
|
||||||
// Display terms for specific post type taxonomy if requested.
|
// Display terms for specific post type taxonomy if requested.
|
||||||
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) )
|
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) {
|
||||||
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
||||||
|
}
|
||||||
|
|
||||||
// Merge the parent items into the items array.
|
// Merge the parent items into the items array.
|
||||||
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
||||||
@@ -996,13 +1050,15 @@ class Breadcrumb_Trail {
|
|||||||
elseif ( false !== $post_type_object->rewrite ) {
|
elseif ( false !== $post_type_object->rewrite ) {
|
||||||
|
|
||||||
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
||||||
if ( $post_type_object->rewrite['with_front'] )
|
if ( $post_type_object->rewrite['with_front'] ) {
|
||||||
$this->add_rewrite_front_items();
|
$this->add_rewrite_front_items();
|
||||||
|
}
|
||||||
|
|
||||||
// If there's a path, check for parents.
|
// If there's a path, check for parents.
|
||||||
if ( ! empty( $post_type_object->rewrite['slug'] ) )
|
if ( ! empty( $post_type_object->rewrite['slug'] ) ) {
|
||||||
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If there's an archive page, add it to the trail.
|
// If there's an archive page, add it to the trail.
|
||||||
if ( $post_type_object->has_archive ) {
|
if ( $post_type_object->has_archive ) {
|
||||||
@@ -1017,9 +1073,10 @@ class Breadcrumb_Trail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Map the rewrite tags if there's a `%` in the slug.
|
// Map the rewrite tags if there's a `%` in the slug.
|
||||||
if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) )
|
if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) ) {
|
||||||
$this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] );
|
$this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets post types by slug. This is needed because the get_post_types() function doesn't exactly
|
* Gets post types by slug. This is needed because the get_post_types() function doesn't exactly
|
||||||
@@ -1038,9 +1095,10 @@ class Breadcrumb_Trail {
|
|||||||
|
|
||||||
foreach ( $post_types as $type ) {
|
foreach ( $post_types as $type ) {
|
||||||
|
|
||||||
if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) )
|
if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) {
|
||||||
$return[] = $type;
|
$return[] = $type;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
@@ -1066,17 +1124,19 @@ class Breadcrumb_Trail {
|
|||||||
if ( $terms && ! is_wp_error( $terms ) ) {
|
if ( $terms && ! is_wp_error( $terms ) ) {
|
||||||
|
|
||||||
// Sort the terms by ID and get the first category.
|
// Sort the terms by ID and get the first category.
|
||||||
if ( function_exists( 'wp_list_sort' ) )
|
if ( function_exists( 'wp_list_sort' ) ) {
|
||||||
$terms = wp_list_sort( $terms, 'term_id' );
|
$terms = wp_list_sort( $terms, 'term_id' );
|
||||||
|
|
||||||
else
|
} else {
|
||||||
usort( $terms, '_usort_terms_by_ID' );
|
usort( $terms, '_usort_terms_by_ID' );
|
||||||
|
}
|
||||||
|
|
||||||
$term = get_term( $terms[0], $taxonomy );
|
$term = get_term( $terms[0], $taxonomy );
|
||||||
|
|
||||||
// If the category has a parent, add the hierarchy to the trail.
|
// If the category has a parent, add the hierarchy to the trail.
|
||||||
if ( 0 < $term->parent )
|
if ( 0 < $term->parent ) {
|
||||||
$this->add_term_parents( $term->parent, $taxonomy );
|
$this->add_term_parents( $term->parent, $taxonomy );
|
||||||
|
}
|
||||||
|
|
||||||
// Add the category archive link to the trail.
|
// Add the category archive link to the trail.
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
|
||||||
@@ -1099,21 +1159,20 @@ class Breadcrumb_Trail {
|
|||||||
$path = trim( $path, '/' );
|
$path = trim( $path, '/' );
|
||||||
|
|
||||||
// If there's no path, return.
|
// If there's no path, return.
|
||||||
if ( empty( $path ) )
|
if ( empty( $path ) ) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get parent post by the path.
|
// Get parent post by the path.
|
||||||
$post = get_page_by_path( $path );
|
$post = get_page_by_path( $path );
|
||||||
|
|
||||||
if ( ! empty( $post ) ) {
|
if ( ! empty( $post ) ) {
|
||||||
$this->add_post_parents( $post->ID );
|
$this->add_post_parents( $post->ID );
|
||||||
}
|
} elseif ( is_null( $post ) ) {
|
||||||
|
|
||||||
elseif ( is_null( $post ) ) {
|
|
||||||
|
|
||||||
// Separate post names into separate paths by '/'.
|
// Separate post names into separate paths by '/'.
|
||||||
$path = trim( $path, '/' );
|
$path = trim( $path, '/' );
|
||||||
preg_match_all( "/\/.*?\z/", $path, $matches );
|
preg_match_all( '/\/.*?\z/', $path, $matches );
|
||||||
|
|
||||||
// If matches are found for the path.
|
// If matches are found for the path.
|
||||||
if ( isset( $matches ) ) {
|
if ( isset( $matches ) ) {
|
||||||
@@ -1170,9 +1229,10 @@ class Breadcrumb_Trail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have parent terms, reverse the array to put them in the proper order for the trail.
|
// If we have parent terms, reverse the array to put them in the proper order for the trail.
|
||||||
if ( ! empty( $parents ) )
|
if ( ! empty( $parents ) ) {
|
||||||
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of
|
* Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of
|
||||||
@@ -1207,20 +1267,24 @@ class Breadcrumb_Trail {
|
|||||||
$tag = trim( $match, '/' );
|
$tag = trim( $match, '/' );
|
||||||
|
|
||||||
// If using the %year% tag, add a link to the yearly archive.
|
// If using the %year% tag, add a link to the yearly archive.
|
||||||
if ( '%year%' == $tag )
|
if ( '%year%' == $tag ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sophia-after-dark' ) ) ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sophia-after-dark' ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If using the %monthnum% tag, add a link to the monthly archive.
|
// If using the %monthnum% tag, add a link to the monthly archive.
|
||||||
elseif ( '%monthnum%' == $tag )
|
elseif ( '%monthnum%' == $tag ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'sophia-after-dark' ) ) ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'sophia-after-dark' ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If using the %day% tag, add a link to the daily archive.
|
// If using the %day% tag, add a link to the daily archive.
|
||||||
elseif ( '%day%' == $tag )
|
elseif ( '%day%' == $tag ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'sophia-after-dark' ) ) ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'sophia-after-dark' ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If using the %author% tag, add a link to the post author archive.
|
// If using the %author% tag, add a link to the post author archive.
|
||||||
elseif ( '%author%' == $tag )
|
elseif ( '%author%' == $tag ) {
|
||||||
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) );
|
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) );
|
||||||
|
}
|
||||||
|
|
||||||
// If using the %category% tag, add a link to the first category archive to match permalinks.
|
// If using the %category% tag, add a link to the first category archive to match permalinks.
|
||||||
elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) {
|
elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) {
|
||||||
50
inc/sad-dynamic-styles.php
Normal file
50
inc/sad-dynamic-styles.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?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,.sad-social-icon-wrap li a:hover,.sad-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,.btn-wrapper a: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 .sad-post-title a:hover,#sad-scrollup:hover,.menu-toggle:hover, #top-navigation ul li a:hover,.sad-search-icon:hover, .entry-meta a:hover, .front-slider-block .banner-title a:hover, .post-info-wrap .entry-meta a:hover, .single .sad-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, .sad-related-post-title::before, #colophon .widget .widget-title::before, .features-post-title::before, .sad-menu-search .sad-form-wrap .search-form .search-submit,.sad-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, .sad-menu-search .sad-form-wrap .search-form .search-submit:hover, article.sticky::before{ background: ' . esc_attr( $sophia_after_dark_primary_color ) . "}\n";
|
||||||
|
|
||||||
|
$output_css .= '.sad-menu-search .sad-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;
|
||||||
@@ -31,14 +31,14 @@ function sophia_after_dark_body_classes( $classes ) {
|
|||||||
/**
|
/**
|
||||||
* Add classes about style and sidebar layout for archive, post and page
|
* Add classes about style and sidebar layout for archive, post and page
|
||||||
*/
|
*/
|
||||||
if ( is_archive() || is_home() || is_search()) {
|
if ( is_archive() || is_home() || is_search() ) {
|
||||||
$archive_sidebar_layout = get_theme_mod( 'sophia_after_dark_archive_sidebar_layout', 'no-sidebar' );
|
$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' );
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
$classes[] = esc_attr( $archive_sidebar_layout );
|
$classes[] = esc_attr( $archive_sidebar_layout );
|
||||||
$classes[] = esc_attr( $archive_style );
|
$classes[] = esc_attr( $archive_style );
|
||||||
} elseif ( is_single() ) {
|
} elseif ( is_single() ) {
|
||||||
$single_post_sidebar_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
|
$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 ) ) {
|
if ( 'layout--default-sidebar' !== $single_post_sidebar_layout && ! empty( $single_post_sidebar_layout ) ) {
|
||||||
$classes[] = esc_attr( $single_post_sidebar_layout );
|
$classes[] = esc_attr( $single_post_sidebar_layout );
|
||||||
} else {
|
} else {
|
||||||
$posts_sidebar_layout = get_theme_mod( 'sophia_after_dark_posts_sidebar_layout', 'right-sidebar' );
|
$posts_sidebar_layout = get_theme_mod( 'sophia_after_dark_posts_sidebar_layout', 'right-sidebar' );
|
||||||
@@ -46,7 +46,7 @@ function sophia_after_dark_body_classes( $classes ) {
|
|||||||
}
|
}
|
||||||
} elseif ( is_page() ) {
|
} elseif ( is_page() ) {
|
||||||
$single_page_sidebar_layout = get_post_meta( $post->ID, 'sophia_after_dark_post_sidebar_layout', true );
|
$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 ) ) {
|
if ( 'layout--default-sidebar' !== $single_page_sidebar_layout && ! empty( $single_page_sidebar_layout ) ) {
|
||||||
$classes[] = esc_attr( $single_page_sidebar_layout );
|
$classes[] = esc_attr( $single_page_sidebar_layout );
|
||||||
} else {
|
} else {
|
||||||
$pages_sidebar_layout = get_theme_mod( 'sophia_after_dark_pages_sidebar_layout', 'right-sidebar' );
|
$pages_sidebar_layout = get_theme_mod( 'sophia_after_dark_pages_sidebar_layout', 'right-sidebar' );
|
||||||
@@ -65,7 +65,6 @@ function sophia_after_dark_pingback_header() {
|
|||||||
if ( is_singular() && pings_open() ) {
|
if ( is_singular() && pings_open() ) {
|
||||||
echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">';
|
echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
add_action( 'wp_head', 'sophia_after_dark_pingback_header' );
|
add_action( 'wp_head', 'sophia_after_dark_pingback_header' );
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------------------------------------------*/
|
||||||
@@ -125,38 +124,42 @@ function sophia_after_dark_admin_scripts( $hook ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wp_enqueue_script( 'jquery-ui-button' );
|
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_script( 'sophia-after-dark--admin-script', get_template_directory_uri() . '/assets/js/sad-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 ) );
|
wp_enqueue_style( 'sophia-after-dark--admin-style', get_template_directory_uri() . '/assets/css/sad-admin-styles.css', array(), esc_attr( $sophia_after_dark_theme_version ) );
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Enqueue scripts and styles.
|
* Enqueue scripts and styles.
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_scripts(): void {
|
function sophia_after_dark_scripts(): void {
|
||||||
$v = wp_get_theme()->get('Version');
|
$v = wp_get_theme()->get( 'Version' );
|
||||||
$dir = get_template_directory_uri();
|
$dir = get_template_directory_uri();
|
||||||
|
|
||||||
wp_enqueue_style('sophia-after-dark-fonts', sophia_after_dark_fonts_url(), [], null);
|
wp_enqueue_style( 'sophia-after-dark-fonts', sophia_after_dark_fonts_url(), array(), null );
|
||||||
wp_enqueue_style('lightslider-style', "$dir/assets/library/lightslider/css/lightslider.min.css", [], null);
|
wp_enqueue_style( 'lightslider-style', "$dir/assets/library/lightslider/css/lightslider.min.css", array(), null );
|
||||||
wp_enqueue_style('animate', "$dir/assets/library/animate/animate.min.css", [], '3.5.1');
|
wp_enqueue_style( 'animate', "$dir/assets/library/animate/animate.min.css", array(), '3.5.1' );
|
||||||
wp_enqueue_style('sophia-after-dark-style', get_stylesheet_uri(), [], $v);
|
wp_enqueue_style( 'sophia-after-dark-style', get_stylesheet_uri(), array(), $v );
|
||||||
wp_enqueue_style('sophia-after-dark-responsive-style', "$dir/assets/css/mt-responsive.css", [], $v);
|
wp_enqueue_style( 'sophia-after-dark-responsive-style', "$dir/assets/css/sad-responsive.css", array(), $v );
|
||||||
|
|
||||||
wp_enqueue_script('sophia-after-dark-combine-scripts', "$dir/assets/js/mt-combine-scripts.js", ['jquery'], $v, true);
|
wp_enqueue_script( 'sophia-after-dark-combine-scripts', "$dir/assets/js/sad-combine-scripts.js", array( 'jquery' ), $v, true );
|
||||||
wp_enqueue_script('sophia-after-dark-navigation', "$dir/assets/js/navigation.js", [], $v, true);
|
wp_enqueue_script( 'sophia-after-dark-navigation', "$dir/assets/js/navigation.js", array(), $v, true );
|
||||||
wp_enqueue_script('sophia-after-dark-skip-link-focus-fix', "$dir/assets/js/skip-link-focus-fix.js", [], $v, true);
|
wp_enqueue_script( 'sophia-after-dark-skip-link-focus-fix', "$dir/assets/js/skip-link-focus-fix.js", array(), $v, true );
|
||||||
wp_enqueue_script('sophia-after-dark-custom-scripts', "$dir/assets/js/mt-custom-scripts.js", ['jquery'], $v, true);
|
wp_enqueue_script( 'sophia-after-dark-custom-scripts', "$dir/assets/js/sad-custom-scripts.js", array( 'jquery' ), $v, true );
|
||||||
|
|
||||||
wp_localize_script('sophia-after-dark-custom-scripts', 'sophia_after_darkObject', [
|
wp_localize_script(
|
||||||
'menu_sticky' => get_theme_mod('sophia_after_dark_enable_sticky_menu', true) ? 'on' : 'off',
|
'sophia-after-dark-custom-scripts',
|
||||||
'wow_effect' => get_theme_mod('sophia_after_dark_enable_wow_animation', true) ? 'on' : 'off',
|
'sophia_after_darkObject',
|
||||||
]);
|
array(
|
||||||
|
'menu_sticky' => get_theme_mod( 'sophia_after_dark_enable_sticky_menu', true ) ? 'on' : 'off',
|
||||||
|
'wow_effect' => get_theme_mod( 'sophia_after_dark_enable_wow_animation', true ) ? 'on' : 'off',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (is_singular() && comments_open() && get_option('thread_comments')) {
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||||
wp_enqueue_script('comment-reply');
|
wp_enqueue_script( 'comment-reply' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_action('wp_enqueue_scripts', 'sophia_after_dark_scripts');
|
add_action( 'wp_enqueue_scripts', 'sophia_after_dark_scripts' );
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -170,7 +173,30 @@ if ( ! function_exists( 'sophia_after_dark_fork_awesome_social_icon_array' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_fork_awesome_social_icon_array() {
|
function sophia_after_dark_fork_awesome_social_icon_array() {
|
||||||
return 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",
|
'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',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +209,8 @@ if ( ! function_exists( 'sophia_after_dark_social_media_content' ) ) :
|
|||||||
* function to display the social icons
|
* function to display the social icons
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_social_media_content() {
|
function sophia_after_dark_social_media_content() {
|
||||||
$defaults_icons = json_encode( array(
|
$defaults_icons = json_encode(
|
||||||
|
array(
|
||||||
array(
|
array(
|
||||||
'social_icon' => 'fa fa-twitter',
|
'social_icon' => 'fa fa-twitter',
|
||||||
'social_url' => '#',
|
'social_url' => '#',
|
||||||
@@ -191,20 +218,20 @@ if ( ! function_exists( 'sophia_after_dark_social_media_content' ) ) :
|
|||||||
array(
|
array(
|
||||||
'social_icon' => 'fa fa-pinterest',
|
'social_icon' => 'fa fa-pinterest',
|
||||||
'social_url' => '#',
|
'social_url' => '#',
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$sophia_after_dark_social_icons = get_theme_mod( 'sophia_after_dark_social_icons', $defaults_icons );
|
$sophia_after_dark_social_icons = get_theme_mod( 'sophia_after_dark_social_icons', $defaults_icons );
|
||||||
$social_icons = json_decode( $sophia_after_dark_social_icons );
|
$social_icons = json_decode( $sophia_after_dark_social_icons );
|
||||||
|
|
||||||
if ( ! empty( $social_icons ) ) {
|
if ( ! empty( $social_icons ) ) {
|
||||||
?>
|
?>
|
||||||
<ul class="mt-social-icon-wrap">
|
<ul class="sad-social-icon-wrap">
|
||||||
<?php
|
<?php
|
||||||
foreach ( $social_icons as $social_icon ) {
|
foreach ( $social_icons as $social_icon ) {
|
||||||
if ( ! empty( $social_icon->social_url ) ) {
|
if ( ! empty( $social_icon->social_url ) ) {
|
||||||
?>
|
?>
|
||||||
<li class="mt-social-icon">
|
<li class="sad-social-icon">
|
||||||
<a href="<?php echo esc_url( $social_icon->social_url ); ?>" target="_blank">
|
<a href="<?php echo esc_url( $social_icon->social_url ); ?>" target="_blank">
|
||||||
<i class="<?php echo esc_attr( $social_icon->social_icon ); ?>"></i>
|
<i class="<?php echo esc_attr( $social_icon->social_icon ); ?>"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -214,7 +241,7 @@ if ( ! function_exists( 'sophia_after_dark_social_media_content' ) ) :
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,8 +262,8 @@ if ( ! function_exists( 'sophia_after_dark_hover_color' ) ) :
|
|||||||
|
|
||||||
// Normalize into a six character long hex string
|
// Normalize into a six character long hex string
|
||||||
$hex = str_replace( '#', '', $hex );
|
$hex = str_replace( '#', '', $hex );
|
||||||
if ( strlen( $hex ) == 3) {
|
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 );
|
$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
|
// Split into three parts: R, G and B
|
||||||
@@ -265,7 +292,7 @@ if ( ! function_exists( 'sophia_after_dark_select_categories_list' ) ) :
|
|||||||
$sophia_after_dark_get_categories = get_categories( array( 'hide_empty' => 0 ) );
|
$sophia_after_dark_get_categories = get_categories( array( 'hide_empty' => 0 ) );
|
||||||
$sophia_after_dark_categories_list[''] = __( 'Select Category', 'sophia-after-dark' );
|
$sophia_after_dark_categories_list[''] = __( 'Select Category', 'sophia-after-dark' );
|
||||||
foreach ( $sophia_after_dark_get_categories as $category ) {
|
foreach ( $sophia_after_dark_get_categories as $category ) {
|
||||||
$sophia_after_dark_categories_list[esc_attr( $category->slug )] = esc_html( $category->cat_name );
|
$sophia_after_dark_categories_list[ esc_attr( $category->slug ) ] = esc_html( $category->cat_name );
|
||||||
}
|
}
|
||||||
return $sophia_after_dark_categories_list;
|
return $sophia_after_dark_categories_list;
|
||||||
}
|
}
|
||||||
@@ -344,26 +371,25 @@ if ( ! function_exists( 'sophia_after_dark_css_strip_whitespace' ) ) :
|
|||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
function sophia_after_dark_css_strip_whitespace( $css ) {
|
||||||
function sophia_after_dark_css_strip_whitespace( $css ){
|
|
||||||
$replace = array(
|
$replace = array(
|
||||||
"#/\*.*?\*/#s" => "", // Strip C style comments.
|
'#/\*.*?\*/#s' => '', // Strip C style comments.
|
||||||
"#\s\s+#" => " ", // Strip excess whitespace.
|
'#\s\s+#' => ' ', // Strip excess whitespace.
|
||||||
);
|
);
|
||||||
$search = array_keys( $replace );
|
$search = array_keys( $replace );
|
||||||
$css = preg_replace( $search, $replace, $css );
|
$css = preg_replace( $search, $replace, $css );
|
||||||
|
|
||||||
$replace = array(
|
$replace = array(
|
||||||
": " => ":",
|
': ' => ':',
|
||||||
"; " => ";",
|
'; ' => ';',
|
||||||
" {" => "{",
|
' {' => '{',
|
||||||
" }" => "}",
|
' }' => '}',
|
||||||
", " => ",",
|
', ' => ',',
|
||||||
"{ " => "{",
|
'{ ' => '{',
|
||||||
";}" => "}", // Strip optional semicolons.
|
';}' => '}', // Strip optional semicolons.
|
||||||
",\n" => ",", // Don't wrap multiple selectors.
|
",\n" => ',', // Don't wrap multiple selectors.
|
||||||
"\n}" => "}", // Don't wrap closing braces.
|
"\n}" => '}', // Don't wrap closing braces.
|
||||||
"} " => "}\n", // Put each rule on it's own line.
|
'} ' => "}\n", // Put each rule on it's own line.
|
||||||
);
|
);
|
||||||
$search = array_keys( $replace );
|
$search = array_keys( $replace );
|
||||||
$css = str_replace( $search, $replace, $css );
|
$css = str_replace( $search, $replace, $css );
|
||||||
@@ -377,7 +403,6 @@ endif;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Archive title prefix
|
* Archive title prefix
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
$archive_title_prefix_option = get_theme_mod( 'sophia_after_dark_enable_archive_title_prefix', true );
|
$archive_title_prefix_option = get_theme_mod( 'sophia_after_dark_enable_archive_title_prefix', true );
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ if ( ! function_exists( 'sophia_after_dark_posted_on' ) ) :
|
|||||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
$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,
|
$time_string = sprintf(
|
||||||
|
$time_string,
|
||||||
esc_attr( get_the_date( DATE_W3C ) ),
|
esc_attr( get_the_date( DATE_W3C ) ),
|
||||||
esc_html( get_the_date() ),
|
esc_html( get_the_date() ),
|
||||||
esc_attr( get_the_modified_date( DATE_W3C ) ),
|
esc_attr( get_the_modified_date( DATE_W3C ) ),
|
||||||
@@ -33,7 +34,6 @@ if ( ! function_exists( 'sophia_after_dark_posted_on' ) ) :
|
|||||||
);
|
);
|
||||||
|
|
||||||
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.
|
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@@ -47,8 +47,7 @@ if ( ! function_exists( 'sophia_after_dark_posted_by' ) ) :
|
|||||||
*/
|
*/
|
||||||
function sophia_after_dark_posted_by() {
|
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.
|
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;
|
endif;
|
||||||
@@ -104,7 +103,6 @@ if ( ! function_exists( 'sophia_after_dark_entry_footer' ) ) :
|
|||||||
|
|
||||||
$sophia_after_dark_archive_read_more = get_theme_mod( 'sophia_after_dark_archive_read_more', __( 'Discover', 'sophia-after-dark' ) );
|
$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
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +179,7 @@ if ( ! function_exists( 'sophia_after_dark_post_thumbnail' ) ) :
|
|||||||
$current_post = $wp_query->current_post;
|
$current_post = $wp_query->current_post;
|
||||||
|
|
||||||
$thumbnail_size = 'post-thumbnail';
|
$thumbnail_size = 'post-thumbnail';
|
||||||
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
$sidebar_layout = sophia_after_dark_is_sidebar_layout();
|
$sidebar_layout = sophia_after_dark_is_sidebar_layout();
|
||||||
|
|
||||||
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
|
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
|
||||||
@@ -189,9 +187,9 @@ if ( ! function_exists( 'sophia_after_dark_post_thumbnail' ) ) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// define image size in various section
|
// define image size in various section
|
||||||
if ( 'mt-archive--masonry-style' === $archive_style ) {
|
if ( 'sad-archive--masonry-style' === $archive_style ) {
|
||||||
$thumbnail_size = 'sophia-after-dark-post-auto';
|
$thumbnail_size = 'sophia-after-dark-post-auto';
|
||||||
}elseif ( 'mt-archive--block-grid-style' === $archive_style ) {
|
} elseif ( 'sad-archive--block-grid-style' === $archive_style ) {
|
||||||
$thumbnail_size = 'sophia-after-dark-full-width';
|
$thumbnail_size = 'sophia-after-dark-full-width';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,11 +204,16 @@ if ( ! function_exists( 'sophia_after_dark_post_thumbnail' ) ) :
|
|||||||
|
|
||||||
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
|
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
|
||||||
<?php
|
<?php
|
||||||
the_post_thumbnail( $thumbnail_size, array(
|
the_post_thumbnail(
|
||||||
'alt' => the_title_attribute( array(
|
$thumbnail_size,
|
||||||
|
array(
|
||||||
|
'alt' => the_title_attribute(
|
||||||
|
array(
|
||||||
'echo' => false,
|
'echo' => false,
|
||||||
) ),
|
)
|
||||||
) );
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@@ -231,7 +234,7 @@ if ( ! function_exists( 'sophia_after_dark_article_categories_list' ) ) :
|
|||||||
global $post;
|
global $post;
|
||||||
$post_id = $post->ID;
|
$post_id = $post->ID;
|
||||||
$categories_list = get_the_category( $post_id );
|
$categories_list = get_the_category( $post_id );
|
||||||
if ( !empty( $categories_list ) ) {
|
if ( ! empty( $categories_list ) ) {
|
||||||
?>
|
?>
|
||||||
<div class="post-cats-list">
|
<div class="post-cats-list">
|
||||||
<?php
|
<?php
|
||||||
@@ -244,7 +247,8 @@ if ( ! function_exists( 'sophia_after_dark_article_categories_list' ) ) :
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div><?php
|
</div>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +259,7 @@ endif;
|
|||||||
* Add cat id in menu class
|
* Add cat id in menu class
|
||||||
*/
|
*/
|
||||||
function sophia_after_dark_category_nav_class( $classes, $item ) {
|
function sophia_after_dark_category_nav_class( $classes, $item ) {
|
||||||
if ( 'category' == $item->object ){
|
if ( 'category' == $item->object ) {
|
||||||
$category = get_category( $item->object_id );
|
$category = get_category( $item->object_id );
|
||||||
$classes[] = 'cbd-cat-' . $category->term_id;
|
$classes[] = 'cbd-cat-' . $category->term_id;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,104 +0,0 @@
|
|||||||
<?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 );
|
|
||||||
}
|
|
||||||
@@ -1,609 +0,0 @@
|
|||||||
/*====================================
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
.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.
|
Before Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
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' );
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,880 +0,0 @@
|
|||||||
<?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 ’ 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>
|
|
||||||
<?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>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<?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>
|
|
||||||
|
|
||||||
<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 → 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 → Home', 'sophia-after-dark' ) : esc_html_e( 'Go to Dashboard', 'sophia-after-dark' ); ?></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?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>
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?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>
|
|
||||||
</div>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?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 😃!', '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">★★★★★</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>
|
|
||||||
</div>
|
|
||||||
<?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();
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
<?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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
<?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>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
<?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>
|
|
||||||
</div>
|
|
||||||
<?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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
<?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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
<?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
|
|
||||||
168
inc/widgets/sad-author-info.php
Normal file
168
inc/widgets/sad-author-info.php
Normal 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="sad-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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?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 sad-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 sad-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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
179
inc/widgets/sad-latest-posts.php
Normal file
179
inc/widgets/sad-latest-posts.php
Normal 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="sad-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="sad-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="sad-single-post-wrap">
|
||||||
|
<?php if ( has_post_thumbnail() ) { ?>
|
||||||
|
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||||
|
<figure><div class="sad-post-thumb"><?php the_post_thumbnail( 'thumbnail' ); ?></div></figure>
|
||||||
|
</a>
|
||||||
|
<?php } ?>
|
||||||
|
<div class="sad-post-content">
|
||||||
|
<h5 class="sad-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>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?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 sad-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 sad-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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
128
inc/widgets/sad-social-media.php
Normal file
128
inc/widgets/sad-social-media.php
Normal 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="sad-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="sad-social-icons-wrapper">
|
||||||
|
<?php sophia_after_dark_social_media_content(); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?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 sad-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 sad-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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
155
inc/widgets/sad-widget-fields.php
Normal file
155
inc/widgets/sad-widget-fields.php
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<?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 sad-clearfix">
|
||||||
|
<button type="button" class="button sad-delete-button align-left"><?php esc_html_e( 'Remove', 'sophia-after-dark' ); ?></button>
|
||||||
|
<button type="button" class="button sad-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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
90
inc/widgets/sad-widget-functions.php
Normal file
90
inc/widgets/sad-widget-functions.php
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<?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/sad-widget-fields.php'; // Widget fields
|
||||||
|
require get_template_directory() . '/inc/widgets/sad-author-info.php'; // Author Info
|
||||||
|
require get_template_directory() . '/inc/widgets/sad-latest-posts.php'; // Latest Posts
|
||||||
|
require get_template_directory() . '/inc/widgets/sad-social-media.php'; // Social Media
|
||||||
30
index.php
30
index.php
@@ -17,45 +17,45 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
|
|
||||||
$archive_style = get_theme_mod('sophia_after_dark_archive_style', 'mt-archive--masonry-style');
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="mt-page-content-wrapper">
|
<div class="sad-page-content-wrapper">
|
||||||
<div itemscope id="primary" class="content-area">
|
<div itemscope id="primary" class="content-area">
|
||||||
<main id="main" class="site-main">
|
<main id="main" class="site-main">
|
||||||
|
|
||||||
<?php if ('mt-archive--block-grid-style' === $archive_style): ?>
|
<?php if ( 'sad-archive--block-grid-style' === $archive_style ) : ?>
|
||||||
<div class="archive-grid-post-wrapper">
|
<div class="archive-grid-post-wrapper">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (have_posts()): ?>
|
<?php if ( have_posts() ) : ?>
|
||||||
|
|
||||||
<?php if ('mt-archive--masonry-style' === $archive_style): ?>
|
<?php if ( 'sad-archive--masonry-style' === $archive_style ) : ?>
|
||||||
<div class="sophia-after-dark-content-masonry">
|
<div class="sophia-after-dark-content-masonry">
|
||||||
<div id="mt-masonry">
|
<div id="sad-masonry">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
while (have_posts()):
|
while ( have_posts() ) :
|
||||||
the_post();
|
the_post();
|
||||||
get_template_part('template-parts/content', get_post_format());
|
get_template_part( 'template-parts/content', get_post_format() );
|
||||||
endwhile;
|
endwhile;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ('mt-archive--masonry-style' === $archive_style): ?>
|
<?php if ( 'sad-archive--masonry-style' === $archive_style ) : ?>
|
||||||
</div> <!-- #mt-masonry -->
|
</div>
|
||||||
</div> <!-- .sophia-after-dark-content-masonry -->
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php the_posts_pagination(); ?>
|
<?php the_posts_pagination(); ?>
|
||||||
|
|
||||||
<?php else: ?>
|
<?php else : ?>
|
||||||
<?php get_template_part('template-parts/content', 'none'); ?>
|
<?php get_template_part( 'template-parts/content', 'none' ); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ('mt-archive--block-grid-style' === $archive_style): ?>
|
<?php if ( 'sad-archive--block-grid-style' === $archive_style ) : ?>
|
||||||
</div> <!-- .archive-grid-post-wrapper -->
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
8
page.php
8
page.php
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
get_header();
|
get_header();
|
||||||
?>
|
?>
|
||||||
<div class="mt-page-content-wrapper">
|
<div class="sad-page-content-wrapper">
|
||||||
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/WebPage">
|
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/WebPage">
|
||||||
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Page Content', 'sophia-after-dark' ); ?>">
|
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Page Content', 'sophia-after-dark' ); ?>">
|
||||||
|
|
||||||
@@ -31,11 +31,11 @@ get_header();
|
|||||||
endwhile;
|
endwhile;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</main><!-- #main -->
|
</main>
|
||||||
</div><!-- #primary -->
|
</div>
|
||||||
|
|
||||||
<?php get_sidebar(); ?>
|
<?php get_sidebar(); ?>
|
||||||
</div><!-- .mt-page-content-wrapper -->
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer();
|
get_footer();
|
||||||
|
|||||||
16
phpcs.xml
Normal file
16
phpcs.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset name="WordPress Theme Standards">
|
||||||
|
<description>WordPress Coding Standards</description>
|
||||||
|
<rule ref="WordPress-Core" />
|
||||||
|
<rule ref="WordPress-Docs" />
|
||||||
|
<rule ref="WordPress-Extra" />
|
||||||
|
<arg name="extensions" value="php"/>
|
||||||
|
<file>.</file>
|
||||||
|
<exclude-pattern>*/vendor/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/node_modules/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/assets/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/.git/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*.min.js</exclude-pattern>
|
||||||
|
<exclude-pattern>*.css</exclude-pattern>
|
||||||
|
<exclude-pattern>*.js</exclude-pattern>
|
||||||
|
</ruleset>
|
||||||
74
rtl.css
74
rtl.css
@@ -142,31 +142,31 @@ article.hentry .entry-footer>span{
|
|||||||
margin: 0 20px 0 5px ;
|
margin: 0 20px 0 5px ;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-wrapper{
|
.sad-column-wrapper{
|
||||||
margin-right: -3%;
|
margin-right: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-1{
|
.sad-column-1{
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-2{
|
.sad-column-2{
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-3{
|
.sad-column-3{
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-4{
|
.sad-column-4{
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-5{
|
.sad-column-5{
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
}
|
}
|
||||||
@@ -252,15 +252,15 @@ body.site-layout--boxed{
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-header-social-wrapper, .mt-header-extra-icons{
|
.sad-header-social-wrapper, .sad-header-extra-icons{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap{
|
.sad-social-icon-wrap{
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap li{
|
.sad-social-icon-wrap li{
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,40 +273,40 @@ body.site-layout--boxed{
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-search-wrapper{
|
.sad-social-search-wrapper{
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-wrapper{
|
.sad-social-wrapper{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-follow-title{
|
.sad-follow-title{
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search{
|
.sad-menu-search{
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon{
|
.sad-search-icon{
|
||||||
margin: 15px 40px 15px 0 ;
|
margin: 15px 40px 15px 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon i{
|
.sad-search-icon i{
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap{
|
.sad-menu-search .sad-form-wrap{
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form{
|
.sad-menu-search .sad-form-wrap .search-form{
|
||||||
right: 50%;
|
right: 50%;
|
||||||
margin-right: -50%;
|
margin-right: -50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close{
|
.sad-form-close{
|
||||||
left: 40px;
|
left: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ body.site-layout--boxed{
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-post-content{
|
.top-featured-post-wrap .sad-post-content{
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ body.site-layout--boxed{
|
|||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-footer .mt-readmore-btn i, .btn-wrapper a i , .mt-readmore-btn i{
|
.btn-wrapper a i {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
-webkit-transform: rotate(180deg);
|
-webkit-transform: rotate(180deg);
|
||||||
-ms-transform: rotate(180deg);
|
-ms-transform: rotate(180deg);
|
||||||
@@ -417,7 +417,7 @@ body.site-layout--boxed{
|
|||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-footer .mt-readmore-btn:hover i, .btn-wrapper a:hover i, .mt-readmore-btn:hover i{
|
.btn-wrapper a:hover i {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,37 +429,37 @@ article.sticky::before{
|
|||||||
content: "\f100";
|
content: "\f100";
|
||||||
}
|
}
|
||||||
|
|
||||||
.archive-grid-post-wrapper, .mt-archive--masonry-style .sophia-after-dark-content-masonry{
|
.archive-grid-post-wrapper, .sad-archive--masonry-style .sophia-after-dark-content-masonry{
|
||||||
margin-right: -3%;
|
margin-right: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--block-grid-style article, .mt-archive--masonry-style #mt-masonry article{
|
.sad-archive--block-grid-style article, .sad-archive--masonry-style #sad-masonry article{
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--masonry-style #mt-masonry article{
|
.sad-archive--masonry-style #sad-masonry article{
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#secondary .widget .widget-title, .mt-related-post-title, #colophon .widget .widget-title{
|
#secondary .widget .widget-title, .sad-related-post-title, #colophon .widget .widget-title{
|
||||||
padding-right: 35px;
|
padding-right: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#secondary .widget .widget-title::before, .mt-related-post-title:before, #colophon .widget .widget-title:before, .features-post-title:before{
|
#secondary .widget .widget-title::before, .sad-related-post-title:before, #colophon .widget .widget-title:before, .features-post-title:before{
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-author-box{
|
.sad-author-box{
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author__avatar{
|
.single .sad-author-box .sad-author__avatar{
|
||||||
float: right;
|
float: right;
|
||||||
margin-left: 2%;
|
margin-left: 2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author-info{
|
.single .sad-author-box .sad-author-info{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,11 +483,11 @@ article.sticky::before{
|
|||||||
left: -10px;
|
left: -10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer .mt-footer-widget-wrapper{
|
#top-footer .sad-footer-widget-wrapper{
|
||||||
margin-right: -3%;
|
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{
|
#top-footer.footer-column-one .sad-footer-widget, #top-footer.footer-column-two .sad-footer-widget, #top-footer.footer-column-three .sad-footer-widget, #top-footer.footer-column-four .sad-footer-widget{
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
}
|
}
|
||||||
@@ -504,29 +504,29 @@ article.sticky::before{
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sophia_after_dark_latest_posts .mt-single-post-wrap > a{
|
.sophia_after_dark_latest_posts .sad-single-post-wrap > a{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sophia_after_dark_latest_posts .mt-post-content{
|
.sophia_after_dark_latest_posts .sad-post-content{
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper{
|
.sad-related-posts-wrapper{
|
||||||
margin-right: -3%;
|
margin-right: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper article{
|
.sad-related-posts-wrapper article{
|
||||||
margin-right: 3%;
|
margin-right: 3%;
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mt-scrollup{
|
#sad-scrollup{
|
||||||
left: 40px;
|
left: 40px;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mt-scrollup::before{
|
#sad-scrollup::before{
|
||||||
left: -36px;
|
left: -36px;
|
||||||
padding: 3px 6px 2px 4px ;
|
padding: 3px 6px 2px 4px ;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 236 KiB |
26
search.php
26
search.php
@@ -7,23 +7,23 @@
|
|||||||
* @package Sophia After Dark
|
* @package Sophia After Dark
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
get_header();
|
get_header();
|
||||||
?>
|
?>
|
||||||
<div class="mt-page-content-wrapper">
|
<div class="sad-page-content-wrapper">
|
||||||
<section id="primary" class="content-area">
|
<section id="primary" class="content-area">
|
||||||
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Search Results', 'sophia-after-dark' ); ?>">
|
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Search Results', 'sophia-after-dark' ); ?>">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ( 'mt-archive--block-grid-style' === $archive_style ) {
|
if ( 'sad-archive--block-grid-style' === $archive_style ) {
|
||||||
echo '<div class="archive-grid-post-wrapper">';
|
echo '<div class="archive-grid-post-wrapper">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( have_posts() ) :
|
if ( have_posts() ) :
|
||||||
if ( 'mt-archive--masonry-style' === $archive_style ) :
|
if ( 'sad-archive--masonry-style' === $archive_style ) :
|
||||||
?>
|
?>
|
||||||
<div class="sophia-after-dark-content-masonry">
|
<div class="sophia-after-dark-content-masonry">
|
||||||
<div id="mt-masonry">
|
<div id="sad-masonry">
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@@ -33,10 +33,10 @@ get_header();
|
|||||||
get_template_part( 'template-parts/content', 'search' );
|
get_template_part( 'template-parts/content', 'search' );
|
||||||
endwhile;
|
endwhile;
|
||||||
|
|
||||||
if ( 'mt-archive--masonry-style' === $archive_style ) :
|
if ( 'sad-archive--masonry-style' === $archive_style ) :
|
||||||
?>
|
?>
|
||||||
</div><!-- #mt-masonry -->
|
</div>
|
||||||
</div><!-- .sophia-after-dark-content-masonry -->
|
</div>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@@ -47,16 +47,16 @@ get_header();
|
|||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ( 'mt-archive--block-grid-style' === $archive_style ) {
|
if ( 'sad-archive--block-grid-style' === $archive_style ) {
|
||||||
echo '</div><!-- .archive-grid-post-wrapper -->';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</main><!-- #main -->
|
</main>
|
||||||
</section><!-- #primary -->
|
</section>
|
||||||
|
|
||||||
<?php get_sidebar(); ?>
|
<?php get_sidebar(); ?>
|
||||||
</div><!-- .mt-page-content-wrapper -->
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer();
|
get_footer();
|
||||||
|
|||||||
@@ -23,34 +23,34 @@ if ( ! is_active_sidebar( 'footer-sidebar' ) &&
|
|||||||
$layout = get_theme_mod( 'sophia_after_dark_widget_area_layout', 'column-three' );
|
$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( $layout ); ?> mt-clearfix">
|
<div id="top-footer" class="footer-widgets-wrapper footer-<?php echo esc_attr( $layout ); ?> sad-clearfix">
|
||||||
<div class="mt-container">
|
<div class="sad-container">
|
||||||
<div class="footer-widgets-area mt-clearfix">
|
<div class="footer-widgets-area sad-clearfix">
|
||||||
<div class="mt-footer-widget-wrapper mt-column-wrapper mt-clearfix">
|
<div class="sad-footer-widget-wrapper sad-column-wrapper sad-clearfix">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Footer widget 1 (always shown)
|
// Footer widget 1 (always shown)
|
||||||
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.3s">';
|
echo '<div class="sad-footer-widget wow fadeInLeft" data-wow-duration="0.3s">';
|
||||||
dynamic_sidebar( 'footer-sidebar' );
|
dynamic_sidebar( 'footer-sidebar' );
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Footer widget 2 (shown in all but column-one layout)
|
// Footer widget 2 (shown in all but column-one layout)
|
||||||
if ( $layout !== 'column-one' ) {
|
if ( $layout !== 'column-one' ) {
|
||||||
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.6s">';
|
echo '<div class="sad-footer-widget wow fadeInLeft" data-wow-duration="0.6s">';
|
||||||
dynamic_sidebar( 'footer-sidebar-2' );
|
dynamic_sidebar( 'footer-sidebar-2' );
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Footer widget 3 (only for three or four column layouts)
|
// Footer widget 3 (only for three or four column layouts)
|
||||||
if ( in_array( $layout, [ 'column-three', 'column-four' ], true ) ) {
|
if ( in_array( $layout, array( 'column-three', 'column-four' ), true ) ) {
|
||||||
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.9s">';
|
echo '<div class="sad-footer-widget wow fadeInLeft" data-wow-duration="0.9s">';
|
||||||
dynamic_sidebar( 'footer-sidebar-3' );
|
dynamic_sidebar( 'footer-sidebar-3' );
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Footer widget 4 (only for four column layout)
|
// Footer widget 4 (only for four column layout)
|
||||||
if ( $layout === 'column-four' ) {
|
if ( $layout === 'column-four' ) {
|
||||||
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="1.2s">';
|
echo '<div class="sad-footer-widget wow fadeInLeft" data-wow-duration="1.2s">';
|
||||||
dynamic_sidebar( 'footer-sidebar-4' );
|
dynamic_sidebar( 'footer-sidebar-4' );
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
?>
|
?>
|
||||||
<div class="mt-page-content-wrapper">
|
<div class="sad-page-content-wrapper">
|
||||||
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/Article">
|
<div id="primary" class="content-area" itemscope itemtype="https://schema.org/Article">
|
||||||
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Single Post Content', 'sophia-after-dark' ); ?>">
|
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( 'Single Post Content', 'sophia-after-dark' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
@@ -34,11 +34,11 @@ get_header();
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</main><!-- #main -->
|
</main>
|
||||||
</div><!-- #primary -->
|
</div>
|
||||||
|
|
||||||
<?php get_sidebar(); ?>
|
<?php get_sidebar(); ?>
|
||||||
</div><!-- .mt-page-content-wrapper -->
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer();
|
get_footer();
|
||||||
|
|||||||
242
style.css
242
style.css
@@ -1,14 +1,14 @@
|
|||||||
/*!
|
/*!
|
||||||
Theme Name: Sophia After Dark
|
Theme Name: Sophia After Dark
|
||||||
Author: Sophia Atkinson, Mystery Themes
|
Author: Sophia Atkinson, Mystery Themes
|
||||||
Author URI: https://sophia.wtf
|
Author URI: https://sophia.wtf
|
||||||
Description: Sophia After Dark is a page builder based and colorful free blog style WordPress theme fit for writers and bloggers. With the help of live customizer option makes your site own and present your content in an attractive way. It comes up with an amazing creative blog layouts, fully RTL and translation ready, and also compatible with Gutenberg. The theme works perfectly with Elementor that helps to create a beautiful and unique website faster. As its name suggests, it added staggering variety of color and makes your site attractive and elegant.
|
Description: Sophia After Dark is a page builder based and colorful free blog style WordPress theme fit for writers and bloggers. With the help of live customizer option makes your site own and present your content in an attractive way. It comes up with an amazing creative blog layouts, fully RTL and translation ready, and also compatible with Gutenberg. The theme works perfectly with Elementor that helps to create a beautiful and unique website faster. As its name suggests, it added staggering variety of color and makes your site attractive and elegant.
|
||||||
Version: 1.4.3
|
Version: 1.5.1
|
||||||
Requires at least: 4.7
|
Requires at least: 4.7
|
||||||
Tested up to: 6.8.1
|
Tested up to: 6.8.1
|
||||||
Requires PHP: 5.2.4
|
Requires PHP: 5.2.4
|
||||||
License: GNU General Public License v3 or later
|
License: CC Attribution-ShareAlike 4.0 International
|
||||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
License URI: https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
|
||||||
Text Domain: sophia-after-dark
|
Text Domain: sophia-after-dark
|
||||||
Tags: blog, portfolio, news, one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, footer-widgets, rtl-language-support, theme-options, translation-ready
|
Tags: blog, portfolio, news, one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, footer-widgets, rtl-language-support, theme-options, translation-ready
|
||||||
|
|
||||||
@@ -599,8 +599,8 @@ Alignments
|
|||||||
Clearings
|
Clearings
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
.mt-clearfix:before,
|
.sad-clearfix:before,
|
||||||
.mt-clearfix:after,
|
.sad-clearfix:after,
|
||||||
.row:before,
|
.row:before,
|
||||||
.row:after,
|
.row:after,
|
||||||
.entry-content:before,
|
.entry-content:before,
|
||||||
@@ -613,20 +613,20 @@ Clearings
|
|||||||
.site-content:after,
|
.site-content:after,
|
||||||
.site-footer:before,
|
.site-footer:before,
|
||||||
.site-footer:after,
|
.site-footer:after,
|
||||||
.mt-container:after,
|
.sad-container:after,
|
||||||
.mt-container:before {
|
.sad-container:before {
|
||||||
content: '';
|
content: '';
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-clearfix:after,
|
.sad-clearfix:after,
|
||||||
.row:after,
|
.row:after,
|
||||||
.entry-content:after,
|
.entry-content:after,
|
||||||
.comment-content:after,
|
.comment-content:after,
|
||||||
.site-header:after,
|
.site-header:after,
|
||||||
.site-content:after,
|
.site-content:after,
|
||||||
.site-footer:after,
|
.site-footer:after,
|
||||||
.mt-container:after {
|
.sad-container:after {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,12 +648,12 @@ Clearings
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-widgets-wrapper .mt-social-icon-wrap,
|
.footer-widgets-wrapper .sad-social-icon-wrap,
|
||||||
.widget-area .mt-social-icon-wrap {
|
.widget-area .sad-social-icon-wrap {
|
||||||
float: none;
|
float: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icons-wrapper {
|
.sad-social-icons-wrapper {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1199,12 +1199,12 @@ object {
|
|||||||
Grid CSS
|
Grid CSS
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
.mt-column-wrapper {
|
.sad-column-wrapper {
|
||||||
margin-left: -3%;
|
margin-left: -3%;
|
||||||
margin-bottom: -3%;
|
margin-bottom: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-1 {
|
.sad-column-1 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -1213,7 +1213,7 @@ Grid CSS
|
|||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-2 {
|
.sad-column-2 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -1222,7 +1222,7 @@ Grid CSS
|
|||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-3 {
|
.sad-column-3 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -1231,7 +1231,7 @@ Grid CSS
|
|||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-4 {
|
.sad-column-4 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -1240,7 +1240,7 @@ Grid CSS
|
|||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-column-5 {
|
.sad-column-5 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -1581,7 +1581,7 @@ body.site-layout--boxed {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget .author-social .mt-social-icon-wrap {
|
.widget .author-social .sad-social-icon-wrap {
|
||||||
float: none;
|
float: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -1590,12 +1590,12 @@ body.site-layout--boxed {
|
|||||||
background: #0B0B0B none repeat scroll 0 0;
|
background: #0B0B0B none repeat scroll 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-container {
|
.sad-container {
|
||||||
width: 1320px;
|
width: 1320px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-hide {
|
.sad-hide {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1681,11 +1681,11 @@ Header CSS
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-live-link {
|
.sad-live-link {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-live-link a {
|
.sad-live-link a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: #D33;
|
background: #D33;
|
||||||
@@ -1694,15 +1694,15 @@ Header CSS
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-live-link a i {
|
.sad-live-link a i {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-live-link a:hover,
|
.sad-live-link a:hover,
|
||||||
.mt-live-link a:focus {
|
.sad-live-link a:focus {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) inset;
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) inset;
|
||||||
}
|
}
|
||||||
@@ -1736,44 +1736,44 @@ Header CSS
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-header-social-wrapper,
|
.sad-header-social-wrapper,
|
||||||
.mt-header-extra-icons {
|
.sad-header-extra-icons {
|
||||||
float: left;
|
float: left;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
padding: 30px 0;
|
padding: 30px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap {
|
.sad-social-icon-wrap {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap li {
|
.sad-social-icon-wrap li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap li a:hover {
|
.sad-social-icon-wrap li a:hover {
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-header-extra-icons {
|
.sad-header-extra-icons {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-header-extra-icons {
|
.sad-header-extra-icons {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-logo-row-wrapper {
|
.sad-logo-row-wrapper {
|
||||||
background: #0B0B0B;
|
background: #0B0B0B;
|
||||||
-webkit-transition: 0.3s ease;
|
-webkit-transition: 0.3s ease;
|
||||||
-o-transition: 0.3s ease;
|
-o-transition: 0.3s ease;
|
||||||
transition: 0.3s ease;
|
transition: 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-sticky .mt-logo-row-wrapper {
|
.is-sticky .sad-logo-row-wrapper {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
@@ -1785,11 +1785,11 @@ Header CSS
|
|||||||
margin: 9px 0;
|
margin: 9px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-menu-wrapper {
|
.sad-social-menu-wrapper {
|
||||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-sticky .mt-social-menu-wrapper {
|
.is-sticky .sad-social-menu-wrapper {
|
||||||
background: #0B0B0B;
|
background: #0B0B0B;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
@@ -1799,16 +1799,16 @@ Header CSS
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-search-wrapper {
|
.sad-social-search-wrapper {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-wrapper {
|
.sad-social-wrapper {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 15px 0 15px;
|
margin: 15px 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-follow-title {
|
.sad-follow-title {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -1816,19 +1816,19 @@ Header CSS
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap {
|
.sad-social-icon-wrap {
|
||||||
float: right;
|
float: right;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap li {
|
.sad-social-icon-wrap li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-social-icon-wrap li a {
|
.sad-social-icon-wrap li a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1836,11 +1836,11 @@ Header CSS
|
|||||||
Search CSS
|
Search CSS
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
.mt-menu-search {
|
.sad-menu-search {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon {
|
.sad-search-icon {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -1848,19 +1848,19 @@ Search CSS
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon a {
|
.sad-search-icon a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon:hover {
|
.sad-search-icon:hover {
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-search-icon i {
|
.sad-search-icon i {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap {
|
.sad-menu-search .sad-form-wrap {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -1878,7 +1878,7 @@ Search CSS
|
|||||||
transition: 0.5s ease;
|
transition: 0.5s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap.search-activate {
|
.sad-menu-search .sad-form-wrap.search-activate {
|
||||||
display: block;
|
display: block;
|
||||||
-webkit-transform: scale(1);
|
-webkit-transform: scale(1);
|
||||||
-ms-transform: scale(1);
|
-ms-transform: scale(1);
|
||||||
@@ -1887,7 +1887,7 @@ Search CSS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form {
|
.sad-menu-search .sad-form-wrap .search-form {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -1900,7 +1900,7 @@ Search CSS
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-field {
|
.sad-menu-search .sad-form-wrap .search-form .search-field {
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: 1px solid #ccc;
|
border-bottom: 1px solid #ccc;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@@ -1913,11 +1913,11 @@ Search CSS
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-field:focus {
|
.sad-menu-search .sad-form-wrap .search-form .search-field:focus {
|
||||||
outline: 2px solid #F5A9B8;
|
outline: 2px solid #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-menu-search .mt-form-wrap .search-form .search-submit {
|
.sad-menu-search .sad-form-wrap .search-form .search-submit {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
padding: 16px 60px;
|
padding: 16px 60px;
|
||||||
background: #F5A9B8;
|
background: #F5A9B8;
|
||||||
@@ -1930,7 +1930,7 @@ Search CSS
|
|||||||
transition: 0.3s ease;
|
transition: 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close {
|
.sad-form-close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 40px;
|
right: 40px;
|
||||||
top: 30px;
|
top: 30px;
|
||||||
@@ -1939,11 +1939,11 @@ Search CSS
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close a {
|
.sad-form-close a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-form-close:hover {
|
.sad-form-close:hover {
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2201,7 +2201,7 @@ Slider CSS
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.front-slider-wrapper .mt-container {
|
.front-slider-wrapper .sad-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
@@ -2354,11 +2354,11 @@ Slider CSS
|
|||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-single-post-wrap {
|
.top-featured-post-wrap .sad-single-post-wrap {
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-single-post-wrap:last-child {
|
.top-featured-post-wrap .sad-single-post-wrap:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2370,7 +2370,7 @@ Slider CSS
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-featured-post-wrap .mt-post-content {
|
.top-featured-post-wrap .sad-post-content {
|
||||||
float: right;
|
float: right;
|
||||||
width: 68%;
|
width: 68%;
|
||||||
}
|
}
|
||||||
@@ -2424,7 +2424,7 @@ article {
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-related-posts-wrapper .entry-title {
|
.single .sad-related-posts-wrapper .entry-title {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2453,37 +2453,32 @@ article {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.entry-content p {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.entry-content a {
|
.entry-content a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-footer .mt-readmore-btn,
|
.btn-wrapper a{
|
||||||
.btn-wrapper a,
|
|
||||||
.mt-readmore-btn {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #dfdfdf;
|
color: #dfdfdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-footer .mt-readmore-btn i,
|
.btn-wrapper a i {
|
||||||
.btn-wrapper a i,
|
|
||||||
.mt-readmore-btn i {
|
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
-webkit-transition: 0.3s ease;
|
-webkit-transition: 0.3s ease;
|
||||||
-o-transition: 0.3s ease;
|
-o-transition: 0.3s ease;
|
||||||
transition: 0.3s ease;
|
transition: 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-footer .mt-readmore-btn:hover,
|
.btn-wrapper a:hover {
|
||||||
.btn-wrapper a:hover,
|
|
||||||
.mt-readmore-btn:hover {
|
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
.btn-wrapper a:hover i {
|
||||||
.entry-footer .mt-readmore-btn:hover i,
|
|
||||||
.btn-wrapper a:hover i,
|
|
||||||
.mt-readmore-btn:hover i {
|
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2595,12 +2590,12 @@ article.page .post-thumbnail::before,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.archive-grid-post-wrapper,
|
.archive-grid-post-wrapper,
|
||||||
.mt-archive--masonry-style .sophia-after-dark-content-masonry {
|
.sad-archive--masonry-style .sophia-after-dark-content-masonry {
|
||||||
margin-left: -3%;
|
margin-left: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--block-grid-style article,
|
.sad-archive--block-grid-style article,
|
||||||
.mt-archive--masonry-style #mt-masonry article {
|
.sad-archive--masonry-style #sad-masonry article {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 47%;
|
width: 47%;
|
||||||
margin-left: 3%;
|
margin-left: 3%;
|
||||||
@@ -2608,12 +2603,12 @@ article.page .post-thumbnail::before,
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-sidebar.mt-archive--block-grid-style article,
|
.no-sidebar.sad-archive--block-grid-style article,
|
||||||
.no-sidebar.mt-archive--masonry-style #mt-masonry article {
|
.no-sidebar.sad-archive--masonry-style #sad-masonry article {
|
||||||
width: 30.33%;
|
width: 30.33%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-archive--masonry-style #mt-masonry article {
|
.sad-archive--masonry-style #sad-masonry article {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
@@ -2627,7 +2622,7 @@ Sidebar CSS
|
|||||||
}
|
}
|
||||||
|
|
||||||
#secondary .widget .widget-title,
|
#secondary .widget .widget-title,
|
||||||
.mt-related-post-title,
|
.sad-related-post-title,
|
||||||
#colophon .widget .widget-title {
|
#colophon .widget .widget-title {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -2638,7 +2633,7 @@ Sidebar CSS
|
|||||||
}
|
}
|
||||||
|
|
||||||
#secondary .widget .widget-title::before,
|
#secondary .widget .widget-title::before,
|
||||||
.mt-related-post-title:before,
|
.sad-related-post-title:before,
|
||||||
#colophon .widget .widget-title:before,
|
#colophon .widget .widget-title:before,
|
||||||
.features-post-title:before {
|
.features-post-title:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -2668,31 +2663,31 @@ Sidebar CSS
|
|||||||
Single CSS
|
Single CSS
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
.mt-author-box {
|
.sad-author-box {
|
||||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
margin-bottom: 60px;
|
margin-bottom: 60px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-author-box:after {
|
.sad-author-box:after {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author__avatar {
|
.single .sad-author-box .sad-author__avatar {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 2%;
|
margin-right: 2%;
|
||||||
width: 18%;
|
width: 18%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author-info {
|
.single .sad-author-box .sad-author-info {
|
||||||
float: left;
|
float: left;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .author-title {
|
.single .sad-author-box .author-title {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@@ -2700,13 +2695,13 @@ Single CSS
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author-info .mt-author-name {
|
.single .sad-author-box .sad-author-info .sad-author-name {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single .mt-author-box .mt-author-info .mt-author-name a {
|
.single .sad-author-box .sad-author-info .sad-author-name a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2774,7 +2769,7 @@ Custom Header styles
|
|||||||
padding: 30px 0;
|
padding: 30px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-header.has-bg-img .mt-container {
|
.custom-header.has-bg-img .sad-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
@@ -2820,7 +2815,7 @@ Custom Header styles
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#breadcrumb .mt-container {
|
#breadcrumb .sad-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -2845,14 +2840,14 @@ Footer CSS
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer .mt-footer-widget-wrapper {
|
#top-footer .sad-footer-widget-wrapper {
|
||||||
margin-left: -3%;
|
margin-left: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-one .mt-footer-widget,
|
#top-footer.footer-column-one .sad-footer-widget,
|
||||||
#top-footer.footer-column-two .mt-footer-widget,
|
#top-footer.footer-column-two .sad-footer-widget,
|
||||||
#top-footer.footer-column-three .mt-footer-widget,
|
#top-footer.footer-column-three .sad-footer-widget,
|
||||||
#top-footer.footer-column-four .mt-footer-widget {
|
#top-footer.footer-column-four .sad-footer-widget {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 2.85%;
|
margin-left: 2.85%;
|
||||||
width: 29%;
|
width: 29%;
|
||||||
@@ -2861,15 +2856,15 @@ Footer CSS
|
|||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-one .mt-footer-widget {
|
#top-footer.footer-column-one .sad-footer-widget {
|
||||||
width: 97%;
|
width: 97%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-two .mt-footer-widget {
|
#top-footer.footer-column-two .sad-footer-widget {
|
||||||
width: 47%;
|
width: 47%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-footer.footer-column-four .mt-footer-widget {
|
#top-footer.footer-column-four .sad-footer-widget {
|
||||||
width: 22%;
|
width: 22%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2919,7 +2914,7 @@ Footer CSS
|
|||||||
float: center;
|
float: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-info .mt-disclaimer-text {
|
.site-info .sad-disclaimer-text {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2950,11 +2945,11 @@ sophia-after-dark Widget CSS
|
|||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-social .mt-social-icon-wrap {
|
.author-social .sad-social-icon-wrap {
|
||||||
float: none;
|
float: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-social .mt-social-icon-wrap li a {
|
.author-social .sad-social-icon-wrap li a {
|
||||||
background: #212121;
|
background: #212121;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -2965,38 +2960,38 @@ sophia-after-dark Widget CSS
|
|||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-single-post-wrap>a {
|
.sad-latest-posts-wrapper .sad-single-post-wrap>a {
|
||||||
float: left;
|
float: left;
|
||||||
width: 27%;
|
width: 27%;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-post-thumb {
|
.sad-latest-posts-wrapper .sad-post-thumb {
|
||||||
border: 1px solid #e1e1e1;
|
border: 1px solid #e1e1e1;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-single-post-wrap {
|
.sad-latest-posts-wrapper .sad-single-post-wrap {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-single-post-wrap:last-child {
|
.sad-latest-posts-wrapper .sad-single-post-wrap:last-child {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-single-post-wrap::after {
|
.sad-latest-posts-wrapper .sad-single-post-wrap::after {
|
||||||
clear: both;
|
clear: both;
|
||||||
display: block;
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-post-content {
|
.sad-latest-posts-wrapper .sad-post-content {
|
||||||
float: right;
|
float: right;
|
||||||
width: 67%;
|
width: 67%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-post-title a {
|
.sad-latest-posts-wrapper .sad-post-title a {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -3004,20 +2999,15 @@ sophia-after-dark Widget CSS
|
|||||||
margin-bottom: -15px;
|
margin-bottom: -15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-post-title a:hover {
|
.sad-latest-posts-wrapper .sad-post-title a:hover {
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .entry-cat {
|
.sad-latest-posts-wrapper .entry-cat {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .mt-readmore-btn {
|
.sad-latest-posts-wrapper .tags-links {
|
||||||
margin: 0;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt-latest-posts-wrapper .tags-links {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3045,15 +3035,15 @@ sophia-after-dark Widget CSS
|
|||||||
border-color: #F5A9B8;
|
border-color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-single-related-posts {
|
.sad-single-related-posts {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper {
|
.sad-related-posts-wrapper {
|
||||||
margin-left: -3%;
|
margin-left: -3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper article {
|
.sad-related-posts-wrapper article {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 3%;
|
margin-left: 3%;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
@@ -3061,14 +3051,14 @@ sophia-after-dark Widget CSS
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-related-posts-wrapper article.no-thumbnail {
|
.sad-related-posts-wrapper article.no-thumbnail {
|
||||||
padding: 0 10px !important;
|
padding: 0 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
Scroll To Top styles
|
Scroll To Top styles
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
#mt-scrollup {
|
#sad-scrollup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 40px;
|
right: 40px;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
@@ -3090,7 +3080,7 @@ Scroll To Top styles
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mt-scrollup::before {
|
#sad-scrollup::before {
|
||||||
content: '\f178';
|
content: '\f178';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 3px;
|
top: 3px;
|
||||||
@@ -3105,7 +3095,7 @@ Scroll To Top styles
|
|||||||
transition: .5s;
|
transition: .5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mt-scrollup:hover {
|
#sad-scrollup:hover {
|
||||||
color: #F5A9B8;
|
color: #F5A9B8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,27 +13,27 @@ $author_bio = get_the_author_meta( 'description' );
|
|||||||
$author_url = get_the_author_meta( 'user_url' );
|
$author_url = get_the_author_meta( 'user_url' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="mt-author-box">
|
<div class="sad-author-box">
|
||||||
<?php if ( $author_avatar ) : ?>
|
<?php if ( $author_avatar ) : ?>
|
||||||
<div itemprop="image" class="mt-author__avatar">
|
<div itemprop="image" class="sad-author__avatar">
|
||||||
<?php echo wp_kses_post( $author_avatar ); ?>
|
<?php echo wp_kses_post( $author_avatar ); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="mt-author-info">
|
<div class="sad-author-info">
|
||||||
<?php if ( $author_post_link ) : ?>
|
<?php if ( $author_post_link ) : ?>
|
||||||
<h5 itemprop="name" class="mt-author-name"><?php echo wp_kses_post( $author_post_link ); ?></h5>
|
<h5 itemprop="name" class="sad-author-name"><?php echo wp_kses_post( $author_post_link ); ?></h5>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ( $author_bio ) : ?>
|
<?php if ( $author_bio ) : ?>
|
||||||
<div class="mt-author-bio">
|
<div class="sad-author-bio">
|
||||||
<?php echo wp_kses_post( $author_bio ); ?>
|
<?php echo wp_kses_post( $author_bio ); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ( $author_url ) : ?>
|
<?php if ( $author_url ) : ?>
|
||||||
<div class="mt-author-meta">
|
<div class="sad-author-meta">
|
||||||
<div class="mt-author-website">
|
<div class="sad-author-website">
|
||||||
<span><?php esc_html_e( 'Website', 'sophia-after-dark' ); ?>:</span>
|
<span><?php esc_html_e( 'Website', 'sophia-after-dark' ); ?>:</span>
|
||||||
<a href="<?php echo esc_url( $author_url ); ?>" target="_blank" rel="noopener noreferrer">
|
<a href="<?php echo esc_url( $author_url ); ?>" target="_blank" rel="noopener noreferrer">
|
||||||
<?php echo esc_url( $author_url ); ?>
|
<?php echo esc_url( $author_url ); ?>
|
||||||
|
|||||||
@@ -12,10 +12,12 @@
|
|||||||
<div class="entry-content">
|
<div class="entry-content">
|
||||||
<?php
|
<?php
|
||||||
the_content();
|
the_content();
|
||||||
wp_link_pages( array(
|
wp_link_pages(
|
||||||
|
array(
|
||||||
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
||||||
'after' => '</div>',
|
'after' => '</div>',
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,15 @@ $post_class = has_post_thumbnail() ? 'has-thumbnail wow fadeInUp' : 'no-thumbnai
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
<?php the_title(
|
<?php
|
||||||
|
the_title(
|
||||||
sprintf(
|
sprintf(
|
||||||
'<h2 class="entry-title"><a href="%s" rel="bookmark">',
|
'<h2 class="entry-title"><a href="%s" rel="bookmark">',
|
||||||
esc_url( get_permalink() )
|
esc_url( get_permalink() )
|
||||||
),
|
),
|
||||||
'</a></h2>'
|
'</a></h2>'
|
||||||
); ?>
|
);
|
||||||
|
?>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="entry-content">
|
<div class="entry-content">
|
||||||
@@ -44,13 +46,15 @@ $post_class = has_post_thumbnail() ? 'has-thumbnail wow fadeInUp' : 'no-thumbnai
|
|||||||
<?php the_excerpt(); ?>
|
<?php the_excerpt(); ?>
|
||||||
<?php elseif ( 'content' === $post_content_type ) : ?>
|
<?php elseif ( 'content' === $post_content_type ) : ?>
|
||||||
<?php
|
<?php
|
||||||
the_content( sprintf(
|
the_content(
|
||||||
|
sprintf(
|
||||||
wp_kses(
|
wp_kses(
|
||||||
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
||||||
[ 'span' => [ 'class' => [] ] ]
|
array( 'span' => array( 'class' => array() ) )
|
||||||
),
|
),
|
||||||
get_the_title()
|
get_the_title()
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,18 +31,22 @@ $post_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
|
|||||||
|
|
||||||
<div class="entry-content">
|
<div class="entry-content">
|
||||||
<?php
|
<?php
|
||||||
the_content( sprintf(
|
the_content(
|
||||||
|
sprintf(
|
||||||
wp_kses(
|
wp_kses(
|
||||||
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
||||||
[ 'span' => [ 'class' => [] ] ]
|
array( 'span' => array( 'class' => array() ) )
|
||||||
),
|
),
|
||||||
get_the_title()
|
get_the_title()
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
|
|
||||||
wp_link_pages( [
|
wp_link_pages(
|
||||||
|
array(
|
||||||
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
||||||
'after' => '</div>',
|
'after' => '</div>',
|
||||||
] );
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
|
|
||||||
global $wp_query;
|
global $wp_query;
|
||||||
$current_post = $wp_query->current_post;
|
$current_post = $wp_query->current_post;
|
||||||
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'mt-archive--masonry-style' );
|
$archive_style = get_theme_mod( 'sophia_after_dark_archive_style', 'sad-archive--masonry-style' );
|
||||||
$post_content_type = apply_filters( 'sophia_after_dark_archive_post_content_type', 'excerpt' );
|
$post_content_type = apply_filters( 'sophia_after_dark_archive_post_content_type', 'excerpt' );
|
||||||
|
|
||||||
// Determine post class
|
// Determine post class
|
||||||
$post_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
|
$post_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
|
||||||
if ( $current_post >= 3 || 'mt-archive--masonry-style' !== $archive_style ) {
|
if ( $current_post >= 3 || 'sad-archive--masonry-style' !== $archive_style ) {
|
||||||
$post_class .= ' wow fadeInUp';
|
$post_class .= ' wow fadeInUp';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -46,13 +46,15 @@ if ( $current_post >= 3 || 'mt-archive--masonry-style' !== $archive_style ) {
|
|||||||
if ( 'excerpt' === $post_content_type ) {
|
if ( 'excerpt' === $post_content_type ) {
|
||||||
the_excerpt();
|
the_excerpt();
|
||||||
} elseif ( 'content' === $post_content_type ) {
|
} elseif ( 'content' === $post_content_type ) {
|
||||||
the_content( sprintf(
|
the_content(
|
||||||
|
sprintf(
|
||||||
wp_kses(
|
wp_kses(
|
||||||
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
||||||
[ 'span' => [ 'class' => [] ] ]
|
array( 'span' => array( 'class' => array() ) )
|
||||||
),
|
),
|
||||||
get_the_title()
|
get_the_title()
|
||||||
) );
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$post_class = has_post_thumbnail() ? "has-thumbnail wow fadeInUp" : "no-thumbnail wow fadeInUp";
|
$post_class = has_post_thumbnail() ? 'has-thumbnail wow fadeInUp' : 'no-thumbnail wow fadeInUp';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
|
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
|
||||||
@@ -20,7 +20,7 @@ $post_class = has_post_thumbnail() ? "has-thumbnail wow fadeInUp" : "no-thumbnai
|
|||||||
<?php sophia_after_dark_article_categories_list(); ?>
|
<?php sophia_after_dark_article_categories_list(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ( "post" === get_post_type() ) : ?>
|
<?php if ( 'post' === get_post_type() ) : ?>
|
||||||
<div class="entry-cat">
|
<div class="entry-cat">
|
||||||
<?php
|
<?php
|
||||||
sophia_after_dark_posted_on();
|
sophia_after_dark_posted_on();
|
||||||
|
|||||||
@@ -8,25 +8,25 @@
|
|||||||
global $post;
|
global $post;
|
||||||
$related_post_id = get_the_ID();
|
$related_post_id = get_the_ID();
|
||||||
$get_categories = get_the_terms( $related_post_id, 'category' );
|
$get_categories = get_the_terms( $related_post_id, 'category' );
|
||||||
$selected_cat = ! empty( $get_categories ) && is_array( $get_categories ) ? wp_list_pluck( $get_categories, 'term_id' ) : [];
|
$selected_cat = ! empty( $get_categories ) && is_array( $get_categories ) ? wp_list_pluck( $get_categories, 'term_id' ) : array();
|
||||||
|
|
||||||
$related_posts_count = apply_filters( 'sophia_after_dark_related_posts_count', 3 );
|
$related_posts_count = apply_filters( 'sophia_after_dark_related_posts_count', 3 );
|
||||||
$related_posts_title = apply_filters( 'sophia_after_dark_related_posts_section_title', __( 'Related Posts', 'sophia-after-dark' ) );
|
$related_posts_title = apply_filters( 'sophia_after_dark_related_posts_section_title', __( 'Related Posts', 'sophia-after-dark' ) );
|
||||||
|
|
||||||
$related_posts_args = [
|
$related_posts_args = array(
|
||||||
'posts_per_page' => absint( $related_posts_count ),
|
'posts_per_page' => absint( $related_posts_count ),
|
||||||
'post__not_in' => [ $related_post_id ],
|
'post__not_in' => array( $related_post_id ),
|
||||||
'category__in' => $selected_cat,
|
'category__in' => $selected_cat,
|
||||||
];
|
);
|
||||||
|
|
||||||
$related_posts_query = new WP_Query( $related_posts_args );
|
$related_posts_query = new WP_Query( $related_posts_args );
|
||||||
|
|
||||||
if ( $related_posts_query->have_posts() ) :
|
if ( $related_posts_query->have_posts() ) :
|
||||||
?>
|
?>
|
||||||
<section class="mt-single-related-posts">
|
<section class="sad-single-related-posts">
|
||||||
<h2 class="mt-related-post-title"><?php echo esc_html( $related_posts_title ); ?></h2>
|
<h2 class="sad-related-post-title"><?php echo esc_html( $related_posts_title ); ?></h2>
|
||||||
|
|
||||||
<div class="mt-related-posts-wrapper">
|
<div class="sad-related-posts-wrapper">
|
||||||
<?php
|
<?php
|
||||||
while ( $related_posts_query->have_posts() ) :
|
while ( $related_posts_query->have_posts() ) :
|
||||||
$related_posts_query->the_post();
|
$related_posts_query->the_post();
|
||||||
@@ -35,7 +35,7 @@ if ( $related_posts_query->have_posts() ) :
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
|
|||||||
Reference in New Issue
Block a user