diff --git a/.standard.json b/.standard.json
new file mode 100644
index 0000000..5d326d2
--- /dev/null
+++ b/.standard.json
@@ -0,0 +1 @@
+{"404.php":[],"archive-jetpack-portfolio.php":[],"archive.php":[],"attachment.php":[],"comments.php":[],"footer.php":[],"functions.php":[],"header.php":[],"inc/admin/welcome-screen/class-shapely-notify-system.php":[],"inc/admin/welcome-screen/class-shapely-welcome.php":[],"inc/admin/welcome-screen/sections/actions-required.php":[],"inc/admin/welcome-screen/sections/getting-started.php":[],"inc/admin/welcome-screen/sections/recommended-plugins.php":[],"inc/admin/welcome-screen/sections/support.php":[],"inc/class-shapely-related-posts.php":[],"inc/class-wp-bootstrap-navwalker.php":[],"inc/custom-controls/class-shapely-logo-dimensions.php":[],"inc/customizer.php":[],"inc/extras.php":[],"inc/jetpack.php":[],"inc/libraries/epsilon-framework/class-epsilon-autoloader.php":[],"inc/libraries/epsilon-framework/class-epsilon-framework.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-color-coded-categories.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-color-scheme.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-content-backup.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-customizer.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-notifications.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-notify-system.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-repeater-templates.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-sanitizers.php":[],"inc/libraries/epsilon-framework/classes/class-epsilon-typography.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-color-picker.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-color-scheme.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-customizer-navigation.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-icon-picker.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-image.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-layouts.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-repeater.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-section-repeater.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-slider.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-text-editor.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-toggle.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-typography.php":[],"inc/libraries/epsilon-framework/customizer/controls/class-epsilon-control-upsell.php":[],"inc/libraries/epsilon-framework/customizer/sections/class-epsilon-section-pro.php":[],"inc/libraries/epsilon-framework/customizer/sections/class-epsilon-section-recommended-actions.php":[],"inc/libraries/epsilon-framework/customizer/settings/class-epsilon-setting-repeater.php":[],"inc/socialnav.php":[],"inc/template-tags.php":[],"index.php":[],"page-templates/full-width.php":[],"page-templates/no-sidebar.php":[],"page-templates/sidebar-left.php":[],"page-templates/sidebar-right.php":[],"page-templates/template-home.php":[],"page.php":[],"search.php":[],"sidebar-footer.php":[],"sidebar.php":[],"single-jetpack-portfolio.php":[],"single.php":[],"template-parts/content-attachment.php":[],"template-parts/content-grid-small.php":[],"template-parts/content-grid-wide.php":[],"template-parts/content-none.php":[],"template-parts/content-page.php":[],"template-parts/content-portfolio.php":[],"template-parts/content-search.php":[],"template-parts/content.php":[],"template-parts/layouts/blog-grid.php":[],"template-parts/layouts/blog-large-image-grid.php":[],"template-parts/layouts/blog-large-image.php":[],"woocommerce.php":[],"woocommerce/product-searchform.php":[]}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index a0c1c50..94ce7a1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
sudo: false
language: php
+dist: precise
matrix:
fast_finish: true
include:
@@ -9,8 +10,9 @@ matrix:
- php: '5.6'
- php: '7.0'
- php: '7.1'
- env: SNIFF=1
- env: DEPLOY=1
+ env:
+ - DEPLOY=1
+ - SNIFF=1
before_script:
- export PHPCS_DIR=/tmp/phpcs
- export SNIFFS_DIR=/tmp/sniffs
@@ -18,7 +20,7 @@ before_script:
$PHPCS_DIR; fi
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git
$SNIFFS_DIR; fi
-- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git
+- if [[ "$SNIFF" == "1" ]]; then git clone -b 7.1.4 --depth 1 https://github.com/wimg/PHPCompatibility.git
$SNIFFS_DIR/PHPCompatibility; fi
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths
$SNIFFS_DIR; fi
@@ -51,10 +53,10 @@ script:
--standard=./phpcs.ruleset.xml --extensions=php --ignore=./node_modules/**/**/*.php;
fi
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n ./**/**/**/**/*.php
- --standard=./phpcs.ruleset.xml --extensions=php --ignore=./node_modules/**/**/**/*.php;
+ --standard=./phpcs.ruleset.xml --extensions=php --ignore=./node_modules/**/**/**/*.php,./**/**/epsilon-framework/**/*.php;
fi
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n ./**/**/**/**/**/*.php
- --standard=./phpcs.ruleset.xml --extensions=php --ignore=./node_modules/**/**/**/**/*.php;
+ --standard=./phpcs.ruleset.xml --extensions=php --ignore=./node_modules/**/**/**/**/*.php,./**/**/epsilon-framework/**/**/*.php;
fi
notifications:
email: false
diff --git a/archive-jetpack-portfolio.php b/archive-jetpack-portfolio.php
index 228b626..b331ff7 100644
--- a/archive-jetpack-portfolio.php
+++ b/archive-jetpack-portfolio.php
@@ -1,49 +1,78 @@
+get_header();
-
+$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
+$layout_class = shapely_get_layout_class();
+
+$item_classes = 'post-snippet col-md-3 col-sm-6 project';
+if ( 'mansonry' == $layout ) {
+ $item_classes .= ' masonry-item';
+}
+
+?>
+
+
-
-
+ if ( have_posts() ) :
+ ?>
-
-
-
+
+
+
'names',
);
$project_types = wp_get_post_terms( $post->ID, 'jetpack-portfolio-type', $projects_args );
+
+ $thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
+ $item_style = '';
+ if ( 'mansonry' != $layout ) {
+ $item_style = 'background-image: url(' . $thumbnail_url . ')';
+ }
?>
-
>
-
-
-
-
-
+
-
+
-
">
+
-
-
+ if ( is_home() && ! is_front_page() ) :
+ ?>
+
+ endif;
+ ?>
+ endif;
+ ?>
' ).find( '#shapely-style-' + sufix );
+ }
+
+ style.html( json.responseText );
+ }
+ });
+ });
+ });
+ }
+ }
+
+})( jQuery );
diff --git a/assets/js/customizer.js b/assets/js/customizer.js
index f34faa5..b92c866 100644
--- a/assets/js/customizer.js
+++ b/assets/js/customizer.js
@@ -1,34 +1,143 @@
(function( $ ) {// jscs:ignore validateLineBreaks
- if ( 'undefined' !== typeof( wp ) ) {
- if ( 'undefined' !== typeof( wp.customize ) ) {
- wp.customize.bind( 'preview-ready', function() {
- wp.customize.preview.bind( 'update-inline-css', function( object ) {
- var data = {
- 'action': object.action,
- 'args': object.data,
- 'id': object.id
- };
-
- jQuery.ajax({
- dataType: 'json',
- type: 'POST',
- url: WPUrls.ajaxurl,
- data: data,
- complete: function( json ) {
- var sufix = object.action + object.id;
- var style = $( '#shapely-style-' + sufix );
-
- if ( ! style.length ) {
- style = $( 'head' ).append( '' ).find( '#shapely-style-' + sufix );
- }
-
- style.html( json.responseText );
- }
- });
- });
- });
- }
- }
+ 'use strict';
+
+ var api = wp.customize;
+
+ api.shapelyLogoDimension = api.Control.extend( {
+
+ ready: function() {
+ var control = this,
+ dimensions;
+ control.logo = api.control( 'custom_logo' );
+ control.values = control.setting();
+ dimensions = control.container.find( '.shapely-dimension' );
+ control.widthElement = $( dimensions[ 0 ] );
+ control.heightElement = $( dimensions[ 1 ] );
+
+ if ( ! control.values ) {
+ control.respectRatio = 1;
+ } else {
+ control.respectRatio = control.values.ratio;
+ }
+
+ if ( undefined !== control.logo.params.attachment ) {
+ control.hasLogo = true;
+ control.logoWidth = control.logo.params.attachment.width;
+ control.logoHeight = control.logo.params.attachment.height;
+ } else {
+ control.hasLogo = false;
+ control.toggle( false );
+ }
+
+ control.logo.setting.bind( 'change', function() {
+ control.updateLogo();
+ } );
+
+ control.widthElement.keyup( function() {
+ if ( control.respectRatio && control.hasLogo ) {
+ control.calculateRatio( 'width' );
+ control.shapelyInterval = setInterval( control.updateControl, 1000, control );
+ }
+ } );
+
+ control.heightElement.keyup( function() {
+ if ( control.respectRatio && control.hasLogo ) {
+ control.calculateRatio( 'height' );
+ control.shapelyInterval = setInterval( control.updateControl, 1000, control );
+ }
+ } );
+
+ control.container.find( '.ratio input' ).change( function() {
+ var values = control.setting();
+
+ if ( ! values ) {
+ values = {};
+ }
+
+ if ( $( this ).is( ':checked' ) ) {
+ control.respectRatio = 1;
+ values.ratio = 1;
+ } else {
+ control.respectRatio = 0;
+ values.ratio = 0;
+ }
+
+ control.setting( {} );
+ control.setting( values );
+ } );
+
+ },
+
+ updateLogo: function() {
+ var control = this,
+ values = control.setting();
+ if ( undefined !== control.logo.params.attachment ) {
+
+ control.logoWidth = control.logo.params.attachment.width;
+ control.logoHeight = control.logo.params.attachment.height;
+
+ if ( ! values ) {
+ values = {
+ 'width': control.logoWidth,
+ 'height': control.logoHeight,
+ 'ratio': 1
+ };
+ } else {
+ values.width = control.logoWidth;
+ values.height = control.logoHeight;
+ }
+
+ control.widthElement.val( control.logoWidth );
+ control.heightElement.val( control.logoHeight );
+
+ control.setting( {} );
+ control.setting( values );
+
+ control.toggle( true );
+ } else {
+ control.toggle( false );
+ }
+ },
+
+ calculateRatio: function( keep ) {
+ var control = this,
+ aux;
+
+ if ( 'width' === keep ) {
+ aux = control.logoHeight * control.widthElement.val() / control.logoWidth;
+ control.heightElement.val( parseFloat( aux ).toFixed( 2 ) );
+ } else if ( 'height' === keep ) {
+ aux = control.logoWidth * control.heightElement.val() / control.logoHeight;
+ control.widthElement.val( parseFloat( aux ).toFixed( 2 ) );
+ }
+
+ clearInterval( control.shapelyInterval );
+ },
+
+ updateControl: function( control ) {
+ var values = control.setting();
+
+ if ( ! values ) {
+ values = {
+ 'width': control.widthElement.val(),
+ 'height': control.heightElement.val(),
+ 'ratio': 1
+ };
+ } else {
+ values.width = control.widthElement.val();
+ values.height = control.heightElement.val();
+ }
+ control.setting( {} );
+ control.setting( values );
+ clearInterval( control.shapelyInterval );
+ }
+
+ } );
+
+ // Extend epsilon button constructor
+ $.extend( api.controlConstructor, {
+ 'shapely-logo-dimension': api.shapelyLogoDimension
+ } );
})( jQuery );
diff --git a/assets/js/shapely-scripts.js b/assets/js/shapely-scripts.js
index 8b30e80..380e054 100644
--- a/assets/js/shapely-scripts.js
+++ b/assets/js/shapely-scripts.js
@@ -1,410 +1,503 @@
(function( $ ) {// jscs:ignore validateLineBreaks
- var clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval, shapelyCf;
-
- jQuery( document ).ready(function( $ ) {
-
- //"use strict";
-
- jQuery( '.shapely-dropdown' ).click( function( evt ) {
- evt.preventDefault();
- jQuery( this ).parent().find( '> ul' ).toggleClass( 'active' );
- });
-
- // Smooth scroll to inner links
-
- jQuery( '.inner-link' ).each(function() {
- var href = jQuery( this ).attr( 'href' );
- if ( '#' !== href.charAt( 0 ) ) {
- jQuery( this ).removeClass( 'inner-link' );
- }
- });
-
- jQuery( '.inner-link' ).click(function() {
- jQuery( 'html, body' ).animate({
- scrollTop: 0
- }, 1000 );
- return false;
- });
-
- // Append .background-image-holder
's as CSS backgrounds
-
- jQuery( '.background-image-holder' ).each(function() {
- var imgSrc = jQuery( this ).children( 'img' ).attr( 'src' );
- jQuery( this ).css( 'background', 'url("' + imgSrc + '")' );
- jQuery( this ).children( 'img' ).hide();
- jQuery( this ).css( 'background-position', 'initial' );
- });
-
- // Fade in background images
-
- setTimeout(function() {
- jQuery( '.background-image-holder' ).each(function() {
- jQuery( this ).addClass( 'fadeIn' );
- });
- }, 200 );
-
- // Fix nav to top while scrolling
-
- clNav = $( 'body .nav-container nav:first' );
- clNavOuterHeight = $( 'body .nav-container nav:first' ).outerHeight();
- windowW = jQuery( window ).width();
- if ( windowW > 991 ) {
- window.addEventListener( 'scroll', updateNav, false );
- updateNav();
- }
-
- $( window ).resize(function() {
- windowW = $( window ).width();
- if ( windowW < 992 ) {
- clNav.removeClass( 'fixed scrolled outOfSight' );
- } else {
- window.addEventListener( 'scroll', updateNav, false );
- updateNav();
- }
- });
-
- // Menu dropdown positioning
-
- $( '.menu > li > ul' ).each(function() {
- menu = $( this ).offset();
- farRight = menu.left + $( this ).outerWidth( true );
- if ( farRight > $( window ).width() && ! $( this ).hasClass( 'mega-menu' ) ) {
- $( this ).addClass( 'make-right' );
- } else if ( farRight > $( window ).width() && $( this ).hasClass( 'mega-menu' ) ) {
- isOnScreen = $( window ).width() - menu.left;
- difference = $( this ).outerWidth( true ) - isOnScreen;
- $( this ).css( 'margin-left', -( difference ) );
- }
- });
-
- // Mobile Menu
-
- $( '.mobile-toggle' ).click(function() {
- $( '.nav-bar' ).toggleClass( 'nav-open' );
- $( this ).toggleClass( 'active' );
- $( '.search-widget-handle' ).toggleClass( 'hidden-xs hidden-sm' );
- });
-
- $( '.module.widget-handle' ).click(function() {
- $( this ).toggleClass( 'toggle-search' );
- });
-
- $( '.search-widget-handle .search-form input' ).click(function( e ) {
- if ( ! e ) {
- e = window.event;
+ var clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval, shapelyCf, element, newURL, scrollToID;
+
+ jQuery( document ).ready( function( $ ) {
+
+ //"use strict";
+
+ jQuery( '.shapely-dropdown' ).click( function( evt ) {
+ evt.preventDefault();
+ jQuery( this ).parent().find( '> ul' ).toggleClass( 'active' );
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ } );
+
+ // Smooth scroll to inner links
+ jQuery( '.inner-link' ).each( function() {
+ var href = jQuery( this ).attr( 'href' );
+ if ( '#' !== href.charAt( 0 ) ) {
+ jQuery( this ).removeClass( 'inner-link' );
+ }
+ } );
+
+ // Smooth scroll
+ if ( '' !== window.location.hash ) {
+ element = $( '#site-navigation #menu a[href=' + window.location.hash + ']' );
+ if ( element ) {
+ scrollToID = '#' + element.data( 'scroll' );
+ $( 'html,body' ).animate( {
+ scrollTop: $( scrollToID ).offset().top
+ }, 2000 );
+
+ newURL = window.location.href.replace( window.location.hash, '' );
+ window.history.replaceState( {}, document.title, newURL );
+
+ }
+ }
+
+ $( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) {
+ var scrollToID = '#' + $( this ).data( 'scroll' );
+ evt.preventDefault();
+ $( 'html,body' ).animate( {
+ scrollTop: $( scrollToID ).offset().top
+ }, 2000 );
+ } );
+
+ jQuery( '.inner-link' ).click( function() {
+ jQuery( 'html, body' ).animate( {
+ scrollTop: 0
+ }, 1000 );
+ return false;
+ } );
+
+ // Append .background-image-holder
's as CSS backgrounds
+
+ jQuery( '.background-image-holder' ).each( function() {
+ var imgSrc = jQuery( this ).children( 'img' ).attr( 'src' );
+ jQuery( this ).css( 'background', 'url("' + imgSrc + '")' );
+ jQuery( this ).children( 'img' ).hide();
+ jQuery( this ).css( 'background-position', 'initial' );
+ } );
+
+ // Fade in background images
+
+ setTimeout( function() {
+ jQuery( '.background-image-holder' ).each( function() {
+ jQuery( this ).addClass( 'fadeIn' );
+ } );
+ }, 200 );
+
+ // Fix nav to top while scrolling
+
+ clNav = $( 'body .nav-container nav:first' );
+ clNavOuterHeight = $( 'body .nav-container nav:first' ).outerHeight();
+ windowW = jQuery( window ).width();
+ if ( windowW > 991 ) {
+ window.addEventListener( 'scroll', updateNav, false );
+ updateNav();
+ }
+
+ $( window ).resize( function() {
+ windowW = $( window ).width();
+ if ( windowW < 992 ) {
+ clNav.removeClass( 'fixed scrolled outOfSight' );
+ } else {
+ window.addEventListener( 'scroll', updateNav, false );
+ updateNav();
+ }
+ } );
+
+ // Menu dropdown positioning
+
+ $( '.menu > li > ul' ).each( function() {
+ menu = $( this ).offset();
+ farRight = menu.left + $( this ).outerWidth( true );
+ if ( farRight > $( window ).width() && ! $( this ).hasClass( 'mega-menu' ) ) {
+ $( this ).addClass( 'make-right' );
+ } else if ( farRight > $( window ).width() && $( this ).hasClass( 'mega-menu' ) ) {
+ isOnScreen = $( window ).width() - menu.left;
+ difference = $( this ).outerWidth( true ) - isOnScreen;
+ $( this ).css( 'margin-left', -( difference ) );
+ }
+ } );
+
+ // Mobile Menu
+
+ $( '.mobile-toggle' ).click( function() {
+ $( '.nav-bar' ).toggleClass( 'nav-open' );
+ $( this ).toggleClass( 'active' );
+ $( '.search-widget-handle' ).toggleClass( 'hidden-xs hidden-sm' );
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ } );
+
+ $( '.module.widget-handle' ).click( function() {
+ $( this ).toggleClass( 'toggle-search' );
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ } );
+
+ $( '.search-widget-handle .search-form input' ).click( function( e ) {
+ if ( ! e ) {
+ e = window.event;
+ }
+ e.stopPropagation();
+ } );
+
+ // Image Sliders
+ $( '.slider-all-controls' ).flexslider( {
+ start: function( slider ) {
+ if ( slider.find( '.slides li:first-child' ).find( '.fs-vid-background video' ).length ) {
+ slider.find( '.slides li:first-child' ).find( '.fs-vid-background video' ).get( 0 ).play();
+ }
+ },
+ after: function( slider ) {
+ if ( slider.find( '.fs-vid-background video' ).length ) {
+ if ( slider.find( 'li:not(.flex-active-slide)' ).find( '.fs-vid-background video' ).length ) {
+ slider.find( 'li:not(.flex-active-slide)' ).find( '.fs-vid-background video' ).get( 0 ).pause();
+ }
+ if ( slider.find( '.flex-active-slide' ).find( '.fs-vid-background video' ).length ) {
+ slider.find( '.flex-active-slide' ).find( '.fs-vid-background video' ).get( 0 ).play();
+ }
+ }
+ }
+ } );
+ $( '.slider-paging-controls' ).flexslider( {
+ animation: 'slide',
+ directionNav: false,
+ after: function( slider ) {
+ if ( ! slider.playing ) {
+ slider.pause();
+ slider.play();
+ slider.off( 'mouseenter mouseleave' );
+ slider.off( 'mouseover mouseout' );
+ slider.mouseover( function() {
+ if ( ! slider.manualPlay && ! slider.manualPause ) {
+ slider.pause();
}
- e.stopPropagation();
- });
-
- // Image Sliders
- $( '.slider-all-controls' ).flexslider({
- start: function( slider ) {
- if ( slider.find( '.slides li:first-child' ).find( '.fs-vid-background video' ).length ) {
- slider.find( '.slides li:first-child' ).find( '.fs-vid-background video' ).get( 0 ).play();
- }
- },
- after: function( slider ) {
- if ( slider.find( '.fs-vid-background video' ).length ) {
- if ( slider.find( 'li:not(.flex-active-slide)' ).find( '.fs-vid-background video' ).length ) {
- slider.find( 'li:not(.flex-active-slide)' ).find( '.fs-vid-background video' ).get( 0 ).pause();
- }
- if ( slider.find( '.flex-active-slide' ).find( '.fs-vid-background video' ).length ) {
- slider.find( '.flex-active-slide' ).find( '.fs-vid-background video' ).get( 0 ).play();
- }
- }
- }
- });
- $( '.slider-paging-controls' ).flexslider({
- animation: 'slide',
- directionNav: false
- });
- $( '.slider-arrow-controls' ).flexslider({
- controlNav: false
- });
- $( '.slider-thumb-controls .slides li' ).each(function() {
- var imgSrc = $( this ).find( 'img' ).attr( 'src' );
- $( this ).attr( 'data-thumb', imgSrc );
- });
- $( '.slider-thumb-controls' ).flexslider({
- animation: 'slide',
- controlNav: 'thumbnails',
- directionNav: true
- });
- $( '.logo-carousel' ).flexslider({
- minItems: 1,
- maxItems: 4,
- move: 1,
- itemWidth: 200,
- itemMargin: 0,
- animation: 'slide',
- slideshow: true,
- slideshowSpeed: 3000,
- directionNav: false,
- controlNav: false
- });
-
- // Lightbox gallery titles
- $( '.lightbox-grid li a' ).each(function() {
- var galleryTitle = $( this ).closest( '.lightbox-grid' ).attr( 'data-gallery-title' );
- $( this ).attr( 'data-lightbox', galleryTitle );
- });
-
- videos = $( '.video-widget' );
- if ( videos.length ) {
- $.each( videos, function() {
- var play = $( this ).find( '.play-button' ),
- pause = $( this ).find( '.pause-button' ),
- isYoutube = $( this ).hasClass( 'youtube' ),
- isVimeo = $( this ).hasClass( 'vimeo' ),
- videoId, mute, instance, self, autoplay, data, options, containerId, player;
-
- if ( isYoutube ) {
- videoId = $( this ).attr( 'data-video-id' );
- autoplay = parseInt( $( this ).attr( 'data-autoplay' ), 10 );
- mute = parseInt( $( this ).attr( 'data-mute' ), 10 );
- instance = $( this ).YTPlayer({
- fitToBackground: true,
- videoId: videoId,
- mute: mute,
- playerVars: {
- modestbranding: 0,
- autoplay: autoplay,
- controls: 0,
- showinfo: 0,
- branding: 0,
- rel: 0,
- autohide: 0
- }
- });
- self = $( this );
-
- $( document ).on( 'YTBGREADY', function() {
- var iframe = self.find( 'iframe' ),
- height = iframe.height();
- });
-
- $( play ).on( 'click', function( e ) {
- var parent = $( this ).parents( '.video-widget' ),
- instance = $( parent ).data( 'ytPlayer' ).player;
- e.preventDefault();
- instance.playVideo();
- });
-
- $( pause ).on( 'click', function( e ) {
- var parent = $( this ).parents( '.video-widget' ),
- instance = $( parent ).data( 'ytPlayer' ).player;
- e.preventDefault();
- instance.pauseVideo();
- });
-
- } else if ( isVimeo ) {
-
- data = jQuery( this ).data();
- options = {
- id: data.videoId,
- autoplay: data.autoplay,
- loop: 1,
- title: false,
- portrait: false,
- byline:false,
- height: jQuery( this ).height(),
- width: jQuery( this ).width()
- };
- containerId = jQuery( this ).find( '.vimeo-holder' ).attr( 'id' );
- player = new Vimeo.Player( containerId, options );
-
- if ( data.mute ) {
- player.setVolume( 0 );
- }
-
- jQuery( play ).click(function() {
- player.play();
- });
- jQuery( pause ).click(function() {
- player.pause();
- });
-
- } else {
- $( play ).on( 'click', function( e ) {
- var parent = $( this ).parents( '.video-widget' ),
- instance = $( parent ).data( 'vide' ),
- video = instance.getVideoObject();
- e.preventDefault();
- video.play();
- });
-
- $( pause ).on( 'click', function( e ) {
- var parent = $( this ).parents( '.video-widget' ),
- instance = $( parent ).data( 'vide' ),
- video = instance.getVideoObject();
- e.preventDefault();
- video.pause();
- });
- }
- });
- }
-
- recentEntries = $( '.widget_recent_entries' ).find( 'li' );
- $.each( recentEntries, function() {
- $( this ).find( 'a' ).insertAfter( $( this ).find( '.post-date' ) );
- });
-
- $( '.comment-form' ).find( 'textarea' ).insertAfter( $( '.comment-form > #url' ) );
-
- if ( 'undefined' !== typeof $.fn.owlCarousel ) {
-
- $( '.owlCarousel' ).each(function( index ) {
-
- var sliderSelector = '#owlCarousel-' + $( this ).data( 'slider-id' ); // This is the slider selector
- var sliderItems = $( this ).data( 'slider-items' );
- var sliderSpeed = $( this ).data( 'slider-speed' );
- var sliderAutoPlay = $( this ).data( 'slider-auto-play' );
- var sliderSingleItem = $( this ).data( 'slider-single-item' );
-
- //Conversion of 1 to true & 0 to false
- // auto play
- sliderAutoPlay = ! ( 0 === sliderAutoPlay || 'false' === sliderAutoPlay );
-
- // Custom Navigation events outside of the owlCarousel mark-up
- $( '.shapely-owl-next' ).on( 'click', function( event ) {
- event.preventDefault();
- $( sliderSelector ).trigger( 'next.owl.carousel' );
- });
- $( '.shapely-owl-prev' ).on( 'click', function( event ) {
- event.preventDefault();
- $( sliderSelector ).trigger( 'prev.owl.carousel' );
- });
-
- // Instantiate the slider with all the options
- $( sliderSelector ).owlCarousel({
- items: sliderItems,
- loop: false,
- margin: 2,
- autoplay: sliderAutoPlay,
- dots: false,
- autoplayTimeout: sliderSpeed * 10,
- responsive: {
- 0: {
- items: 1
- },
- 768: {
- items: sliderItems
- }
- }
- });
- });
- } // End
-
- jQuery( '#masthead .function #s' ).focus( function() {
- jQuery( this ).parents( '.function' ).addClass( 'active' );
- });
-
- jQuery( '#masthead .function #s' ).focusout( function() {
- searchInterval = setInterval(function() {
- jQuery( '#masthead .function' ).removeClass( 'active' );
- }, 500 );
- });
-
- jQuery( '#masthead .function #searchsubmit' ).focus( function() {
- clearInterval( searchInterval );
- jQuery( this ).parents( '.function' ).addClass( 'active' );
- });
-
- jQuery( '#masthead .function #searchsubmit' ).focusout( function() {
- jQuery( this ).parents( '.function' ).removeClass( 'active' );
- });
-
- // Check if is a contact form 7 with parallax background
- shapelyCf = jQuery( '.contact-section.image-bg .wpcf7' );
- if ( shapelyCf.length > 0 ) {
- shapelyCf.on( 'wpcf7submit', function() {
- setTimeout(function() {
- jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
- }, 800 );
- });
- }
-
- });
-
- jQuery( window ).load(function( $ ) {
-
- // "use strict";
- // Resetting testimonial parallax height
- var msnry, container, clFirstSectionHeight;
- if ( 0 !== jQuery( '.testimonial-section' ).length ) {
- testimonialHeight();
- setTimeout(function() {
- testimonialHeight();
- }, 3000 );
- }
-
- // Initialize Masonry
-
- if ( jQuery( '.masonry' ).length && 'undefined' !== typeof Masonry ) {
- container = document.querySelector( '.masonry' );
- msnry = new Masonry( container, {
- itemSelector: '.masonry-item'
- });
-
- msnry.on( 'layoutComplete', function( $ ) {
-
- clFirstSectionHeight = jQuery( '.main-container section:nth-of-type(1)' ).outerHeight( true );
- jQuery( '.masonry' ).addClass( 'fadeIn' );
- jQuery( '.masonry-loader' ).addClass( 'fadeOut' );
- if ( jQuery( '.masonryFlyIn' ).length ) {
- masonryFlyIn();
- }
- });
-
- msnry.layout();
- }
-
- // Navigation height
- clFirstSectionHeight = jQuery( '.main-container section:nth-of-type(1)' ).outerHeight( true );
+ } ).mouseout( function() {
+ if ( ! slider.manualPause && ! slider.manualPlay && ! slider.stopped ) {
+ slider.play();
+ }
+ } );
+ }
+ }
+ } );
+ $( '.slider-arrow-controls' ).flexslider( {
+ controlNav: false,
+ after: function( slider ) {
+ if ( ! slider.playing ) {
+ slider.pause();
+ slider.play();
+ slider.off( 'mouseenter mouseleave' );
+ slider.off( 'mouseover mouseout' );
+ slider.mouseover( function() {
+ if ( ! slider.manualPlay && ! slider.manualPause ) {
+ slider.pause();
+ }
+ } ).mouseout( function() {
+ if ( ! slider.manualPause && ! slider.manualPlay && ! slider.stopped ) {
+ slider.play();
+ }
+ } );
+ }
+ }
+ } );
+ $( '.slider-thumb-controls .slides li' ).each( function() {
+ var imgSrc = $( this ).find( 'img' ).attr( 'src' );
+ $( this ).attr( 'data-thumb', imgSrc );
+ } );
+ $( '.slider-thumb-controls' ).flexslider( {
+ animation: 'slide',
+ controlNav: 'thumbnails',
+ directionNav: true,
+ after: function( slider ) {
+ if ( ! slider.playing ) {
+ slider.pause();
+ slider.play();
+ slider.off( 'mouseenter mouseleave' );
+ slider.off( 'mouseover mouseout' );
+ slider.mouseover( function() {
+ if ( ! slider.manualPlay && ! slider.manualPause ) {
+ slider.pause();
+ }
+ } ).mouseout( function() {
+ if ( ! slider.manualPause && ! slider.manualPlay && ! slider.stopped ) {
+ slider.play();
+ }
+ } );
+ }
+ }
+ } );
+ $( '.logo-carousel' ).flexslider( {
+ minItems: 1,
+ maxItems: 4,
+ move: 1,
+ itemWidth: 200,
+ itemMargin: 0,
+ animation: 'slide',
+ slideshow: true,
+ slideshowSpeed: 3000,
+ directionNav: false,
+ controlNav: false,
+ after: function( slider ) {
+ if ( ! slider.playing ) {
+ slider.pause();
+ slider.play();
+ slider.off( 'mouseenter mouseleave' );
+ slider.off( 'mouseover mouseout' );
+ slider.mouseover( function() {
+ if ( ! slider.manualPlay && ! slider.manualPause ) {
+ slider.pause();
+ }
+ } ).mouseout( function() {
+ if ( ! slider.manualPause && ! slider.manualPlay && ! slider.stopped ) {
+ slider.play();
+ }
+ } );
+ }
+ }
+ } );
+
+ // Lightbox gallery titles
+ $( '.lightbox-grid li a' ).each( function() {
+ var galleryTitle = $( this ).closest( '.lightbox-grid' ).attr( 'data-gallery-title' );
+ $( this ).attr( 'data-lightbox', galleryTitle );
+ } );
+
+ videos = $( '.video-widget' );
+ if ( videos.length ) {
+ $.each( videos, function() {
+ var play = $( this ).find( '.play-button' ),
+ pause = $( this ).find( '.pause-button' ),
+ isYoutube = $( this ).hasClass( 'youtube' ),
+ isVimeo = $( this ).hasClass( 'vimeo' ),
+ videoId, mute, instance, self, autoplay, data, options, containerId, player;
+
+ if ( isYoutube ) {
+ videoId = $( this ).attr( 'data-video-id' );
+ autoplay = parseInt( $( this ).attr( 'data-autoplay' ), 10 );
+ mute = parseInt( $( this ).attr( 'data-mute' ), 10 );
+ instance = $( this ).YTPlayer( {
+ fitToBackground: true,
+ videoId: videoId,
+ mute: mute,
+ playerVars: {
+ modestbranding: 0,
+ autoplay: autoplay,
+ controls: 0,
+ showinfo: 0,
+ branding: 0,
+ rel: 0,
+ autohide: 0
+ }
+ } );
+ self = $( this );
+
+ $( document ).on( 'YTBGREADY', function() {
+ var iframe = self.find( 'iframe' ),
+ height = iframe.height();
+ } );
+
+ $( play ).on( 'click', function( e ) {
+ var parent = $( this ).parents( '.video-widget' ),
+ instance = $( parent ).data( 'ytPlayer' ).player;
+ e.preventDefault();
+ instance.playVideo();
+ } );
+
+ $( pause ).on( 'click', function( e ) {
+ var parent = $( this ).parents( '.video-widget' ),
+ instance = $( parent ).data( 'ytPlayer' ).player;
+ e.preventDefault();
+ instance.pauseVideo();
+ } );
+
+ } else if ( isVimeo ) {
+
+ data = jQuery( this ).data();
+ options = {
+ id: data.videoId,
+ autoplay: data.autoplay,
+ loop: 1,
+ title: false,
+ portrait: false,
+ byline: false,
+ height: jQuery( this ).height(),
+ width: jQuery( this ).width()
+ };
+ containerId = jQuery( this ).find( '.vimeo-holder' ).attr( 'id' );
+ player = new Vimeo.Player( containerId, options );
+
+ if ( data.mute ) {
+ player.setVolume( 0 );
+ }
+
+ jQuery( play ).click( function() {
+ player.play();
+ } );
+ jQuery( pause ).click( function() {
+ player.pause();
+ } );
+
+ } else {
+ $( play ).on( 'click', function( e ) {
+ var parent = $( this ).parents( '.video-widget' ),
+ instance = $( parent ).data( 'vide' ),
+ video = instance.getVideoObject();
+ e.preventDefault();
+ video.play();
+ } );
+
+ $( pause ).on( 'click', function( e ) {
+ var parent = $( this ).parents( '.video-widget' ),
+ instance = $( parent ).data( 'vide' ),
+ video = instance.getVideoObject();
+ e.preventDefault();
+ video.pause();
+ } );
+ }
+ } );
+ }
+
+ recentEntries = $( '.widget_recent_entries' ).find( 'li' );
+ $.each( recentEntries, function() {
+ $( this ).find( 'a' ).insertAfter( $( this ).find( '.post-date' ) );
+ } );
+
+ $( '.comment-form' ).find( 'textarea' ).insertAfter( $( '.comment-form > #url' ) );
+
+ if ( 'undefined' !== typeof $.fn.owlCarousel ) {
+
+ $( '.owlCarousel' ).each( function( index ) {
+
+ var sliderSelector = '#owlCarousel-' + $( this ).data( 'slider-id' ); // This is the slider selector
+ var sliderItems = $( this ).data( 'slider-items' );
+ var sliderSpeed = $( this ).data( 'slider-speed' );
+ var sliderAutoPlay = $( this ).data( 'slider-auto-play' );
+ var sliderSingleItem = $( this ).data( 'slider-single-item' );
+
+ //Conversion of 1 to true & 0 to false
+ // auto play
+ sliderAutoPlay = ! ( 0 === sliderAutoPlay || 'false' === sliderAutoPlay );
+
+ // Custom Navigation events outside of the owlCarousel mark-up
+ $( '.shapely-owl-next' ).on( 'click', function( event ) {
+ event.preventDefault();
+ $( sliderSelector ).trigger( 'next.owl.carousel' );
+ } );
+ $( '.shapely-owl-prev' ).on( 'click', function( event ) {
+ event.preventDefault();
+ $( sliderSelector ).trigger( 'prev.owl.carousel' );
+ } );
+
+ // Instantiate the slider with all the options
+ $( sliderSelector ).owlCarousel( {
+ items: sliderItems,
+ loop: false,
+ margin: 2,
+ autoplay: sliderAutoPlay,
+ dots: false,
+ autoplayTimeout: sliderSpeed * 10,
+ responsive: {
+ 0: {
+ items: 1
+ },
+ 768: {
+ items: sliderItems
+ }
+ }
+ } );
+ } );
+ } // End
+
+ jQuery( '#masthead .function #s' ).focus( function() {
+ jQuery( this ).parents( '.function' ).addClass( 'active' );
+ } );
+
+ jQuery( '#masthead .function #s' ).focusout( function() {
+ searchInterval = setInterval( function() {
+ jQuery( '#masthead .function' ).removeClass( 'active' );
+ }, 500 );
+ } );
+
+ jQuery( '#masthead .function #searchsubmit' ).focus( function() {
+ clearInterval( searchInterval );
+ jQuery( this ).parents( '.function' ).addClass( 'active' );
+ } );
+
+ jQuery( '#masthead .function #searchsubmit' ).focusout( function() {
+ jQuery( this ).parents( '.function' ).removeClass( 'active' );
+ } );
+
+ // Check if is a contact form 7 with parallax background
+ shapelyCf = jQuery( '.contact-section.image-bg .wpcf7' );
+ if ( shapelyCf.length > 0 ) {
+ shapelyCf.on( 'wpcf7submit', function() {
+ setTimeout( function() {
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ }, 800 );
+ } );
+ }
+
+ } );
+
+ jQuery( window ).load( function( $ ) {
+
+ // "use strict";
+ // Resetting testimonial parallax height
+ var msnry, container, clFirstSectionHeight;
+ if ( 0 !== jQuery( '.testimonial-section' ).length ) {
+ testimonialHeight();
+ setTimeout( function() {
+ testimonialHeight();
+ }, 3000 );
+ }
+
+ // Initialize Masonry
+
+ if ( jQuery( '.masonry' ).length && 'undefined' !== typeof Masonry ) {
+ container = document.querySelector( '.masonry' );
+ msnry = new Masonry( container, {
+ itemSelector: '.masonry-item'
+ } );
+
+ msnry.on( 'layoutComplete', function( $ ) {
- });
-
- /* Function To
- * keep menu fixed
- **/
- function updateNav() {
- var scroll = $( window ).scrollTop();
- var windowW = jQuery( window ).width();
-
- if ( windowW < 992 ) {
- return;
- }
-
- if ( scroll > clNavOuterHeight ) {
- clNav.addClass( 'outOfSight' );
- }
-
- if ( $( window ).scrollTop() > ( clNavOuterHeight + 65 ) ) {//If href = #element id
- clNav.addClass( 'fixed scrolled' );
- }
-
- if ( 0 === $( window ).scrollTop() ) {
- clNav.removeClass( 'fixed scrolled outOfSight' );
- }
- }
-
- function masonryFlyIn() {
- var $items = jQuery( '.masonryFlyIn .masonry-item' );
- var time = 0;
-
- $items.each(function() {
- var item = jQuery( this );
- setTimeout(function() {
- item.addClass( 'fadeIn' );
- }, time );
- time += 170;
- });
- }
-
- jQuery( 'body' ).imagesLoaded( function() {
- jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
- });
+ clFirstSectionHeight = jQuery( '.main-container section:nth-of-type(1)' ).outerHeight( true );
+ jQuery( '.masonry' ).addClass( 'fadeIn' );
+ jQuery( '.masonry-loader' ).addClass( 'fadeOut' );
+ if ( jQuery( '.masonryFlyIn' ).length ) {
+ masonryFlyIn();
+ }
+ } );
+
+ msnry.layout();
+ }
+
+ // Navigation height
+ clFirstSectionHeight = jQuery( '.main-container section:nth-of-type(1)' ).outerHeight( true );
+
+ } );
+
+ /* Function To
+ * keep menu fixed
+ **/
+ function updateNav() {
+ var scroll = $( window ).scrollTop();
+ var windowW = jQuery( window ).width();
+
+ if ( windowW < 992 ) {
+ return;
+ }
+
+ if ( scroll > clNavOuterHeight ) {
+ clNav.addClass( 'outOfSight' );
+ }
+
+ if ( $( window ).scrollTop() > ( clNavOuterHeight + 65 ) ) {//If href = #element id
+ clNav.addClass( 'fixed scrolled' );
+ }
+
+ if ( 0 === $( window ).scrollTop() ) {
+ clNav.removeClass( 'fixed scrolled outOfSight' );
+ }
+ }
+
+ function masonryFlyIn() {
+ var $items = jQuery( '.masonryFlyIn .masonry-item' );
+ var time = 0;
+
+ $items.each( function() {
+ var item = jQuery( this );
+ setTimeout( function() {
+ item.addClass( 'fadeIn' );
+ }, time );
+ time += 170;
+ } );
+ }
+
+ jQuery( 'body' ).imagesLoaded( function() {
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ } );
})( jQuery );
@@ -412,7 +505,7 @@
* Resetting testimonial parallax height
*/
function testimonialHeight() {
- jQuery( '.testimonial-section .parallax-window' ).css( 'height', jQuery( '.testimonial-section .parallax-window .container' ).outerHeight() + 150 );
- jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
+ jQuery( '.testimonial-section .parallax-window' ).css( 'height', jQuery( '.testimonial-section .parallax-window .container' ).outerHeight() + 150 );
+ jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
}
diff --git a/attachment.php b/attachment.php
index 152232f..5dd28f0 100644
--- a/attachment.php
+++ b/attachment.php
@@ -15,16 +15,19 @@
get_sidebar();
endif;
?>
- ">
+
+ endwhile; // End of the loop.
+ ?>
- +
- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> - +'ol', - 'short_ping' => true, + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, 'avatar_size' => 75, - 'callback' => 'shapely_cb_comment', - ) ); + 'callback' => 'shapely_cb_comment', + ) + ); ?>
- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> -', - 'after_title' => '
', - ) ); - - register_sidebar( array( - 'id' => 'sidebar-home', - 'name' => esc_html__( 'Homepage', 'shapely' ), - 'before_widget' => '', - 'after_title' => '
', - ) ); - - for ( $i = 1; $i < 5; $i ++ ) { - register_sidebar( array( - 'id' => 'footer-widget-' . $i, - 'name' => sprintf( esc_html__( 'Footer Widget %s', 'shapely' ), $i ), - 'description' => esc_html__( 'Used for footer widget area', 'shapely' ), + register_sidebar( + array( + 'id' => 'sidebar-1', + 'name' => esc_html__( 'Sidebar', 'shapely' ), 'before_widget' => '', 'after_title' => '
', - ) ); - } + ) + ); - if ( shapely_is_woocommerce_activated() ) { - register_sidebar( array( - 'id' => 'shop-sidebar', - 'name' => esc_html__( 'Shop Sidebar', 'shapely' ), + register_sidebar( + array( + 'id' => 'sidebar-home', + 'name' => esc_html__( 'Homepage', 'shapely' ), 'before_widget' => '', 'after_title' => '
', - ) ); + ) + ); + + for ( $i = 1; $i < 5; $i ++ ) { + register_sidebar( + array( + 'id' => 'footer-widget-' . $i, + 'name' => sprintf( esc_html__( 'Footer Widget %s', 'shapely' ), $i ), + 'description' => esc_html__( 'Used for footer widget area', 'shapely' ), + 'before_widget' => '', + 'after_title' => '
', + ) + ); + } + + if ( shapely_is_woocommerce_activated() ) { + register_sidebar( + array( + 'id' => 'shop-sidebar', + 'name' => esc_html__( 'Shop Sidebar', 'shapely' ), + 'before_widget' => '', + 'after_title' => '
', + ) + ); } } diff --git a/header.php b/header.php index 6dc33d3..8963e00 100644 --- a/header.php +++ b/header.php @@ -24,11 +24,11 @@+ +
- - ' . wp_kses_post( $shapely_required_action_value['help'] ); -endif; ?> + + ' . wp_kses_post( $shapely_required_action_value['help'] ); +endif; +?>
-- +
+
-
+ +
diff --git a/inc/admin/welcome-screen/sections/recommended-plugins.php b/inc/admin/welcome-screen/sections/recommended-plugins.php index e33b3c6..c3035fb 100644 --- a/inc/admin/welcome-screen/sections/recommended-plugins.php +++ b/inc/admin/welcome-screen/sections/recommended-plugins.php @@ -35,18 +35,19 @@ ?>- +
@@ -12,7 +12,7 @@
- +
diff --git a/inc/class-shapely-related-posts.php b/inc/class-shapely-related-posts.php index e8d5ac2..c1614cf 100644 --- a/inc/class-shapely-related-posts.php +++ b/inc/class-shapely-related-posts.php @@ -107,13 +107,51 @@ public function get_related_posts( $post_id, $number_posts = - 1 ) { return $related_postquery; } - $args = wp_parse_args( $args, array( - 'category__in' => wp_get_post_categories( $post_id ), - 'ignore_sticky_posts' => 0, - 'posts_per_page' => $number_posts, - 'post__not_in' => array( $post_id ), - // 'meta_key' => '_thumbnail_id', - ) ); + $args = wp_parse_args( + $args, array( + 'category__in' => wp_get_post_categories( $post_id ), + 'ignore_sticky_posts' => 0, + 'posts_per_page' => $number_posts, + 'post__not_in' => array( $post_id ), + ) + ); + + if ( is_singular( 'jetpack-portfolio' ) ) { + unset( $args['category__in'] ); + $args['post_type'] = 'jetpack-portfolio'; + + $terms_args = array( + 'fields' => 'ids', + ); + $types = wp_get_object_terms( get_the_ID(), 'jetpack-portfolio-type', $terms_args ); + $tags = wp_get_object_terms( get_the_ID(), 'jetpack-portfolio-tag', $terms_args ); + + $tax_query = array(); + + if ( ! empty( $types ) ) { + array_push( + $tax_query, array( + 'taxonomy' => 'jetpack-portfolio-type', + 'field' => 'term_id', + 'terms' => $types, + ) + ); + } + + if ( ! empty( $tags ) ) { + array_push( + $tax_query, array( + 'taxonomy' => 'jetpack-portfolio-tag', + 'field' => 'term_id', + 'terms' => $tags, + ) + ); + } + + if ( ! empty( $tax_query ) ) { + $args['tax_query'] = $tax_query; + } + } $related_postquery = new WP_Query( $args ); @@ -129,6 +167,13 @@ public function get_related_posts( $post_id, $number_posts = - 1 ) { * @return string HTML markup to display related posts **/ function output_related_posts() { + + if ( is_singular( 'jetpack-portfolio' ) ) { + if ( ! get_theme_mod( 'related_projects_area', true ) ) { + return; + } + } + // Check if related posts should be shown $related_posts = $this->get_related_posts( get_the_ID(), get_option( 'posts_per_page' ) ); @@ -150,7 +195,11 @@ function output_related_posts() { * Heading */ echo '
' . esc_html__( 'Related articles ', 'shapely' ) . '
'; + if ( is_singular( 'jetpack-portfolio' ) ) { + echo '' . esc_html__( 'Related projects', 'shapely' ) . '
'; + } else { + echo '' . esc_html__( 'Related articles ', 'shapely' ) . '
'; + } echo '. + $wp_customize->add_panel( + 'shapely_main_options', array( + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => esc_html__( 'Theme Options', 'shapely' ), + 'description' => esc_html__( 'Panel to update shapely theme options', 'shapely' ), // Include html tags such as
. 'priority' => 10, // Mixed with top-level-section hierarchy. - ) ); + ) + ); - $wp_customize->add_panel( 'shapely_blog_options', array( - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => esc_html__( 'Blog Settings', 'shapely' ), - 'description' => esc_html__( 'Panel to update Blog related options', 'shapely' ), // Include html tags such as
. + $wp_customize->add_panel( + 'shapely_blog_options', array( + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => esc_html__( 'Blog Settings', 'shapely' ), + 'description' => esc_html__( 'Panel to update Blog related options', 'shapely' ), // Include html tags such as
. 'priority' => 10, // Mixed with top-level-section hierarchy. - ) ); + ) + ); + + // Logo dimensions + $wp_customize->add_setting( + 'shapely_logo_dimension', array( + 'sanitize_callback' => 'shapely_sanitize_logo_dimension', + ) + ); + $wp_customize->add_control( + new Shapely_Logo_Dimensions( + $wp_customize, 'shapely_logo_dimension', array( + 'section' => 'title_tagline', + 'priority' => 9, + ) + ) + ); $title_tagline = $wp_customize->get_section( 'title_tagline' ); if ( $title_tagline ) { @@ -148,420 +189,992 @@ function shapely_customizer( $wp_customize ) { $header_image->priority = 31; } - $wp_customize->add_section( 'shapely_blog_section', array( - 'title' => esc_html__( 'Blog Index Settings', 'shapely' ), - 'panel' => 'shapely_blog_options', - 'priority' => 33, - ) ); - - $wp_customize->add_section( 'shapely_single_post_section', array( - 'title' => esc_html__( 'Blog Single Settings', 'shapely' ), - 'panel' => 'shapely_blog_options', - 'priority' => 35, - ) ); - $wp_customize->add_setting( 'link_color', array( - 'default' => '#745cf9', - 'sanitize_callback' => 'sanitize_hex_color', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( - 'label' => esc_html__( 'Link Color', 'shapely' ), - 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), - 'section' => 'colors', - ) ) ); - $wp_customize->add_setting( 'link_hover_color', array( - 'default' => '#5234f9', - 'sanitize_callback' => 'sanitize_hex_color', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_hover_color', array( - 'label' => esc_html__( 'Link Hover Color', 'shapely' ), - 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), - 'section' => 'colors', - ) ) ); - $wp_customize->add_setting( 'button_color', array( - 'default' => '#745cf9', - 'sanitize_callback' => 'sanitize_hex_color', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'button_color', array( - 'label' => esc_html__( 'Button Color', 'shapely' ), - 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), - 'section' => 'colors', - ) ) ); - $wp_customize->add_setting( 'button_hover_color', array( - 'default' => '#5234f9', - 'sanitize_callback' => 'sanitize_hex_color', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'button_hover_color', array( - 'label' => esc_html__( 'Button Hover Color', 'shapely' ), - 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), - 'section' => 'colors', - ) ) ); - - $wp_customize->add_setting( 'social_color', array( - 'default' => '#fff', - 'sanitize_callback' => 'sanitize_hex_color', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'social_color', array( - 'label' => esc_html__( 'Social Icon Color', 'shapely' ), - 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_section( + 'shapely_blog_section', array( + 'title' => esc_html__( 'Blog Index Settings', 'shapely' ), + 'panel' => 'shapely_blog_options', + 'priority' => 33, + ) + ); + + $wp_customize->add_section( + 'shapely_single_post_section', array( + 'title' => esc_html__( 'Blog Single Settings', 'shapely' ), + 'panel' => 'shapely_blog_options', + 'priority' => 35, + ) + ); + $wp_customize->add_setting( + 'link_color', array( + 'default' => '#745cf9', + 'sanitize_callback' => 'sanitize_hex_color', + ) + ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'link_color', array( + 'label' => esc_html__( 'Link Color', 'shapely' ), + 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), + 'section' => 'colors', + ) + ) + ); + $wp_customize->add_setting( + 'link_hover_color', array( + 'default' => '#5234f9', + 'sanitize_callback' => 'sanitize_hex_color', + ) + ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'link_hover_color', array( + 'label' => esc_html__( 'Link Hover Color', 'shapely' ), + 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), + 'section' => 'colors', + ) + ) + ); + $wp_customize->add_setting( + 'button_color', array( + 'default' => '#745cf9', + 'sanitize_callback' => 'sanitize_hex_color', + ) + ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'button_color', array( + 'label' => esc_html__( 'Button Color', 'shapely' ), + 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), + 'section' => 'colors', + ) + ) + ); + $wp_customize->add_setting( + 'button_hover_color', array( + 'default' => '#5234f9', + 'sanitize_callback' => 'sanitize_hex_color', + ) + ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'button_hover_color', array( + 'label' => esc_html__( 'Button Hover Color', 'shapely' ), + 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), + 'section' => 'colors', + ) + ) + ); + + $wp_customize->add_setting( + 'social_color', array( + 'default' => '#fff', + 'sanitize_callback' => 'sanitize_hex_color', + ) + ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'social_color', array( + 'label' => esc_html__( 'Social Icon Color', 'shapely' ), + 'description' => esc_html__( 'Default used if no color is selected', 'shapely' ), + 'section' => 'colors', + ) + ) + ); // add "Sidebar" section - $wp_customize->add_section( 'shapely_main_section', array( - 'title' => esc_html__( 'Main Options', 'shapely' ), - 'priority' => 11, - 'panel' => 'shapely_main_options', - ) ); + $wp_customize->add_section( + 'shapely_main_section', array( + 'title' => esc_html__( 'Main Options', 'shapely' ), + 'priority' => 11, + 'panel' => 'shapely_main_options', + ) + ); - $wp_customize->add_setting( 'top_callout', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); + $wp_customize->add_setting( + 'top_callout', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); if ( class_exists( 'Epsilon_Control_Toggle' ) ) { - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'top_callout', array( - 'label' => esc_html__( 'Show Blog Title', 'shapely' ), - 'description' => esc_html__( 'Show/hide the title from the Blog Page', 'shapely' ), - 'section' => 'shapely_blog_section', - 'priority' => 20, - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'top_callout', array( + 'label' => esc_html__( 'Show Blog Title', 'shapely' ), + 'description' => esc_html__( 'Show/hide the title from the Blog Page', 'shapely' ), + 'section' => 'shapely_blog_section', + 'priority' => 20, + ) + ) + ); } else { - $wp_customize->add_control( 'top_callout', array( - 'label' => esc_html__( 'Show Blog Title', 'shapely' ), - 'description' => esc_html__( 'Show/hide the title from the Blog Page', 'shapely' ), - 'section' => 'shapely_blog_section', - 'priority' => 20, - 'type' => 'checkbox', - ) ); + $wp_customize->add_control( + 'top_callout', array( + 'label' => esc_html__( 'Show Blog Title', 'shapely' ), + 'description' => esc_html__( 'Show/hide the title from the Blog Page', 'shapely' ), + 'section' => 'shapely_blog_section', + 'priority' => 20, + 'type' => 'checkbox', + ) + ); } - $wp_customize->add_setting( 'hide_post_title', array( - 'default' => 0, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); + $wp_customize->add_setting( + 'hide_post_title', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); if ( class_exists( 'Epsilon_Control_Toggle' ) ) { - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'hide_post_title', array( - 'label' => esc_html__( 'Title in Blog Post', 'shapely' ), - 'section' => 'wpseo_breadcrumbs_customizer_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'hide_post_title', array( + 'label' => esc_html__( 'Title in Blog Post', 'shapely' ), + 'section' => 'wpseo_breadcrumbs_customizer_section', + ) + ) + ); } else { - $wp_customize->add_control( 'hide_post_title', array( - 'label' => esc_html__( 'Title in Blog Post', 'shapely' ), - 'section' => 'wpseo_breadcrumbs_customizer_section', - 'type' => 'checkbox', - ) ); + $wp_customize->add_control( + 'hide_post_title', array( + 'label' => esc_html__( 'Title in Blog Post', 'shapely' ), + 'section' => 'wpseo_breadcrumbs_customizer_section', + 'type' => 'checkbox', + ) + ); } - $wp_customize->add_setting( 'blog_name', array( - 'default' => '', - 'sanitize_callback' => 'wp_kses_stripslashes', - 'transport' => 'postMessage', - ) ); - $wp_customize->add_control( 'blog_name', array( - 'label' => esc_html__( 'Blog Name in Top Callout', 'shapely' ), - 'description' => esc_html__( 'Heading for the Blog page', 'shapely' ), - 'section' => 'shapely_blog_section', - ) ); + $wp_customize->add_setting( + 'blog_name', array( + 'default' => '', + 'sanitize_callback' => 'wp_kses_stripslashes', + 'transport' => 'postMessage', + ) + ); + $wp_customize->add_control( + 'blog_name', array( + 'label' => esc_html__( 'Blog Name in Top Callout', 'shapely' ), + 'description' => esc_html__( 'Heading for the Blog page', 'shapely' ), + 'section' => 'shapely_blog_section', + ) + ); - if ( post_type_exists( 'jetpack-portfolio' ) ) { - $wp_customize->add_setting( 'portfolio_name', array( + $wp_customize->add_setting( + 'mobile_menu_on_desktop', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + if ( class_exists( 'Epsilon_Control_Toggle' ) ) { + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'mobile_menu_on_desktop', array( + 'label' => esc_html__( 'Mobile Menu on Desktop', 'shapely' ), + 'description' => esc_html__( 'Always the menu will be like the mobile menu', 'shapely' ), + 'section' => 'shapely_main_section', + ) + ) + ); + } else { + $wp_customize->add_control( + 'mobile_menu_on_desktop', array( + 'label' => esc_html__( 'Mobile Menu on Desktop', 'shapely' ), + 'description' => esc_html__( 'Always the menu will be like the mobile menu', 'shapely' ), + 'section' => 'shapely_main_section', + 'type' => 'checkbox', + ) + ); + } + $wp_customize->add_setting( + 'footer_callout_text', array( + 'default' => '', + 'sanitize_callback' => 'wp_kses_stripslashes', + 'transport' => 'postMessage', + ) + ); + $wp_customize->add_control( + 'footer_callout_text', array( + 'label' => esc_html__( 'Text for Footer Callout', 'shapely' ), + 'description' => esc_html__( 'The title of the call to action section from footer', 'shapely' ), + 'section' => 'shapely_main_section', + ) + ); + + $wp_customize->add_setting( + 'footer_callout_btntext', array( 'default' => '', 'sanitize_callback' => 'wp_kses_stripslashes', - ) ); - $wp_customize->add_control( 'portfolio_name', array( - 'label' => esc_html__( 'Portfolio Archive Title', 'shapely' ), - 'description' => esc_html__( 'Add a title on the Portfolio Archive Page.', 'shapely' ), + 'transport' => 'postMessage', + ) + ); + $wp_customize->add_control( + 'footer_callout_btntext', array( + 'label' => esc_html__( 'Text for Footer Callout Button', 'shapely' ), + 'description' => esc_html__( 'The label of the call to action section\'s button from the footer', 'shapely' ), 'section' => 'shapely_main_section', - ) ); + ) + ); + $wp_customize->add_setting( + 'footer_callout_link', array( + 'default' => '', + 'sanitize_callback' => 'esc_url_raw', + 'transport' => 'postMessage', + ) + ); + $wp_customize->add_control( + 'footer_callout_link', array( + 'label' => esc_html__( 'CFA Button Link', 'shapely' ), + 'section' => 'shapely_main_section', + 'description' => esc_html__( 'The URL of the call to action section\'s button from footer', 'shapely' ), + 'type' => 'text', + ) + ); - $wp_customize->add_setting( 'portfolio_description', array( + // add "Footer" section + $wp_customize->add_section( + 'shapely_footer_section', array( + 'title' => esc_html__( 'Footer', 'shapely' ), + 'priority' => 90, + ) + ); + + $wp_customize->add_setting( + 'shapely_footer_copyright', array( 'default' => '', + 'transport' => 'refresh', 'sanitize_callback' => 'wp_kses_stripslashes', - ) ); - $wp_customize->add_control( 'portfolio_description', array( + ) + ); + + $wp_customize->add_control( + 'shapely_footer_copyright', array( 'type' => 'textarea', - 'label' => esc_html__( 'Portfolio Archive Description', 'shapely' ), - 'description' => esc_html__( 'Add a description on the Portfolio Archive Page.', 'shapely' ), - 'section' => 'shapely_main_section', - ) ); - } + 'label' => esc_html__( 'Copyright Text', 'shapely' ), + 'section' => 'shapely_footer_section', + ) + ); - $wp_customize->add_setting( 'footer_callout_text', array( - 'default' => '', - 'sanitize_callback' => 'wp_kses_stripslashes', - 'transport' => 'postMessage', - ) ); - $wp_customize->add_control( 'footer_callout_text', array( - 'label' => esc_html__( 'Text for Footer Callout', 'shapely' ), - 'description' => esc_html__( 'The title of the call to action section from footer', 'shapely' ), - 'section' => 'shapely_main_section', - ) ); - - $wp_customize->add_setting( 'footer_callout_btntext', array( - 'default' => '', - 'sanitize_callback' => 'wp_kses_stripslashes', - 'transport' => 'postMessage', - ) ); - $wp_customize->add_control( 'footer_callout_btntext', array( - 'label' => esc_html__( 'Text for Footer Callout Button', 'shapely' ), - 'description' => esc_html__( 'The label of the call to action section\'s button from the footer', 'shapely' ), - 'section' => 'shapely_main_section', - ) ); - $wp_customize->add_setting( 'footer_callout_link', array( - 'default' => '', - 'sanitize_callback' => 'esc_url_raw', - 'transport' => 'postMessage', - ) ); - $wp_customize->add_control( 'footer_callout_link', array( - 'label' => esc_html__( 'CFA Button Link', 'shapely' ), - 'section' => 'shapely_main_section', - 'description' => esc_html__( 'The URL of the call to action section\'s button from footer', 'shapely' ), - 'type' => 'text', - ) ); + $wp_customize->add_setting( + 'title_in_header', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'title_above_post', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_date', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_category', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_author', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); - // add "Footer" section - $wp_customize->add_section( 'shapely_footer_section', array( - 'title' => esc_html__( 'Footer', 'shapely' ), - 'priority' => 90, - ) ); - - $wp_customize->add_setting( 'shapely_footer_copyright', array( - 'default' => '', - 'transport' => 'refresh', - 'sanitize_callback' => 'wp_kses_stripslashes', - ) ); - - $wp_customize->add_control( 'shapely_footer_copyright', array( - 'type' => 'textarea', - 'label' => esc_html__( 'Copyright Text', 'shapely' ), - 'section' => 'shapely_footer_section', - ) ); - - $wp_customize->add_setting( 'title_in_header', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'title_above_post', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_date', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_category', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_author', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - - $wp_customize->add_setting( 'first_letter_caps', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'tags_post_meta', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'related_posts_area', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_author_area', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_author_left_side', array( - 'default' => 0, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); - $wp_customize->add_setting( 'post_author_email', array( - 'default' => 0, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); + $wp_customize->add_setting( + 'first_letter_caps', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'tags_post_meta', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'related_posts_area', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_author_area', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_author_left_side', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'post_author_email', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); // Single Post Settings if ( class_exists( 'Epsilon_Control_Toggle' ) ) { - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'title_in_header', array( - 'label' => esc_html__( 'Show title in header', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the post title from callout', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'title_in_header', array( + 'label' => esc_html__( 'Show title in header', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the post title from callout', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'title_above_post', array( - 'label' => esc_html__( 'Show title above post', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the post title above post content', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'title_above_post', array( + 'label' => esc_html__( 'Show title above post', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the post title above post content', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_date', array( - 'label' => esc_html__( 'Show the date', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the date when post was published', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_date', array( + 'label' => esc_html__( 'Show the date', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the date when post was published', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_author', array( - 'label' => esc_html__( 'Show the author', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the author who written the post under the post title', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_author', array( + 'label' => esc_html__( 'Show the author', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author who written the post under the post title', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_category', array( - 'label' => esc_html__( 'Show the category', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the categories of post', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_category', array( + 'label' => esc_html__( 'Show the category', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the categories of post', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'first_letter_caps', array( - 'label' => esc_html__( 'First Letter Caps', 'shapely' ), - 'description' => esc_html__( 'This will transform your first letter from a post into uppercase', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'tags_post_meta', array( - 'label' => esc_html__( 'Tags Post Meta', 'shapely' ), - 'description' => esc_html__( 'This will show/hide tags from the end of post', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'related_posts_area', array( - 'label' => esc_html__( 'Related Posts Area', 'shapely' ), - 'description' => esc_html__( 'This will enable/disable the related posts', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_author_area', array( - 'label' => esc_html__( 'Post Author Area', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_author_left_side', array( - 'label' => esc_html__( 'Post Author Left Side', 'shapely' ), - 'description' => esc_html__( 'This will move the author box from the bottom of the post on top on the left side', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'post_author_email', array( - 'label' => esc_html__( 'Show Author Email', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), - 'section' => 'shapely_single_post_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'first_letter_caps', array( + 'label' => esc_html__( 'First Letter Caps', 'shapely' ), + 'description' => esc_html__( 'This will transform your first letter from a post into uppercase', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'tags_post_meta', array( + 'label' => esc_html__( 'Tags Post Meta', 'shapely' ), + 'description' => esc_html__( 'This will show/hide tags from the end of post', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'related_posts_area', array( + 'label' => esc_html__( 'Related Posts Area', 'shapely' ), + 'description' => esc_html__( 'This will enable/disable the related posts', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_author_area', array( + 'label' => esc_html__( 'Post Author Area', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_author_left_side', array( + 'label' => esc_html__( 'Post Author Left Side', 'shapely' ), + 'description' => esc_html__( 'This will move the author box from the bottom of the post on top on the left side', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'post_author_email', array( + 'label' => esc_html__( 'Show Author Email', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), + 'section' => 'shapely_single_post_section', + ) + ) + ); } else { - $wp_customize->add_control( 'first_letter_caps', array( - 'label' => esc_html__( 'First Letter Caps', 'shapely' ), - 'description' => esc_html__( 'This will transform your first letter from a post into uppercase', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); - $wp_customize->add_control( 'tags_post_meta', array( - 'label' => esc_html__( 'Tags Post Meta', 'shapely' ), - 'description' => esc_html__( 'This will show/hide tags from the end of post', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); - $wp_customize->add_control( 'related_posts_area', array( - 'label' => esc_html__( 'Related Posts Area', 'shapely' ), - 'description' => esc_html__( 'This will enable/disable the related posts', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); - $wp_customize->add_control( 'post_author_area', array( - 'label' => esc_html__( 'Post Author Area', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); - $wp_customize->add_control( 'post_author_left_side', array( - 'label' => esc_html__( 'Post Author Left Side', 'shapely' ), - 'description' => esc_html__( 'This will move the author box from the bottom of the post on top on the left side', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); - $wp_customize->add_control( 'post_author_email', array( - 'label' => esc_html__( 'Show Author Email', 'shapely' ), - 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'checkbox', - ) ); + $wp_customize->add_control( + 'first_letter_caps', array( + 'label' => esc_html__( 'First Letter Caps', 'shapely' ), + 'description' => esc_html__( 'This will transform your first letter from a post into uppercase', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'tags_post_meta', array( + 'label' => esc_html__( 'Tags Post Meta', 'shapely' ), + 'description' => esc_html__( 'This will show/hide tags from the end of post', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'related_posts_area', array( + 'label' => esc_html__( 'Related Posts Area', 'shapely' ), + 'description' => esc_html__( 'This will enable/disable the related posts', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'post_author_area', array( + 'label' => esc_html__( 'Post Author Area', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'post_author_left_side', array( + 'label' => esc_html__( 'Post Author Left Side', 'shapely' ), + 'description' => esc_html__( 'This will move the author box from the bottom of the post on top on the left side', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'post_author_email', array( + 'label' => esc_html__( 'Show Author Email', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'checkbox', + ) + ); } // End if(). - $wp_customize->add_setting( 'single_post_layout_template', array( - 'default' => 'sidebar-right', - 'sanitize_callback' => 'shapely_sanitize_blog_layout', - ) ); - - $wp_customize->add_control( 'single_post_layout_template', array( - 'label' => esc_html__( 'Single Post Template', 'shapely' ), - 'description' => esc_html__( 'Set the default template for single posts', 'shapely' ), - 'section' => 'shapely_single_post_section', - 'type' => 'select', - 'choices' => array( - 'full-width' => esc_html__( 'Full Width', 'shapely' ), - 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), - 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), - 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), - ), - ) ); - - $wp_customize->add_setting( 'blog_layout_view', array( - 'default' => 'grid', - 'sanitize_callback' => 'wp_kses_stripslashes', - ) ); - - $wp_customize->add_control( 'blog_layout_view', array( - 'label' => esc_html__( 'Blog Layout', 'shapely' ), - 'description' => esc_html__( 'Choose how you want to display posts in grid', 'shapely' ), - 'section' => 'shapely_blog_section', - 'type' => 'select', - 'choices' => array( - 'grid' => esc_html__( 'Grid only', 'shapely' ), - 'large_image_grid' => esc_html__( 'Large Image and Grid', 'shapely' ), - 'large_image' => esc_html__( 'Large Images', 'shapely' ), - ), - ) ); - - $wp_customize->add_setting( 'blog_layout_template', array( - 'default' => 'sidebar-right', - 'sanitize_callback' => 'shapely_sanitize_blog_layout', - ) ); - - $wp_customize->add_control( 'blog_layout_template', array( - 'label' => esc_html__( 'Blog Template', 'shapely' ), - 'description' => esc_html__( 'Choose the template for your posts page', 'shapely' ), - 'section' => 'shapely_blog_section', - 'type' => 'select', - 'choices' => array( - 'full-width' => esc_html__( 'Full Width', 'shapely' ), - 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), - 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), - 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), - ), - ) ); + $wp_customize->add_setting( + 'single_post_layout_template', array( + 'default' => 'sidebar-right', + 'sanitize_callback' => 'shapely_sanitize_blog_layout', + ) + ); + + $wp_customize->add_control( + 'single_post_layout_template', array( + 'label' => esc_html__( 'Single Post Template', 'shapely' ), + 'description' => esc_html__( 'Set the default template for single posts', 'shapely' ), + 'section' => 'shapely_single_post_section', + 'type' => 'select', + 'choices' => array( + 'full-width' => esc_html__( 'Full Width', 'shapely' ), + 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), + 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), + 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), + ), + ) + ); + + $wp_customize->add_setting( + 'blog_layout_view', array( + 'default' => 'grid', + 'sanitize_callback' => 'wp_kses_stripslashes', + ) + ); + + $wp_customize->add_control( + 'blog_layout_view', array( + 'label' => esc_html__( 'Blog Layout', 'shapely' ), + 'description' => esc_html__( 'Choose how you want to display posts in grid', 'shapely' ), + 'section' => 'shapely_blog_section', + 'type' => 'select', + 'choices' => array( + 'grid' => esc_html__( 'Grid only', 'shapely' ), + 'large_image_grid' => esc_html__( 'Large Image and Grid', 'shapely' ), + 'large_image' => esc_html__( 'Large Images', 'shapely' ), + ), + ) + ); + + $wp_customize->add_setting( + 'blog_layout_template', array( + 'default' => 'sidebar-right', + 'sanitize_callback' => 'shapely_sanitize_blog_layout', + ) + ); + + $wp_customize->add_control( + 'blog_layout_template', array( + 'label' => esc_html__( 'Blog Template', 'shapely' ), + 'description' => esc_html__( 'Choose the template for your posts page', 'shapely' ), + 'section' => 'shapely_blog_section', + 'type' => 'select', + 'choices' => array( + 'full-width' => esc_html__( 'Full Width', 'shapely' ), + 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), + 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), + 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), + ), + ) + ); // shapely_category_page_section - $wp_customize->add_setting( 'show_category_on_category_page', array( - 'default' => 1, - 'sanitize_callback' => 'shapely_sanitize_checkbox', - ) ); + $wp_customize->add_setting( + 'show_category_on_category_page', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); if ( class_exists( 'Epsilon_Control_Toggle' ) ) { - $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'show_category_on_category_page', array( - 'label' => esc_html__( 'Show Category on Posts', 'shapely' ), - 'description' => esc_html__( 'Show/hide posts\' categories from the Category Page', 'shapely' ), - 'section' => 'shapely_blog_section', - ) ) ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'show_category_on_category_page', array( + 'label' => esc_html__( 'Show Category on Posts', 'shapely' ), + 'description' => esc_html__( 'Show/hide posts\' categories from the Category Page', 'shapely' ), + 'section' => 'shapely_blog_section', + ) + ) + ); } else { - $wp_customize->add_control( 'show_category_on_category_page', array( - 'label' => esc_html__( 'Show Category on Posts', 'shapely' ), - 'description' => esc_html__( 'Show/hide posts\' categories from the Category Page', 'shapely' ), - 'section' => 'shapely_blog_section', - 'type' => 'checkbox', - ) ); + $wp_customize->add_control( + 'show_category_on_category_page', array( + 'label' => esc_html__( 'Show Category on Posts', 'shapely' ), + 'description' => esc_html__( 'Show/hide posts\' categories from the Category Page', 'shapely' ), + 'section' => 'shapely_blog_section', + 'type' => 'checkbox', + ) + ); + } + + if ( post_type_exists( 'jetpack-portfolio' ) ) { + + // Add Projects Settings + $wp_customize->add_panel( + 'shapely_projects_options', array( + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => esc_html__( 'Projects Settings', 'shapely' ), + 'description' => esc_html__( 'Panel to update projects related options', 'shapely' ), + 'priority' => 10, + ) + ); + $wp_customize->add_section( + 'shapely_projects_section', array( + 'title' => esc_html__( 'Projects Page Settings', 'shapely' ), + 'panel' => 'shapely_projects_options', + 'priority' => 33, + ) + ); + + $wp_customize->add_section( + 'shapely_single_project_section', array( + 'title' => esc_html__( 'Project Single Settings', 'shapely' ), + 'panel' => 'shapely_projects_options', + 'priority' => 35, + ) + ); + + // Projects Archive Page + $wp_customize->add_setting( + 'portfolio_archive_title', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + if ( class_exists( 'Epsilon_Control_Toggle' ) ) { + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'portfolio_archive_title', array( + 'label' => esc_html__( 'Show Portfolio Archive Title', 'shapely' ), + 'description' => esc_html__( 'Show/hide the title from the Portfolio Archive Page', 'shapely' ), + 'section' => 'shapely_projects_section', + ) + ) + ); + } else { + $wp_customize->add_control( + 'portfolio_archive_title', array( + 'label' => esc_html__( 'Show Portfolio Archive Title', 'shapely' ), + 'description' => esc_html__( 'Show/hide the title from the Portfolio Archive Page', 'shapely' ), + 'section' => 'shapely_projects_section', + 'type' => 'checkbox', + ) + ); + } + $wp_customize->add_setting( + 'portfolio_name', array( + 'default' => '', + 'sanitize_callback' => 'wp_kses_stripslashes', + ) + ); + $wp_customize->add_control( + 'portfolio_name', array( + 'label' => esc_html__( 'Portfolio Archive Title', 'shapely' ), + 'description' => esc_html__( 'Add a title on the Portfolio Archive Page.', 'shapely' ), + 'section' => 'shapely_projects_section', + ) + ); + + $wp_customize->add_setting( + 'portfolio_description', array( + 'default' => '', + 'sanitize_callback' => 'wp_kses_post', + ) + ); + $wp_customize->add_control( + 'portfolio_description', array( + 'type' => 'textarea', + 'label' => esc_html__( 'Portfolio Archive Description', 'shapely' ), + 'description' => esc_html__( 'Add a description on the Portfolio Archive Page.', 'shapely' ), + 'section' => 'shapely_projects_section', + ) + ); + + $wp_customize->add_setting( + 'projects_layout_view', array( + 'default' => 'mansonry', + 'sanitize_callback' => 'wp_kses_stripslashes', + ) + ); + + $wp_customize->add_control( + 'projects_layout_view', array( + 'label' => esc_html__( 'Projects Layout', 'shapely' ), + 'description' => esc_html__( 'Choose how you want to display projects', 'shapely' ), + 'section' => 'shapely_projects_section', + 'type' => 'select', + 'choices' => array( + 'mansonry' => esc_html__( 'Masonry', 'shapely' ), + 'grid' => esc_html__( 'Grid', 'shapely' ), + ), + ) + ); + + $wp_customize->add_setting( + 'projects_layout_template', array( + 'default' => 'full-width', + 'sanitize_callback' => 'shapely_sanitize_blog_layout', + ) + ); + + $wp_customize->add_control( + 'projects_layout_template', array( + 'label' => esc_html__( 'Projects Template', 'shapely' ), + 'description' => esc_html__( 'Choose the template for your projects archive page', 'shapely' ), + 'section' => 'shapely_projects_section', + 'type' => 'select', + 'choices' => array( + 'full-width' => esc_html__( 'Full Width', 'shapely' ), + 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), + 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), + 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), + ), + ) + ); } + // Single Project + $wp_customize->add_setting( + 'project_title_in_header', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'title_above_project', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_date', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_category', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_author', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + + $wp_customize->add_setting( + 'project_first_letter_caps', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_tags_project_meta', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'related_projects_area', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_author_area', array( + 'default' => 1, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_author_left_side', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + $wp_customize->add_setting( + 'project_author_email', array( + 'default' => 0, + 'sanitize_callback' => 'shapely_sanitize_checkbox', + ) + ); + + // Single Project Settings + if ( class_exists( 'Epsilon_Control_Toggle' ) ) { + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_title_in_header', array( + 'label' => esc_html__( 'Show title in header', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the project title from callout', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'title_above_project', array( + 'label' => esc_html__( 'Show title above project', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the project title above project content', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_date', array( + 'label' => esc_html__( 'Show the date', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the date when project was published', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_author', array( + 'label' => esc_html__( 'Show the author', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author who written the project under the project title', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_category', array( + 'label' => esc_html__( 'Show the project type', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the type of project', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_first_letter_caps', array( + 'label' => esc_html__( 'First Letter Caps', 'shapely' ), + 'description' => esc_html__( 'This will transform your first letter from a project into uppercase', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'tags_project_meta', array( + 'label' => esc_html__( 'Tags Project Meta', 'shapely' ), + 'description' => esc_html__( 'This will show/hide tags from the end of project', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'related_projects_area', array( + 'label' => esc_html__( 'Related Projects Area', 'shapely' ), + 'description' => esc_html__( 'This will enable/disable the related projects', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_author_area', array( + 'label' => esc_html__( 'Project Author Area', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_author_left_side', array( + 'label' => esc_html__( 'Project Author Left Side', 'shapely' ), + 'description' => esc_html__( 'This will move the author box from the bottom of the project on top on the left side', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + $wp_customize->add_control( + new Epsilon_Control_Toggle( + $wp_customize, 'project_author_email', array( + 'label' => esc_html__( 'Show Author Email', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), + 'section' => 'shapely_single_project_section', + ) + ) + ); + } else { + $wp_customize->add_control( + 'project_first_letter_caps', array( + 'label' => esc_html__( 'First Letter Caps', 'shapely' ), + 'description' => esc_html__( 'This will transform your first letter from a project into uppercase', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'tags_project_meta', array( + 'label' => esc_html__( 'Tags Project Meta', 'shapely' ), + 'description' => esc_html__( 'This will show/hide tags from the end of project', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'related_projects_area', array( + 'label' => esc_html__( 'Related Projects Area', 'shapely' ), + 'description' => esc_html__( 'This will enable/disable the related projects', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'project_author_area', array( + 'label' => esc_html__( 'Project Author Area', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author box', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'project_author_left_side', array( + 'label' => esc_html__( 'Project Author Left Side', 'shapely' ), + 'description' => esc_html__( 'This will move the author box from the bottom of the project on top on the left side', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + $wp_customize->add_control( + 'project_author_email', array( + 'label' => esc_html__( 'Show Author Email', 'shapely' ), + 'description' => esc_html__( 'This will show/hide the author\'s email from the author box', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'checkbox', + ) + ); + } // End if(). + $wp_customize->add_setting( + 'single_project_layout_template', array( + 'default' => 'sidebar-right', + 'sanitize_callback' => 'shapely_sanitize_blog_layout', + ) + ); + + $wp_customize->add_control( + 'single_project_layout_template', array( + 'label' => esc_html__( 'Single Project Template', 'shapely' ), + 'description' => esc_html__( 'Set the default template for single project', 'shapely' ), + 'section' => 'shapely_single_project_section', + 'type' => 'select', + 'choices' => array( + 'full-width' => esc_html__( 'Full Width', 'shapely' ), + 'no-sidebar' => esc_html__( 'No Sidebar', 'shapely' ), + 'sidebar-left' => esc_html__( 'Sidebar Left', 'shapely' ), + 'sidebar-right' => esc_html__( 'Sidebar Right', 'shapely' ), + ), + ) + ); + } add_action( 'customize_register', 'shapely_customizer' ); +/** + * Sanitize logo dimension setting. + */ +function shapely_sanitize_logo_dimension( $dimensions ) { + $new_dimensions = array(); + + if ( isset( $dimensions['width'] ) ) { + $new_dimensions['width'] = abs( floatval( $dimensions['width'] ) ); + } + + if ( isset( $dimensions['height'] ) ) { + $new_dimensions['height'] = abs( floatval( $dimensions['height'] ) ); + } + + if ( isset( $dimensions['ratio'] ) ) { + $new_dimensions['ratio'] = absint( $dimensions['ratio'] ); + } + + return $new_dimensions; + +} + /** * Sanitize checkbox for WordPress customizer. */ @@ -611,6 +1224,16 @@ function shapely_customizer_custom_control_css() { #customize-control-shapely-main_body_typography-size select, #customize-control-shapely-main_body_typography-face select, #customize-control-shapely-main_body_typography-style select { width: 60%; } + .shapely-logo-dimension .half { + width: 49%; + float: left; + } + .shapely-logo-dimension .half:nth-child(2) { + margin-left: 2%; + } + .shapely-logo-dimension .ratio { + clear: both; + } 'menu', - 'theme_location' => 'primary', - 'depth' => 0, - 'container' => 'div', - 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse', - 'menu_class' => 'menu', - 'fallback_cb' => 'Wp_Bootstrap_Navwalker::fallback', - 'walker' => new Wp_Bootstrap_Navwalker(), - )); + wp_nav_menu( + array( + 'menu_id' => 'menu', + 'theme_location' => 'primary', + 'depth' => 0, + 'container' => 'div', + 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse', + 'menu_class' => 'menu', + 'fallback_cb' => 'Wp_Bootstrap_Navwalker::fallback', + 'walker' => new Wp_Bootstrap_Navwalker(), + ) + ); } /* end header menu */ endif; @@ -151,7 +153,7 @@ function shapely_get_theme_options() { input[type="submit"], button[type="submit"], .post-content .more-link { background:' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important; border: 2px solid' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important;}'; - echo '.shapely_home_parallax > section:not(.image-bg) .btn-white { color:' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important; border: 2px solid' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important; }'; + echo '.shapely_home_parallax > section:not(.image-bg) .btn-white { color:' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important; border: 2px solid' . esc_attr( get_theme_mod( 'button_color' ) ) . ' !important; }'; } if ( get_theme_mod( 'button_hover_color' ) ) { echo '.btn-filled:hover, .woocommerce #respond input#submit.alt:hover, @@ -240,7 +242,8 @@ function shapely_make_top_level_menu_clickable() { } }); - ' . esc_html_x( 'Read More', 'Read More', 'shapely' ) . '
+ + } + ?>
- ++ if ( $twitter_profile && '' != $twitter_profile ) { + ?>-
-
+
+ if ( $fb_profile && '' != $fb_profile ) {
+ ?>
-
-
+
+ if ( $dribble_profile && '' != $dribble_profile ) {
+ ?>
-
@@ -361,22 +377,27 @@ function shapely_author_bio() {
}
$github_profile = get_the_author_meta( 'github' );
- if ( $github_profile && '' != $github_profile ) { ?>
+ if ( $github_profile && '' != $github_profile ) {
+ ?>
-
-
+
+ if ( $vimeo_profile && '' != $vimeo_profile ) {
+ ?>
-
-
+
+
@@ -483,16 +509,55 @@ function shapely_custom_comment_form() { * Header Logo */ function shapely_get_header_logo() { - $logo_id = get_theme_mod( 'custom_logo', '' ); - $logo = wp_get_attachment_image_src( $logo_id, 'full' ); ?> - - -
-
- 'custom-logo logo',
+ 'itemprop' => 'logo',
+ );
+ /*
+ * If the logo alt attribute is empty, get the site title and explicitly
+ * pass it to the attributes used by wp_get_attachment_image().
+ */
+ $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true );
+ if ( empty( $image_alt ) ) {
+ $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' );
+ }
+ /*
+ * If the alt attribute is not empty, there's no need to explicitly pass
+ * it because wp_get_attachment_image() already adds the alt attribute.
+ */
+ $html = sprintf(
+ '%2$s',
+ esc_url( home_url( '/' ) ),
+ wp_get_attachment_image( $custom_logo_id, $dimension, false, $custom_logo_attr )
+ );
+ } // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
+ elseif ( is_customize_preview() ) {
+ $html = sprintf(
+ '%2$s',
+ esc_url( home_url( '/' ) ),
+ esc_html( get_bloginfo( 'name' ) )
+ );
+ } else {
+ $html = sprintf(
+ '%2$s',
+ esc_url( home_url( '/' ) ),
+ esc_html( get_bloginfo( 'name' ) )
+ );
+ }
+
+ echo $html;
+
}
/*
@@ -500,7 +565,9 @@ function shapely_get_header_logo() {
* then from themeoptions
*/
function shapely_get_layout_class() {
- if ( is_single() ) {
+ if ( is_singular( 'jetpack-portfolio' ) ) {
+ $layout_class = get_theme_mod( 'single_project_layout_template', 'sidebar-right' );
+ } elseif ( is_single() ) {
$template = get_page_template_slug();
$layout_class = '';
switch ( $template ) {
@@ -540,6 +607,8 @@ function shapely_get_layout_class() {
$layout_class = get_theme_mod( 'blog_layout_template', 'sidebar-right' );
break;
}
+ } elseif ( is_archive() && is_post_type_archive( 'jetpack-portfolio' ) ) {
+ $layout_class = get_theme_mod( 'projects_layout_template', 'full-width' );
} else {
$layout_class = get_theme_mod( 'blog_layout_template', 'sidebar-right' );
} // End if().
@@ -568,11 +637,14 @@ function shapely_show_sidebar() {
* Top Callout
*/
function shapely_top_callout() {
- if ( ( get_theme_mod( 'top_callout', true ) && ! is_single() ) || ( is_single() && get_theme_mod( 'title_in_header', true ) ) ) {
+ if ( ( get_theme_mod( 'portfolio_archive_title', true ) && is_post_type_archive( 'jetpack-portfolio' ) ) ||
+ ( get_theme_mod( 'top_callout', true ) && ! is_single() && ! is_post_type_archive( 'jetpack-portfolio' ) ) ||
+ ( is_single() && get_theme_mod( 'title_in_header', true ) && ! is_singular( 'jetpack-portfolio' ) ) ||
+ ( get_theme_mod( 'project_title_in_header', true ) && is_singular( 'jetpack-portfolio' ) ) ) {
$header = get_header_image();
?>
>
+ class="page-title-section bg-secondary " >
-
-
-
+
+
', '' ); ?>
-
+ if ( get_theme_mod( 'footer_callout_text' ) != '' ) {
+ ?>
@@ -648,7 +740,8 @@ class="mb0 btn btn-lg btn-filled cfa-button">
-
+ 'main',
- 'render' => 'shapely_infinite_scroll_render',
- 'footer' => 'page',
- ) );
+ add_theme_support(
+ 'infinite-scroll', array(
+ 'container' => 'main',
+ 'render' => 'shapely_infinite_scroll_render',
+ 'footer' => 'page',
+ )
+ );
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
diff --git a/inc/template-tags.php b/inc/template-tags.php
index 0939ed4..200a133 100644
--- a/inc/template-tags.php
+++ b/inc/template-tags.php
@@ -17,7 +17,8 @@ function shapely_posted_on() {
$time_string = '';
}
- $time_string = sprintf( $time_string,
+ $time_string = sprintf(
+ $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
@@ -31,7 +32,8 @@ function shapely_posted_on() {
-
+ ' : '';
}
endif;
@@ -42,33 +44,41 @@ function shapely_posted_on() {
*/
function shapely_posted_on_no_cat() {
- $post_author = get_theme_mod( 'post_author', true );
- $post_date = get_theme_mod( 'post_date', true );
+ if ( is_singular( 'jetpack-portfolio' ) ) {
+ $post_author = get_theme_mod( 'project_author', true );
+ $post_date = get_theme_mod( 'project_date', true );
+ } else {
+ $post_author = get_theme_mod( 'post_author', true );
+ $post_date = get_theme_mod( 'post_date', true );
+ }
+
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
- $time_string = sprintf( $time_string,
+ $time_string = sprintf(
+ $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
- );
+ );
if ( $post_date || $post_author ) :
?>
-
-
-
+
+
+
+
+ endif;
+ ?>
+if ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar( 'sidebar-home' ) ) :
+?>
diff --git a/page.php b/page.php
index 227bff9..efdda85 100644
--- a/page.php
+++ b/page.php
@@ -20,17 +20,20 @@
get_sidebar();
endif;
?>
- ">
+
+ endwhile; // End of the loop.
+ ?>
+ if ( have_posts() ) :
+ ?>
+
+
+
+
+
+
+
- ">
+
+ endwhile; // End of the loop.
+ ?>
.flex-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
/*--------------------------------------------------------------
# Accessibility
@@ -1366,8 +1371,6 @@ nav .btn, .nav-bar .btn {
}
.nav-bar {
- height: 55px;
- max-height: 55px;
line-height: 53px;
}
@@ -1375,19 +1378,16 @@ nav {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
-.nav-bar .module, .nav-bar .module-group {
+.nav-bar .module:not( .site-title-container ),
+.nav-bar .module-group {
height: 55px;
}
-.nav-bar a {
+.nav-bar a:not( .custom-logo-link ) {
display: inline-block;
height: 55px;
}
-.logo {
- max-height: 60%;
-}
-
.menu > li.dropdown {
padding-right: 18px;
}
@@ -1830,12 +1830,149 @@ nav.fixed.scrolled {
}
}
+/* Mobile Menu on Desktop */
+@media all and (min-width: 992px) {
+ .mobile-menu .module.widget-handle {
+ border-left: none;
+ line-height: 40px;
+ min-height: 40px;
+ }
+ .mobile-menu .nav-bar .module-group {
+ width: 100%;
+ }
+ .mobile-menu .visible-xs,
+ .mobile-menu .visible-sm,
+ .mobile-menu .nav-open .navbar-collapse.collapse {
+ display: block!important;
+ }
+
+ .mobile-menu .navbar-collapse.collapse,
+ .mobile-menu .nav-bar .module-group .module.hidden-xs,
+ .mobile-menu .nav-bar .module-group .module.hidden-sm {
+ display: none !important;
+ }
+ .mobile-menu #site-navigation .container > .flex-row {
+ flex-wrap: wrap;
+ }
+ .mobile-menu .nav-bar, .nav-bar .module-group,
+ .mobile-menu .nav-bar .module,
+ .mobile-menu .nav-bar .module:not( .site-title-container ) {
+ height: auto;
+ }
+ .mobile-menu .nav-bar .module {
+ padding: 0 16px;
+ }
+ .mobile-menu .navbar-collapse {
+ margin-top: 20px;
+ width: 100%;
+ }
+ .mobile-menu .main-navigation .menu li {
+ line-height: 24px;
+ display: block;
+ width: 100%;
+ max-width: 100%;
+ }
+ .mobile-menu .main-navigation .menu a {
+ height: auto;
+ line-height: 24px;
+ padding: 4px 0;
+ }
+ .mobile-menu .shapely-dropdown {
+ float: right;
+ border: 1px solid;
+ font-size: 11px;
+ padding: 0 10px;
+ display: inline-block;
+ cursor: pointer;
+ }
+ .mobile-menu .main-navigation .menu > li > ul {
+ position: relative;
+ opacity: 1;
+ visibility: visible;
+ display: none;
+ transform: translate3d(0, 0px, 0);
+ -webkit-transform: translate3d(0, 0px, 0);
+ -moz-transform: translate3d(0, 0px, 0);
+ width: 100%;
+ left: 0;
+ border: 0 !important;
+ box-shadow: none;
+ }
+ .mobile-menu .dropdown:after {
+ display: none;
+ }
+ .mobile-menu ul.dropdown-menu.active {
+ display: block !important;
+ }
+ .mobile-menu .module-group .module.left {
+ float: none;
+ display: block;
+ }
+ .mobile-menu .main-navigation .menu > li ul {
+ position: relative;
+ width: 100%;
+ opacity: 1;
+ visibility: visible;
+ transform: translate3d(0, 0px, 0);
+ -webkit-transform: translate3d(0, 0px, 0);
+ -moz-transform: translate3d(0, 0px, 0);
+ left: 0;
+ border: 0 !important;
+ box-shadow: none;
+ }
+ .mobile-menu .main-navigation .menu > li > ul > li ul {
+ left: 0 !important;
+ display: none;
+ padding: 0;
+ }
+ .mobile-menu #site-navigation.main-navigation .menu > li > ul li a {
+ width: auto;
+ display: inline-block;
+ padding: 10px 16px;
+ }
+ .mobile-menu .main-navigation .menu > li > ul li a {
+ padding: 10px 16px;
+ }
+ .mobile-menu .main-navigation .dropdown .dropdown li {
+ padding-left: 18px;
+ }
+ .mobile-menu .main-navigation .menu > li > ul li a:hover,
+ .mobile-menu .main-navigation .menu > li > ul li:hover > a {
+ background-color: #fff;
+ }
+ .mobile-menu .search-widget-handle .search {
+ padding: 0 15px;
+ }
+ .mobile-menu .widget-handle .function {
+ width: 100%;
+ max-width: 300px;
+ position: relative;
+ opacity: 1;
+ transform: translate3d(0, 0px, 0);
+ -webkit-transform: translate3d(0, 0px, 0);
+ -moz-transform: translate3d(0, 0px, 0);
+ visibility: visible;
+ margin-top: 0;
+ display: none;
+ box-shadow: none !important;
+ }
+ .mobile-menu .module.widget-handle .title {
+ display: inline-block;
+ position: relative;
+ bottom: 3px;
+ margin-left: 8px;
+ }
+ .mobile-menu .toggle-search .function {
+ display: block;
+ }
+}
+
@media all and (max-width: 991px) {
.site-title-container {
width: 84%;
}
- .nav-bar, .nav-bar .module-group, .nav-bar .module {
+ .nav-bar, .nav-bar .module-group, .nav-bar .module, .nav-bar .module:not( .site-title-container ) {
height: auto;
}
@@ -1957,6 +2094,12 @@ nav.fixed.scrolled {
.mobile-toggle i {
line-height: 53px !important;
}
+ #site-navigation .container > .flex-row {
+ flex-wrap: wrap;
+ }
+ .navbar-collapse {
+ margin-top: 20px;
+ }
}
/*!---------- 8. FORMS ----------*/
@@ -2942,6 +3085,26 @@ iframe {
.project .image-tile {
margin: 0;
}
+.project:not( .masonry-item ) .image-tile {
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: cover;
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.project:not( .masonry-item ) .image-tile a {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.project:not( .masonry-item ) {
+ padding-bottom: 25%;
+ position: relative;
+ margin-bottom: 0;
+}
/*!---------- 21. FOOTER ----------*/
@@ -3984,7 +4147,8 @@ footer.bg-dark a {
.author-bio-left-side .author-bio .author-social li a {
color: #001c28; }
-.single-post .entry-content .dropcaps-content > p:first-child:first-letter {
+.single-post .entry-content .dropcaps-content > p:first-child:first-letter,
+.single-jetpack-portfolio .entry-content .dropcaps-content > p:first-child:first-letter {
float: left;
font-size: 57px;
margin: 10px;
diff --git a/template-parts/content-attachment.php b/template-parts/content-attachment.php
index 5867fbc..57fadd1 100644
--- a/template-parts/content-attachment.php
+++ b/template-parts/content-attachment.php
@@ -12,7 +12,8 @@
>
+ if ( has_post_thumbnail() ) {
+ ?>
-
+
-
+
diff --git a/template-parts/content-grid-small.php b/template-parts/content-grid-small.php
index d32fee7..af15730 100644
--- a/template-parts/content-grid-small.php
+++ b/template-parts/content-grid-small.php
@@ -54,24 +54,32 @@
+ shapely_posted_on_no_cat();
+ ?>
+
→', 'shapely' ), array(
- 'span' => array(
- 'class' => array(),
- ),
- ) ),
- the_title( '"', '"', false )
- ) );
+ the_content(
+ sprintf(
+ /* translators: %s: Name of current post. */
+ wp_kses(
+ __( 'Read more %s →', 'shapely' ), array(
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ ),
+ the_title( '"', '"', false )
+ )
+ );
- wp_link_pages( array(
- 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
- 'after' => ' ',
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
?>
diff --git a/template-parts/content-grid-wide.php b/template-parts/content-grid-wide.php
index fe78914..08125ca 100644
--- a/template-parts/content-grid-wide.php
+++ b/template-parts/content-grid-wide.php
@@ -61,24 +61,32 @@
+ shapely_posted_on_no_cat();
+ ?>
+
→', 'shapely' ), array(
- 'span' => array(
- 'class' => array(),
- ),
- ) ),
- the_title( '"', '"', false )
- ) );
+ the_content(
+ sprintf(
+ /* translators: %s: Name of current post. */
+ wp_kses(
+ __( 'Read more %s →', 'shapely' ), array(
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ ),
+ the_title( '"', '"', false )
+ )
+ );
- wp_link_pages( array(
- 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
- 'after' => ' ',
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
?>
diff --git a/template-parts/content-none.php b/template-parts/content-none.php
index c3cc161..7964c92 100644
--- a/template-parts/content-none.php
+++ b/template-parts/content-none.php
@@ -16,7 +16,8 @@
+ if ( is_home() && current_user_can( 'publish_posts' ) ) :
+ ?>
diff --git a/template-parts/content-page.php b/template-parts/content-page.php
index fbe6163..787ce03 100644
--- a/template-parts/content-page.php
+++ b/template-parts/content-page.php
@@ -2,7 +2,8 @@
>
+ if ( has_post_thumbnail() ) {
+ ?>
-
+
-
+
diff --git a/template-parts/content-portfolio.php b/template-parts/content-portfolio.php
new file mode 100644
index 0000000..ce69d27
--- /dev/null
+++ b/template-parts/content-portfolio.php
@@ -0,0 +1,141 @@
+
+>
+
+ array(
+ 'data-srcset' => true,
+ 'data-src' => true,
+ 'srcset' => true,
+ 'sizes' => true,
+ 'src' => true,
+ 'class' => true,
+ 'alt' => true,
+ 'width' => true,
+ 'height' => true,
+ ),
+ 'noscript' => array(),
+ );
+ ?>
+
+
+
+
+
+
+
+ name ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
+ ?>
+
+
+
+
+ '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
+ ?>
+
+
+
+
+ ', $prev );
+ $prev = str_replace( ' ', ' ', $prev );
+ $next = get_next_post_link();
+ $next = str_replace( '»', ' ', $next );
+ $next = str_replace( '
+
+
+
+
+
+
+
+
+
+ ' . $tags_list . ' ' : '';
+ endif;
+ ?>
+
+
+
diff --git a/template-parts/content-search.php b/template-parts/content-search.php
index e8faa0a..9456413 100644
--- a/template-parts/content-search.php
+++ b/template-parts/content-search.php
@@ -50,7 +50,9 @@
+ shapely_posted_on_no_cat();
+ ?>
+
diff --git a/template-parts/content.php b/template-parts/content.php
index 2f85440..0cd8640 100644
--- a/template-parts/content.php
+++ b/template-parts/content.php
@@ -54,11 +54,12 @@
-
-
+
+ shapely_posted_on_no_cat();
+ ?>
+
@@ -81,10 +84,12 @@
'' . esc_html__( 'Pages:', 'shapely' ),
- 'after' => ' ',
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
?>
@@ -93,10 +98,12 @@
'' . esc_html__( 'Pages:', 'shapely' ),
- 'after' => ' ',
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'shapely' ),
+ 'after' => ' ',
+ )
+ );
?>
@@ -113,10 +120,10 @@
?>
-
+
-
+
diff --git a/template-parts/layouts/blog-grid.php b/template-parts/layouts/blog-grid.php
index 07e6c88..7bb249b 100644
--- a/template-parts/layouts/blog-grid.php
+++ b/template-parts/layouts/blog-grid.php
@@ -4,7 +4,8 @@
current_post + 1;
/*
* Include the Post-Format-specific template for the content.
diff --git a/template-parts/layouts/blog-large-image-grid.php b/template-parts/layouts/blog-large-image-grid.php
index 8c23b06..cb7be28 100644
--- a/template-parts/layouts/blog-large-image-grid.php
+++ b/template-parts/layouts/blog-large-image-grid.php
@@ -2,7 +2,8 @@
/* Start the Loop */
global $wp_query;
-while ( have_posts() ) : the_post();
+while ( have_posts() ) :
+ the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
diff --git a/template-parts/layouts/blog-large-image.php b/template-parts/layouts/blog-large-image.php
index ec478b5..e26ccba 100644
--- a/template-parts/layouts/blog-large-image.php
+++ b/template-parts/layouts/blog-large-image.php
@@ -2,7 +2,8 @@
/* Start the Loop */
global $wp_query;
-while ( have_posts() ) : the_post();
+while ( have_posts() ) :
+ the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
diff --git a/woocommerce/product-searchform.php b/woocommerce/product-searchform.php
index 85e16b4..5ba8034 100644
--- a/woocommerce/product-searchform.php
+++ b/woocommerce/product-searchform.php
@@ -24,6 +24,6 @@
> +
+
+ if ( $breadcrumbs_enabled ) {
+ ?>
', '' ); ?>
@@ -615,13 +703,16 @@ class="
> + echo get_the_title(); + } + ?>
+ ' . wp_kses_post( $portfolio_description ) . ''; + } + } + + ?>- +
-
+
-
-
+ 'ids', - 'hide_empty' => 1, - 'number' => 2, - ) ); + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + 'hide_empty' => 1, + 'number' => 2, + ) + ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); diff --git a/index.php b/index.php index eb74ad3..f04820e 100644 --- a/index.php +++ b/index.php @@ -12,36 +12,39 @@ * @package Shapely */ get_header(); ?> - +' . get_search_query() . '' ); ?>
@@ -26,7 +27,8 @@ + endif; + ?> diff --git a/single-jetpack-portfolio.php b/single-jetpack-portfolio.php new file mode 100644 index 0000000..f318801 --- /dev/null +++ b/single-jetpack-portfolio.php @@ -0,0 +1,40 @@ + + ++ else : + ?>
+ endif; + ?>+ +
+ + + +
@@ -67,7 +68,9 @@