Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
aafbabb209
|
@ -6,37 +6,36 @@
|
|||||||
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
( function( $ ) {
|
(($) => {
|
||||||
|
const setText = (selector, text) => $(selector).text(text);
|
||||||
|
|
||||||
// Site title and description.
|
const setVisibility = (isVisible, color) => {
|
||||||
wp.customize( 'blogname', function( value ) {
|
const titleDesc = $('.site-title, .site-description');
|
||||||
value.bind( function( to ) {
|
const titleLink = $('.site-title a, .site-description');
|
||||||
$( '.site-title a' ).text( to );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
wp.customize( 'blogdescription', function( value ) {
|
|
||||||
value.bind( function( to ) {
|
|
||||||
$( '.site-description' ).text( to );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Header text color.
|
if (!isVisible) {
|
||||||
wp.customize( 'header_textcolor', function( value ) {
|
titleDesc.css({
|
||||||
value.bind( function( to ) {
|
clip: 'rect(1px, 1px, 1px, 1px)',
|
||||||
if ( 'blank' === to ) {
|
position: 'absolute'
|
||||||
$( '.site-title, .site-description' ).css( {
|
});
|
||||||
'clip': 'rect(1px, 1px, 1px, 1px)',
|
} else {
|
||||||
'position': 'absolute'
|
titleDesc.css({
|
||||||
} );
|
clip: 'auto',
|
||||||
} else {
|
position: 'relative'
|
||||||
$( '.site-title, .site-description' ).css( {
|
});
|
||||||
'clip': 'auto',
|
titleLink.css('color', color);
|
||||||
'position': 'relative'
|
}
|
||||||
} );
|
};
|
||||||
$( '.site-title a, .site-description' ).css( {
|
|
||||||
'color': to
|
wp.customize('blogname', (value) => {
|
||||||
} );
|
value.bind((to) => setText('.site-title a', to));
|
||||||
}
|
});
|
||||||
} );
|
|
||||||
} );
|
wp.customize('blogdescription', (value) => {
|
||||||
} )( jQuery );
|
value.bind((to) => setText('.site-description', to));
|
||||||
|
});
|
||||||
|
|
||||||
|
wp.customize('header_textcolor', (value) => {
|
||||||
|
value.bind((to) => setVisibility(to !== 'blank', to));
|
||||||
|
});
|
||||||
|
})(jQuery);
|
@ -1,73 +1,59 @@
|
|||||||
/**
|
/**
|
||||||
* Image up-loader functions
|
* Image uploader functions
|
||||||
*/
|
*/
|
||||||
var mtSelector;
|
|
||||||
function upload_media_image(mtSelector){
|
|
||||||
// ADD IMAGE LINK
|
|
||||||
jQuery('body').on( 'click', mtSelector , function( event ){
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
var imgContainer = jQuery(this).closest('.attachment-media-view').find( '.thumbnail-image'),
|
const initUploadMediaImage = (selector) => {
|
||||||
placeholder = jQuery(this).closest('.attachment-media-view').find( '.placeholder'),
|
jQuery('body').on('click', selector, function(e) {
|
||||||
imgIdInput = jQuery(this).siblings('.upload-id');
|
e.preventDefault();
|
||||||
|
|
||||||
// Create a new media frame
|
const $button = jQuery(this);
|
||||||
frame = wp.media({
|
const $mediaView = $button.closest('.attachment-media-view');
|
||||||
title: 'Select or Upload Image',
|
const $imgContainer = $mediaView.find('.thumbnail-image');
|
||||||
button: {
|
const $placeholder = $mediaView.find('.placeholder');
|
||||||
text: 'Use Image'
|
const $input = $button.siblings('.upload-id');
|
||||||
},
|
|
||||||
multiple: false // Set to true to allow multiple files to be selected
|
const frame = wp.media({
|
||||||
|
title: 'Select or Upload Image',
|
||||||
|
button: {
|
||||||
|
text: 'Use Image'
|
||||||
|
},
|
||||||
|
multiple: false
|
||||||
|
});
|
||||||
|
|
||||||
|
frame.on('select', () => {
|
||||||
|
const attachment = frame.state().get('selection').first().toJSON();
|
||||||
|
$imgContainer.html(`<img src="${attachment.url}" style="max-width:100%;" />`);
|
||||||
|
$placeholder.addClass('hidden');
|
||||||
|
$input.val(attachment.url).trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
|
frame.open();
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// When an image is selected in the media frame...
|
const initDeleteMediaImage = (selector) => {
|
||||||
frame.on( 'select', function() {
|
jQuery('body').on('click', selector, function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
// Get media attachment details from the frame state
|
const $button = jQuery(this);
|
||||||
var attachment = frame.state().get('selection').first().toJSON();
|
const $mediaView = $button.closest('.attachment-media-view');
|
||||||
|
const $imgContainer = $mediaView.find('.thumbnail-image');
|
||||||
|
const $placeholder = $mediaView.find('.placeholder');
|
||||||
|
const $input = $button.siblings('.upload-id');
|
||||||
|
|
||||||
// Send the attachment URL to our custom image input field.
|
$imgContainer.find('img').remove();
|
||||||
imgContainer.html( '<img src="'+attachment.url+'" style="max-width:100%;"/>' );
|
$placeholder.removeClass('hidden');
|
||||||
placeholder.addClass('hidden');
|
$input.val('').trigger('change');
|
||||||
imgIdInput.val( attachment.url ).trigger('change');
|
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Finally, open the modal on click
|
jQuery(($) => {
|
||||||
frame.open();
|
'use strict';
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_media_image(mtSelector){
|
// Initialize jQuery UI buttonset for radio image controls
|
||||||
// DELETE IMAGE LINK
|
$('.mt-meta-options-wrap .buttonset').buttonset();
|
||||||
jQuery('body').on( 'click', mtSelector, function( event ){
|
|
||||||
|
|
||||||
event.preventDefault();
|
// Initialize image upload/delete functionality
|
||||||
var imgContainer = jQuery(this).closest('.attachment-media-view').find( '.thumbnail-image'),
|
initUploadMediaImage('.mt-upload-button');
|
||||||
placeholder = jQuery(this).closest('.attachment-media-view').find( '.placeholder'),
|
initDeleteMediaImage('.mt-delete-button');
|
||||||
imgIdInput = jQuery(this).siblings('.upload-id');
|
|
||||||
|
|
||||||
// Clear out the preview image
|
|
||||||
imgContainer.find('img').remove();
|
|
||||||
placeholder.removeClass('hidden');
|
|
||||||
|
|
||||||
// Delete the image id from the hidden input
|
|
||||||
imgIdInput.val( '' ).trigger('change');
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
jQuery(document).ready(function($){
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Radio Image control in metabox
|
|
||||||
*/
|
|
||||||
$( '.mt-meta-options-wrap .buttonset' ).buttonset();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Image up-loader
|
|
||||||
*/
|
|
||||||
upload_media_image('.mt-upload-button');
|
|
||||||
delete_media_image('.mt-delete-button');
|
|
||||||
});
|
});
|
@ -5,60 +5,54 @@ jQuery(document).ready(function($) {
|
|||||||
/**
|
/**
|
||||||
* Sophia After Dark Preloader
|
* Sophia After Dark Preloader
|
||||||
*/
|
*/
|
||||||
if($('#preloader-background').length > 0) {
|
if ($('#preloader-background').length) {
|
||||||
setTimeout(function(){$('#preloader-background').hide();}, 600);
|
setTimeout(function() {
|
||||||
|
$('#preloader-background').hide();
|
||||||
|
}, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
var grid = document.querySelector(
|
/**
|
||||||
'.sophia-after-dark-content-masonry'
|
* Masonry grid initialization
|
||||||
),
|
*/
|
||||||
masonry;
|
const grid = document.querySelector('.sophia-after-dark-content-masonry');
|
||||||
|
if (grid && typeof Masonry !== 'undefined' && typeof imagesLoaded !== 'undefined') {
|
||||||
if (
|
imagesLoaded(grid, function() {
|
||||||
grid &&
|
new Masonry(grid, {
|
||||||
typeof Masonry !== undefined &&
|
|
||||||
typeof imagesLoaded !== undefined
|
|
||||||
) {
|
|
||||||
imagesLoaded( grid, function( instance ) {
|
|
||||||
masonry = new Masonry( grid, {
|
|
||||||
itemSelector: '.hentry'
|
itemSelector: '.hentry'
|
||||||
} );
|
});
|
||||||
} );
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header Search script
|
* Header Search script
|
||||||
*/
|
*/
|
||||||
$('.mt-menu-search .mt-search-icon').click(function() {
|
const $searchIcon = $('.mt-menu-search .mt-search-icon');
|
||||||
$('.mt-form-wrap').toggleClass('search-activate');
|
$searchIcon.click(function() {
|
||||||
$('.mt-form-wrap .search-field').focus();
|
$('.mt-form-wrap').toggleClass('search-activate').find('.search-field').focus();
|
||||||
var element = document.querySelector( '.mt-form-wrap.search-activate' );
|
const $element = $('.mt-form-wrap.search-activate');
|
||||||
if( element ) {
|
if ($element.length) {
|
||||||
$(document).on('keydown', function(e) {
|
$(document).on('keydown', function(e) {
|
||||||
var focusable = element.querySelectorAll( 'input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
|
const focusable = $element.find('input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
|
||||||
var firstFocusable = focusable[0];
|
const firstFocusable = focusable[0];
|
||||||
var lastFocusable = focusable[focusable.length - 1];
|
const lastFocusable = focusable[focusable.length - 1];
|
||||||
sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e );
|
sophia_after_dark_focus_trap(firstFocusable, lastFocusable, e);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Focus trap in popup.
|
* Focus trap in popup.
|
||||||
*/
|
*/
|
||||||
var KEYCODE_TAB = 9;
|
const KEYCODE_TAB = 9;
|
||||||
function sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e ) {
|
|
||||||
|
function sophia_after_dark_focus_trap(firstFocusable, lastFocusable, e) {
|
||||||
if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) {
|
if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) {
|
||||||
if ( e.shiftKey ) /* shift + tab */ {
|
if (e.shiftKey && document.activeElement === firstFocusable) {
|
||||||
if (document.activeElement === firstFocusable) {
|
lastFocusable.focus();
|
||||||
lastFocusable.focus();
|
e.preventDefault();
|
||||||
e.preventDefault();
|
} else if (!e.shiftKey && document.activeElement === lastFocusable) {
|
||||||
}
|
firstFocusable.focus();
|
||||||
} else /* tab */ {
|
e.preventDefault();
|
||||||
if ( document.activeElement === lastFocusable ) {
|
|
||||||
firstFocusable.focus();
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,40 +65,30 @@ jQuery(document).ready(function($) {
|
|||||||
/**
|
/**
|
||||||
* Close popups on escape key.
|
* Close popups on escape key.
|
||||||
*/
|
*/
|
||||||
$( document ).on( 'keydown', function( event ) {
|
$(document).on('keydown', function(event) {
|
||||||
if ( event.keyCode === 27 ) {
|
if (event.keyCode === 27) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
//$( '.primary-menu-wrap' ).removeClass( 'menu-active' );
|
$('.mt-menu-search .mt-form-wrap').removeClass('search-activate');
|
||||||
$( '.mt-menu-search .mt-form-wrap' ).removeClass( 'search-activate' );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings about WOW animation
|
* Settings about WOW animation
|
||||||
*/
|
*/
|
||||||
var wowOption = sophia_after_darkObject.wow_effect;
|
if (sophia_after_darkObject.wow_effect === 'on') {
|
||||||
if( wowOption === 'on' ) {
|
|
||||||
new WOW().init();
|
new WOW().init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings about sticky menu
|
* Settings about sticky menu
|
||||||
*/
|
*/
|
||||||
var stickyOption = sophia_after_darkObject.menu_sticky;
|
if (sophia_after_darkObject.menu_sticky === 'on') {
|
||||||
if( stickyOption === 'on' ) {
|
const wpAdminBar = $('#wpadminbar').length ? $('#wpadminbar') : 0;
|
||||||
var windowWidth = $( window ).width();
|
$(".mt-social-menu-wrapper").sticky({
|
||||||
if( windowWidth < 500 ) {
|
topSpacing: wpAdminBar.length ? wpAdminBar.height() : 0
|
||||||
var wpAdminBar = 0;
|
});
|
||||||
} else {
|
|
||||||
var wpAdminBar = $('#wpadminbar');
|
|
||||||
}
|
|
||||||
if ( wpAdminBar.length ) {
|
|
||||||
$(".mt-social-menu-wrapper").sticky({topSpacing:wpAdminBar.height()});
|
|
||||||
} else {
|
|
||||||
$(".mt-social-menu-wrapper").sticky({topSpacing:0});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scroll To Top
|
* Scroll To Top
|
||||||
*/
|
*/
|
||||||
@ -115,71 +99,63 @@ jQuery(document).ready(function($) {
|
|||||||
$('#mt-scrollup').fadeOut('slow');
|
$('#mt-scrollup').fadeOut('slow');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mt-scrollup').click(function() {
|
$('#mt-scrollup').click(function() {
|
||||||
$("html, body").animate({
|
$("html, body").animate({
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}, 600);
|
}, 600);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Slider scripts
|
|
||||||
*/
|
|
||||||
$('.front-slider').lightSlider({
|
|
||||||
pager: false,
|
|
||||||
auto: false,
|
|
||||||
loop: true,
|
|
||||||
item: 1,
|
|
||||||
controls: true,
|
|
||||||
slideMargin:0,
|
|
||||||
rtl:true,
|
|
||||||
nextHtml: '<span class="icon-prev"><i class="fa fa-angle-left"></i></span>',
|
|
||||||
prevHtml: '<span class="icon-next"><i class="fa fa-angle-right"></i></span>',
|
|
||||||
|
|
||||||
onSliderLoad: function() {
|
|
||||||
$('.front-slider').removeClass('cS-hidden');
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Slider scripts
|
* Slider scripts
|
||||||
*/
|
*/
|
||||||
$('.mt-gallery-slider').lightSlider({
|
function initializeSlider(selector, rtl = true) {
|
||||||
pager: false,
|
$(selector).lightSlider({
|
||||||
auto: false,
|
pager: false,
|
||||||
loop: true,
|
auto: false,
|
||||||
item: 1,
|
loop: true,
|
||||||
controls: true,
|
item: 1,
|
||||||
});
|
controls: true,
|
||||||
|
slideMargin: 0,
|
||||||
|
rtl: rtl,
|
||||||
|
nextHtml: '<span class="icon-prev"><i class="fa fa-angle-left"></i></span>',
|
||||||
|
prevHtml: '<span class="icon-next"><i class="fa fa-angle-right"></i></span>',
|
||||||
|
onSliderLoad: function() {
|
||||||
|
$(selector).removeClass('cS-hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeSlider('.front-slider');
|
||||||
|
initializeSlider('.mt-gallery-slider', false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsive menu
|
* Responsive menu
|
||||||
*/
|
*/
|
||||||
|
$('.mt-social-menu-wrapper .menu-toggle').click(function() {
|
||||||
$('.mt-social-menu-wrapper .menu-toggle').click(function(event) {
|
$('#site-navigation').toggleClass('isActive').slideToggle('slow');
|
||||||
$('.mt-social-menu-wrapper #site-navigation').toggleClass( 'isActive' ).slideToggle('slow');
|
const $element = $('.mt-header-menu-wrap');
|
||||||
var element = document.querySelector( '.mt-header-menu-wrap' );
|
if ($element.length) {
|
||||||
if( element ) {
|
|
||||||
$(document).on('keydown', function(e) {
|
$(document).on('keydown', function(e) {
|
||||||
if( element.querySelectorAll( '.mt-social-menu-wrapper #site-navigation.isActive' ).length === 1 ) {
|
if ($('#site-navigation.isActive').length) {
|
||||||
var focusable = element.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
const focusable = $element.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
||||||
var firstFocusable = focusable[0];
|
const firstFocusable = focusable[0];
|
||||||
var lastFocusable = focusable[focusable.length - 1];
|
const lastFocusable = focusable[focusable.length - 1];
|
||||||
sophia_after_dark_focus_trap( firstFocusable, lastFocusable, e );
|
sophia_after_dark_focus_trap(firstFocusable, lastFocusable, e);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* responsive sub menu toggle
|
* Responsive sub menu toggle
|
||||||
*/
|
*/
|
||||||
$('<a href="javascript:void(0);" class="sub-toggle"><i class="fa fa-angle-right"></i></a>').insertAfter('#site-navigation .menu-item-has-children>a, #site-navigation .page_item_has_children>a');
|
$('<a href="javascript:void(0);" class="sub-toggle"><i class="fa fa-angle-right"></i></a>').insertAfter('#site-navigation .menu-item-has-children>a, #site-navigation .page_item_has_children>a');
|
||||||
|
|
||||||
$('#site-navigation .sub-toggle').click(function() {
|
$('#site-navigation .sub-toggle').click(function() {
|
||||||
$(this).parent('.menu-item-has-children').children('ul.sub-menu').first().slideToggle('1000');
|
$(this).parent('.menu-item-has-children').children('ul.sub-menu').first().slideToggle(1000);
|
||||||
jQuery(this).parent('.page_item_has_children').children('ul.children').first().slideToggle('1000');
|
$(this).parent('.page_item_has_children').children('ul.children').first().slideToggle(1000);
|
||||||
$(this).children('.fa-angle-right').first().toggleClass('fa-angle-down');
|
$(this).children('.fa-angle-right').first().toggleClass('fa-angle-down');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -189,9 +165,8 @@ jQuery(document).ready(function($) {
|
|||||||
$(window).on('load', function() {
|
$(window).on('load', function() {
|
||||||
if ($(window).width() > 839) {
|
if ($(window).width() > 839) {
|
||||||
$(".front-slider-wrapper").each(function() {
|
$(".front-slider-wrapper").each(function() {
|
||||||
var imageHeight = $(this).height();
|
const imageHeight = $(this).height();
|
||||||
$(this).find(".slider-post-wrap").css('height', imageHeight);
|
$(this).find(".slider-post-wrap, .front-slider").css('height', imageHeight);
|
||||||
$(this).find(".front-slider ").css('height', imageHeight);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4,79 +4,85 @@
|
|||||||
* Handles toggling the navigation menu for small screens and enables TAB key
|
* Handles toggling the navigation menu for small screens and enables TAB key
|
||||||
* navigation support for dropdown menus.
|
* navigation support for dropdown menus.
|
||||||
*/
|
*/
|
||||||
( function() {
|
(function() {
|
||||||
var container, button, menu, links, i, len;
|
var container, button, menu, links, i, len;
|
||||||
|
|
||||||
container = document.getElementById( 'site-navigation' );
|
container = document.getElementById('site-navigation');
|
||||||
if ( ! container ) {
|
if (!container) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu = container.getElementsByTagName( 'ul' )[0];
|
menu = container.getElementsByTagName('ul')[0];
|
||||||
menu.setAttribute( 'aria-expanded', 'false' );
|
if (!menu) {
|
||||||
if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
|
return;
|
||||||
menu.className += ' nav-menu';
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Get all the link elements within the menu.
|
menu.setAttribute('aria-expanded', 'false');
|
||||||
links = menu.getElementsByTagName( 'a' );
|
|
||||||
|
|
||||||
// Each time a menu link is focused or blurred, toggle focus.
|
if (-1 === menu.className.indexOf('nav-menu')) {
|
||||||
for ( i = 0, len = links.length; i < len; i++ ) {
|
menu.className += ' nav-menu';
|
||||||
links[i].addEventListener( 'focus', toggleFocus, true );
|
}
|
||||||
links[i].addEventListener( 'blur', toggleFocus, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// Get all the link elements within the menu.
|
||||||
* Sets or removes .focus class on an element.
|
links = menu.getElementsByTagName('a');
|
||||||
*/
|
|
||||||
function toggleFocus() {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
// Move up through the ancestors of the current link until we hit .nav-menu.
|
// Each time a menu link is focused or blurred, toggle focus.
|
||||||
while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
|
for (i = 0, len = links.length; i < len; i++) {
|
||||||
|
links[i].addEventListener('focus', toggleFocus, true);
|
||||||
|
links[i].addEventListener('blur', toggleFocus, true);
|
||||||
|
}
|
||||||
|
|
||||||
// On li elements toggle the class .focus.
|
/**
|
||||||
if ( 'li' === self.tagName.toLowerCase() ) {
|
* Sets or removes .focus class on an element.
|
||||||
if ( -1 !== self.className.indexOf( 'focus' ) ) {
|
*/
|
||||||
self.className = self.className.replace( ' focus', '' );
|
function toggleFocus() {
|
||||||
} else {
|
var self = this;
|
||||||
self.className += ' focus';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self = self.parentElement;
|
// Move up through the ancestors of the current link until we hit .nav-menu.
|
||||||
}
|
while (self && -1 === self.className.indexOf('nav-menu')) {
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// On li elements toggle the class .focus.
|
||||||
* Toggles `focus` class to allow submenu access on tablets.
|
if ('li' === self.tagName.toLowerCase()) {
|
||||||
*/
|
if (-1 !== self.className.indexOf('focus')) {
|
||||||
( function( container ) {
|
self.className = self.className.replace(' focus', '');
|
||||||
var touchStartFn, i,
|
} else {
|
||||||
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
|
self.className += ' focus';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( 'ontouchstart' in window ) {
|
self = self.parentElement;
|
||||||
touchStartFn = function( e ) {
|
}
|
||||||
var menuItem = this.parentNode, i;
|
}
|
||||||
|
|
||||||
if ( ! menuItem.classList.contains( 'focus' ) ) {
|
/**
|
||||||
e.preventDefault();
|
* Toggles `focus` class to allow submenu access on tablets.
|
||||||
for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
|
*/
|
||||||
if ( menuItem === menuItem.parentNode.children[i] ) {
|
(function(container) {
|
||||||
continue;
|
var touchStartFn, i,
|
||||||
}
|
parentLink = container.querySelectorAll('.menu-item-has-children > a, .page_item_has_children > a');
|
||||||
menuItem.parentNode.children[i].classList.remove( 'focus' );
|
|
||||||
}
|
|
||||||
menuItem.classList.add( 'focus' );
|
|
||||||
} else {
|
|
||||||
menuItem.classList.remove( 'focus' );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for ( i = 0; i < parentLink.length; ++i ) {
|
if ('ontouchstart' in window) {
|
||||||
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
|
touchStartFn = function(e) {
|
||||||
}
|
var menuItem = this.parentNode,
|
||||||
}
|
j;
|
||||||
}( container ) );
|
|
||||||
} )();
|
if (!menuItem.classList.contains('focus')) {
|
||||||
|
e.preventDefault();
|
||||||
|
for (j = 0; j < menuItem.parentNode.children.length; ++j) {
|
||||||
|
if (menuItem === menuItem.parentNode.children[j]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
menuItem.parentNode.children[j].classList.remove('focus');
|
||||||
|
}
|
||||||
|
menuItem.classList.add('focus');
|
||||||
|
} else {
|
||||||
|
menuItem.classList.remove('focus');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (i = 0; i < parentLink.length; ++i) {
|
||||||
|
parentLink[i].addEventListener('touchstart', touchStartFn, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(container));
|
||||||
|
})();
|
@ -5,27 +5,27 @@
|
|||||||
*
|
*
|
||||||
* Learn more: https://git.io/vWdr2
|
* Learn more: https://git.io/vWdr2
|
||||||
*/
|
*/
|
||||||
( function() {
|
(function() {
|
||||||
var isIe = /(trident|msie)/i.test( navigator.userAgent );
|
var isIe = /(trident|msie)/i.test(navigator.userAgent);
|
||||||
|
|
||||||
if ( isIe && document.getElementById && window.addEventListener ) {
|
if (isIe && document.getElementById && window.addEventListener) {
|
||||||
window.addEventListener( 'hashchange', function() {
|
window.addEventListener('hashchange', function() {
|
||||||
var id = location.hash.substring( 1 ),
|
var id = location.hash.substring(1),
|
||||||
element;
|
element;
|
||||||
|
|
||||||
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
|
if (!(/^[A-z0-9_-]+$/.test(id))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
element = document.getElementById( id );
|
element = document.getElementById(id);
|
||||||
|
|
||||||
if ( element ) {
|
if (element) {
|
||||||
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
|
if (!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))) {
|
||||||
element.tabIndex = -1;
|
element.tabIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
element.focus();
|
element.focus();
|
||||||
}
|
}
|
||||||
}, false );
|
}, false);
|
||||||
}
|
}
|
||||||
} )();
|
})();
|
@ -71,7 +71,7 @@ do_action( 'sophia_after_dark_before_page' );
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Top Header
|
// Top Header
|
||||||
if ( get_theme_mod( 'sophia_after_dark_enable_top_header', true ) ) {
|
if ( get_theme_mod( 'sophia_after_dark_enable_top_header', false ) ) {
|
||||||
do_action( 'sophia_after_dark_top_header' );
|
do_action( 'sophia_after_dark_top_header' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,35 +20,43 @@ if ( ! is_active_sidebar( 'footer-sidebar' ) &&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sophia_after_dark_widget_area_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( $sophia_after_dark_widget_area_layout ); ?> mt-clearfix">
|
<div id="top-footer" class="footer-widgets-wrapper footer-<?php echo esc_attr( $layout ); ?> mt-clearfix">
|
||||||
<div class="mt-container">
|
<div class="mt-container">
|
||||||
<div class="footer-widgets-area mt-clearfix">
|
<div class="footer-widgets-area mt-clearfix">
|
||||||
<div class="mt-footer-widget-wrapper mt-column-wrapper mt-clearfix">
|
<div class="mt-footer-widget-wrapper mt-column-wrapper mt-clearfix">
|
||||||
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.3s">
|
|
||||||
<?php dynamic_sidebar( 'footer-sidebar' ); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ( $sophia_after_dark_widget_area_layout != 'column-one' ){ ?>
|
<?php
|
||||||
<div class="mt-footer-widget wow fadeInLeft" data-woww-duration="0.6s">
|
// Footer widget 1 (always shown)
|
||||||
<?php dynamic_sidebar( 'footer-sidebar-2' ); ?>
|
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.3s">';
|
||||||
</div>
|
dynamic_sidebar( 'footer-sidebar' );
|
||||||
<?php } ?>
|
echo '</div>';
|
||||||
|
|
||||||
<?php if ( $sophia_after_dark_widget_area_layout == 'column-three' || $sophia_after_dark_widget_area_layout == 'column-four' ){ ?>
|
// Footer widget 2 (shown in all but column-one layout)
|
||||||
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.9s">
|
if ( $layout !== 'column-one' ) {
|
||||||
<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
|
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.6s">';
|
||||||
</div>
|
dynamic_sidebar( 'footer-sidebar-2' );
|
||||||
<?php } ?>
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
<?php if ( $sophia_after_dark_widget_area_layout == 'column-four' ){ ?>
|
// Footer widget 3 (only for three or four column layouts)
|
||||||
<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="1.2s">
|
if ( in_array( $layout, [ 'column-three', 'column-four' ], true ) ) {
|
||||||
<?php dynamic_sidebar( 'footer-sidebar-4' ); ?>
|
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="0.9s">';
|
||||||
</div>
|
dynamic_sidebar( 'footer-sidebar-3' );
|
||||||
<?php } ?>
|
echo '</div>';
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
</div>
|
// Footer widget 4 (only for four column layout)
|
||||||
</div>
|
if ( $layout === 'column-four' ) {
|
||||||
|
echo '<div class="mt-footer-widget wow fadeInLeft" data-wow-duration="1.2s">';
|
||||||
|
dynamic_sidebar( 'footer-sidebar-4' );
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -3,7 +3,7 @@ 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.0
|
Version: 1.4.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
|
||||||
|
@ -8,55 +8,55 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
$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' );
|
||||||
if ( has_post_thumbnail() ) {
|
$post_class = has_post_thumbnail() ? 'has-thumbnail wow fadeInUp' : 'no-thumbnail wow fadeInUp';
|
||||||
$post_class = 'has-thumbnail wow fadeInUp';
|
|
||||||
} else {
|
|
||||||
$post_class = '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 ); ?>>
|
||||||
<?php
|
|
||||||
echo '<div class="thumb-cat-wrap">';
|
<div class="thumb-cat-wrap">
|
||||||
|
<?php
|
||||||
sophia_after_dark_post_thumbnail();
|
sophia_after_dark_post_thumbnail();
|
||||||
sophia_after_dark_article_categories_list();
|
sophia_after_dark_article_categories_list();
|
||||||
echo '</div>';
|
?>
|
||||||
if ( 'post' === get_post_type() ) {
|
</div>
|
||||||
?>
|
|
||||||
|
<?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();
|
||||||
sophia_after_dark_posted_by();
|
sophia_after_dark_posted_by();
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
|
<?php the_title(
|
||||||
|
sprintf(
|
||||||
|
'<h2 class="entry-title"><a href="%s" rel="bookmark">',
|
||||||
|
esc_url( get_permalink() )
|
||||||
|
),
|
||||||
|
'</a></h2>'
|
||||||
|
); ?>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="entry-content">
|
<div class="entry-content">
|
||||||
<?php
|
<?php if ( 'excerpt' === $post_content_type ) : ?>
|
||||||
if ( 'excerpt' === $post_content_type ) {
|
<?php the_excerpt(); ?>
|
||||||
the_excerpt();
|
<?php elseif ( 'content' === $post_content_type ) : ?>
|
||||||
} elseif ( 'content' === $post_content_type ) {
|
<?php
|
||||||
the_content( sprintf(
|
the_content( sprintf(
|
||||||
wp_kses(
|
wp_kses(
|
||||||
/* translators: %s: Name of current post. Only visible to screen readers */
|
|
||||||
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
||||||
array(
|
[ 'span' => [ 'class' => [] ] ]
|
||||||
'span' => array(
|
|
||||||
'class' => array(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
get_the_title()
|
get_the_title()
|
||||||
) );
|
) );
|
||||||
}
|
?>
|
||||||
?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="entry-footer">
|
<footer class="entry-footer">
|
||||||
<?php sophia_after_dark_entry_footer(); ?>
|
<?php sophia_after_dark_entry_footer(); ?>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
|
||||||
|
</article>
|
||||||
|
@ -8,55 +8,48 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( has_post_thumbnail() ) {
|
$post_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
|
||||||
$post_class = 'has-thumbnail';
|
|
||||||
} else {
|
|
||||||
$post_class = 'no-thumbnail';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
|
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
|
||||||
<div class="post-thumbnail">
|
|
||||||
<?php
|
|
||||||
if ( has_post_thumbnail() ) {
|
|
||||||
the_post_thumbnail( 'full' );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div class="post-info-wrap">
|
|
||||||
<div class="post-cat"><?php sophia_after_dark_article_categories_list(); ?></div>
|
|
||||||
<div class="entry-meta">
|
|
||||||
<?php
|
|
||||||
sophia_after_dark_posted_on();
|
|
||||||
sophia_after_dark_posted_by();
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<?php the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="entry-content">
|
<?php if ( has_post_thumbnail() ) : ?>
|
||||||
<?php
|
<div class="post-thumbnail">
|
||||||
the_content( sprintf(
|
<?php the_post_thumbnail( 'full' ); ?>
|
||||||
wp_kses(
|
<div class="post-info-wrap">
|
||||||
/* translators: %s: Name of current post. Only visible to screen readers */
|
<div class="post-cat"><?php sophia_after_dark_article_categories_list(); ?></div>
|
||||||
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
<div class="entry-meta">
|
||||||
array(
|
<?php
|
||||||
'span' => array(
|
sophia_after_dark_posted_on();
|
||||||
'class' => array(),
|
sophia_after_dark_posted_by();
|
||||||
),
|
?>
|
||||||
)
|
</div>
|
||||||
),
|
<?php the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); ?>
|
||||||
get_the_title()
|
</div>
|
||||||
) );
|
</div>
|
||||||
wp_link_pages( array(
|
<?php endif; ?>
|
||||||
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
|
||||||
'after' => '</div>',
|
|
||||||
) );
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer class="entry-footer">
|
<div class="entry-content">
|
||||||
<?php sophia_after_dark_entry_footer(); ?>
|
<?php
|
||||||
</footer>
|
the_content( sprintf(
|
||||||
<?php get_template_part( 'template-parts/author/post', 'author-box' ); ?>
|
wp_kses(
|
||||||
</article>
|
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'sophia-after-dark' ),
|
||||||
|
[ 'span' => [ 'class' => [] ] ]
|
||||||
|
),
|
||||||
|
get_the_title()
|
||||||
|
) );
|
||||||
|
|
||||||
|
wp_link_pages( [
|
||||||
|
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sophia-after-dark' ),
|
||||||
|
'after' => '</div>',
|
||||||
|
] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer class="entry-footer">
|
||||||
|
<?php sophia_after_dark_entry_footer(); ?>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<?php get_template_part( 'template-parts/author/post', 'author-box' ); ?>
|
||||||
|
|
||||||
|
</article>
|
||||||
|
Reference in New Issue
Block a user