commit 7e9be1c12fcda0bc383ab7e9f3872fdf0633cd1d Author: humorwang <417791635@qq.com> Date: Mon Dec 27 13:34:36 2021 +0800 first commit diff --git a/404.php b/404.php new file mode 100644 index 0000000..0ac372e --- /dev/null +++ b/404.php @@ -0,0 +1,20 @@ + + +

+ +

+ +

+ + + diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..dc89c63 --- /dev/null +++ b/archive.php @@ -0,0 +1,74 @@ + + + + +
+
+ + + +
+ ', '' ); + the_archive_description( '
', '
' ); + ?> +
+ + + +
+ + + + + + + + +
+ + '', + 'next_text' => '', + ) ); ?> + + + + + + + +
+
+ + + + + + diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..70e259e --- /dev/null +++ b/comments.php @@ -0,0 +1,78 @@ + + +
+ + +

+ +

+ + + + '' . esc_html__( 'Previous', 'cordero' ) . '', + 'next_text' => '' . esc_html__( 'Next', 'cordero' ) . '', + ) ); + + endif; // Check for have_comments(). + + // If comments are closed and there are comments, let's leave a little note, shall we? + if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> + +

+ + +
diff --git a/content-front-page.php b/content-front-page.php new file mode 100644 index 0000000..cee7980 --- /dev/null +++ b/content-front-page.php @@ -0,0 +1,36 @@ + + +
> + +
> + + '', + ) ); + ?> +
+ + + +
diff --git a/content-no-title.php b/content-no-title.php new file mode 100644 index 0000000..0f64a44 --- /dev/null +++ b/content-no-title.php @@ -0,0 +1,36 @@ + + +
> + +
> + + '', + ) ); + ?> +
+ + + +
diff --git a/content-none.php b/content-none.php new file mode 100644 index 0000000..e332986 --- /dev/null +++ b/content-none.php @@ -0,0 +1,31 @@ + + +
+

+
+ + +

Get started here.', 'cordero' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

+ + + +

+ + + + +

+ + + +
+
diff --git a/content-page.php b/content-page.php new file mode 100644 index 0000000..ee9a7a6 --- /dev/null +++ b/content-page.php @@ -0,0 +1,40 @@ + + +
> + + + +
> + + '', + ) ); + ?> +
+ + + +
diff --git a/content-related.php b/content-related.php new file mode 100644 index 0000000..da3e128 --- /dev/null +++ b/content-related.php @@ -0,0 +1,114 @@ + get_theme_mod( 'related_posts', '4' ), + 'category' => $categories, + 'exclude' => get_the_id() +) ); + +if ( count( $related_posts ) > 0 ) { + ?> + +
+

+
+ ID; + ?> +
> + + post_content ); + $video = false; + // Only get video from the content if a playlist isn't present. + if ( false === strpos( $video_content, 'wp-playlist-script' ) ) { + $video = get_media_embedded_in_content( $video_content, array( 'video', 'object', 'embed', 'iframe' ) ); + } + if ( ! empty( $video ) ) { + + $first_video = true; + foreach ( $video as $video_html ) { + if ( $first_video ) { + echo '
'; + echo $video_html; + echo '
'; + $first_video = false; + } + } + } else { + cordero_related_post_thumbnail($related_id); + } + } else { + cordero_related_post_thumbnail($related_id); + } + ?> + +
+ +

>

+ ' . wp_kses_post( get_the_title($related_id) ) . ''; + } + ?> +
+ + + +
> + + + +
+ + + +
+ +
+
+ + + +
> + + '; + echo $video_html; + echo ''; + $first_video = false; + } + } + } else { + cordero_post_thumbnail(); + } + } else { + cordero_post_thumbnail(); + } + ?> + +
+ +

>

+ ', '' ); + } + ?> +
+ +
> + '', + ) ); + cordero_read_more(); + ?> +
+ +
diff --git a/content-single-no-title.php b/content-single-no-title.php new file mode 100644 index 0000000..92c23fd --- /dev/null +++ b/content-single-no-title.php @@ -0,0 +1,43 @@ + + +
> + +
> + '', + ) ); + ?> + +
+ + + +
diff --git a/content-single.php b/content-single.php new file mode 100644 index 0000000..86ebc62 --- /dev/null +++ b/content-single.php @@ -0,0 +1,50 @@ + + +
> + +
+ ', '' ); ?> +
+ +
> + '', + ) ); + ?> + +
+ + + +
diff --git a/content.php b/content.php new file mode 100644 index 0000000..766a5e9 --- /dev/null +++ b/content.php @@ -0,0 +1,85 @@ + + +
> + + '; + echo $video_html; + echo ''; + $first_video = false; + } + } + } else { + cordero_post_thumbnail(); + } + } else { + cordero_post_thumbnail(); + } + ?> + +
+ +

>

+ ', '' ); + } + ?> +
+ +
+ +
+ +
> + '', + ) ); + cordero_read_more(); + ?> +
+ +
+ +
+ +
diff --git a/css/block-editor-style.css b/css/block-editor-style.css new file mode 100644 index 0000000..ac11f77 --- /dev/null +++ b/css/block-editor-style.css @@ -0,0 +1,1647 @@ +/* +Theme Name: Cordero +Description: Used to style the block editor. +*/ + +.edit-post-layout .interface-interface-skeleton__content{ + background-color: #fff; + overflow-x: hidden; +} + +.block-editor-editor-skeleton__body{ + background-color: #fff; +} + +.edit-post-visual-editor{ + background-color: #fff; + width: 100%; + max-width: 1240px; + margin-left: auto; + margin-right: auto; + border-left: 1px dashed rgba(0,0,0,0.1); + border-right: 1px dashed rgba(0,0,0,0.1); +} + +.edit-post-visual-editor.editor-styles-wrapper{ + padding: 0; +} + +.block-editor-block-list__layout .wp-block{ + margin-left: 0; + margin-right: 0; +} + +.wp-block, +.wp-block[data-align="wide"]{ + max-width: 100%; +} + +.edit-post-layout .wp-block[data-align="full"]{ + margin-left: -webkit-calc(-50vw + 50%) !important; + margin-left: calc(-50vw + 50%) !important; + margin-right: -webkit-calc(-50vw + 50%) !important; + margin-right: calc(-50vw + 50%) !important; +} + +.edit-post-layout.is-sidebar-opened .wp-block[data-align="full"]{ + margin-left: -webkit-calc(-50vw + 50% + 140px) !important; + margin-left: calc(-50vw + 50% + 140px) !important; + margin-right: -webkit-calc(-50vw + 50% + 140px) !important; + margin-right: calc(-50vw + 50% + 140px) !important; +} + +.edit-post-layout .edit-post-visual-editor[style*="width"] .wp-block[data-align="full"], +.edit-post-layout.is-sidebar-opened .edit-post-visual-editor[style*="width"] .wp-block[data-align="full"]{ + margin-left: 0 !important; + margin-right: 0 !important; +} + +.editor-post-title__block .editor-post-title__input{ + font-family: 'Montserrat'; + font-size: 1.875em; + font-weight: normal; +} + +.editor-default-block-appender textarea.editor-default-block-appender__content{ + font-family: 'Work Sans'; +} + +.editor-styles-wrapper div{ + font-family: 'Work Sans'; +} + +.editor-styles-wrapper{ + line-height: 1.6; +} + +.editor-styles-wrapper p, +.editor-styles-wrapper ul, +.editor-styles-wrapper li{ + color: #313131; + font-family: 'Work Sans'; + font-size: 16px; + font-weight: 300; + line-height: 1.6; + margin-top: 0 !important; +} + +.editor-styles-wrapper p, +.editor-styles-wrapper ul{ + margin-bottom: 1em !important; +} + +.editor-styles-wrapper li{ + margin-bottom: 0 !important; +} + +.editor-styles-wrapper h1, +.editor-styles-wrapper h2, +.editor-styles-wrapper h3, +.editor-styles-wrapper h4, +.editor-styles-wrapper h5, +.editor-styles-wrapper h6{ + color: #313131; + font-weight: normal; + line-height: 1.2; + font-family: 'Montserrat'; + margin-top: 0 !important; + margin-bottom: 0.5em !important; +} + +.editor-styles-wrapper .wp-block-heading h1, +.editor-styles-wrapper h1{ + font-size: 1.875em; +} + +.editor-styles-wrapper .wp-block-heading h2, +.editor-styles-wrapper h2{ + font-size: 1.75em; +} + +.editor-styles-wrapper .wp-block-heading h3, +.editor-styles-wrapper h3{ + font-size: 1.625em; +} + +.editor-styles-wrapper .wp-block-heading h4, +.editor-styles-wrapper h4{ + font-size: 1.5em; +} + +.editor-styles-wrapper .wp-block-heading h5, +.editor-styles-wrapper h5{ + font-size: 1.375em; +} + +.editor-styles-wrapper .wp-block-heading h6, +.editor-styles-wrapper h6{ + font-size: 1.125em; +} + +.editor-rich-text__tinymce a, +.block-editor-rich-text__editable a{ + color: #d82978; + text-decoration: none; +} + +[data-type="core/image"][data-align="wide"] .wp-block-image{ + width: 100%; +} + +.block-editor-block-list__block{ + margin-top: 0; + margin-bottom: 0; +} + +b, strong{ + font-weight: bold; +} + +.wp-block-cover, +.wp-block-cover-image{ + color: #fff; +} + +[data-align="full"] .wp-block-cover-image > .wp-block-cover-image__inner-container > .wp-block-group, +[data-align="full"] .wp-block-cover > .wp-block-cover__inner-container > .wp-block-group, +[data-align="full"] .wp-block-group > .wp-block-group__inner-container > .wp-block-group{ + max-width: 1240px; + margin-left: auto; + margin-right: auto; +} + +.wp-block-button__link{ + background-color: #d82978; + border-radius: 0; + font-size: 1em; + color: #fff; + margin-bottom: 1em; + padding: .5em 1em; +} + +.is-style-outline .wp-block-button__link{ + color: #313131; +} + +.wp-block-latest-posts.is-grid{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 3%; + grid-row-gap: 2em; +} + +.wp-block-latest-posts.is-grid.columns-2{ + grid-template-columns: 48.5% 48.5%; +} + +.wp-block-latest-posts.is-grid.columns-3{ + grid-template-columns: repeat(3,31.333333%); +} + +.wp-block-latest-posts.is-grid.columns-4{ + grid-template-columns: repeat(4,22.75%); +} + +.wp-block-latest-posts.is-grid.columns-5{ + grid-column-gap: 2%; + grid-row-gap: 1.33em; + grid-template-columns: repeat(5,18.4%); +} + +.wp-block-latest-posts.is-grid.columns-6{ + grid-column-gap: 2%; + grid-row-gap: 1.33em; + grid-template-columns: repeat(6,15%); +} + +.wp-block-latest-posts.columns-2 li, +.wp-block-latest-posts.columns-3 li, +.wp-block-latest-posts.columns-4 li, +.wp-block-latest-posts.columns-5 li, +.wp-block-latest-posts.columns-6 li{ + width: 100%; +} + +@media (max-width: 768px){ + .wp-block-latest-posts.is-grid.columns-2, + .wp-block-latest-posts.is-grid.columns-3, + .wp-block-latest-posts.is-grid.columns-4, + .wp-block-latest-posts.is-grid.columns-5, + .wp-block-latest-posts.is-grid.columns-6{ + grid-column-gap: 3%; + grid-row-gap: 2em; + grid-template-columns: 48.5% 48.5%; + } +} + +@media (max-width: 480px){ + .wp-block-latest-posts.is-grid.columns-2, + .wp-block-latest-posts.is-grid.columns-3, + .wp-block-latest-posts.is-grid.columns-4, + .wp-block-latest-posts.is-grid.columns-5, + .wp-block-latest-posts.is-grid.columns-6{ + grid-template-columns: 100%; + } +} + +.wp-block-latest-posts.is-grid li{ + margin: 0; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__featured-image > img{ + width: 100%; +} + +.wp-block-latest-posts.is-grid li > a{ + font-size: 1.25em; + font-weight: normal; + margin: 1rem 0 0 0; + color: #d82978; + text-decoration: none; +} + +.wp-block-latest-posts.is-grid li > a > div{ + font-family: 'Montserrat'; +} + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__post-date{ + font-size: .8125em; + margin: 0; + color: inherit; + opacity: .7; +} + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__post-excerpt{ + margin: 0 0 1em 0; +} + +.wp-block-group.has-background, +p.has-background{ + padding: 1em 1.5em !important; +} + +.has-drop-cap:not(:focus)::first-letter{ + font-size: 6em; + font-weight: normal; + margin: 0.05em 0.1em 0 0; +} + +.has-drop-cap:not(:focus)::first-letter::after{ + content: ""; + display: table; + clear: both; +} + +.has-drop-cap:not(:focus)::after{ + padding: 0; +} + +hr.wp-block-separator{ + background-color: rgba(0,0,0,0.1); + border: 0; + height: 4px !important; + width: 20%; +} + +.wp-block-separator:not(.is-style-wide):not(.is-style-dots), +.wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots){ + height: 4px; + max-width: 20%; +} + +hr.wp-block-separator.extra-small, +hr.wp-block-separator.is-style-extra-small{ + width: 1em; + max-width: 100% !important; +} + +hr.wp-block-separator.small, +hr.wp-block-separator.is-style-small{ + width: 4em; + max-width: 100% !important; +} + +hr.wp-block-separator.medium, +hr.wp-block-separator.is-style-medium{ + width: 10em; + max-width: 100% !important; +} + +hr.wp-block-separator.large, +hr.wp-block-separator.is-style-large{ + width: 16em; + max-width: 100% !important; +} + +hr.wp-block-separator.extra-large, +hr.wp-block-separator.is-style-extra-large{ + width: 22em; + max-width: 100% !important; +} + +hr.wp-block-separator.huge, +hr.wp-block-separator.is-style-huge{ + width: 28em; + max-width: 100% !important; +} + +hr.wp-block-separator.align-left, +hr.wp-block-separator.is-style-align-left{ + margin-left: 0; +} + +hr.wp-block-separator.align-right, +hr.wp-block-separator.is-style-align-right{ + margin-right: 0; +} + +.wp-block-separator.is-style-wide{ + width: 100%; +} + +.wp-block-separator.is-style-dots{ + width: auto; +} + +.wp-block-separator.is-style-dots::before{ + font-size: 2em; + color: initial; +} + +.wp-block-quote{ + border-left: 4px solid #313131; + padding: 1em 0 0 0; + margin: 0 0 1em; +} + +.wp-block-pullquote{ + border-left: none; + border-top: 4px solid #313131; + border-bottom: 4px solid #313131; + padding: 3em 0 3em 0; + margin: 0 0 1em; +} + +.wp-block-pullquote blockquote{ + border-left: none; +} + +.editor-styles-wrapper .has-tiny-font-size, +.has-tiny-font-size{ + font-size: 10px; +} + +.editor-styles-wrapper .has-small-font-size, +.has-small-font-size{ + font-size: 13px; +} + +.editor-styles-wrapper .has-normal-font-size, +.has-normal-font-size{ + font-size: 16px; +} + +.editor-styles-wrapper .has-medium-font-size, +.has-medium-font-size{ + font-size: 24px; +} + +.editor-styles-wrapper .has-large-font-size, +.has-large-font-size{ + font-size: 36px; +} + +.editor-styles-wrapper .has-huge-font-size, +.has-huge-font-size{ + font-size: 48px; +} + +.editor-styles-wrapper .has-gigantic-font-size, +.has-gigantic-font-size{ + font-size: 60px; +} + +.editor-styles-wrapper .has-massive-font-size, +.has-massive-font-size{ + font-size: 72px; +} + +@media (min-width:600px) and (max-width: 781px){ + .editor-styles-wrapper .has-medium-font-size, + .has-medium-font-size{ + font-size: 20px; + } + + .editor-styles-wrapper .has-large-font-size, + .has-large-font-size{ + font-size: 27px; + } + + .editor-styles-wrapper .has-huge-font-size, + .has-huge-font-size{ + font-size: 36px; + } + + .editor-styles-wrapper .has-gigantic-font-size, + .has-gigantic-font-size{ + font-size: 45px; + } + + .editor-styles-wrapper .has-massive-font-size, + .has-massive-font-size{ + font-size: 54px; + } +} + +@media (max-width:599px){ + .editor-styles-wrapper .has-medium-font-size, + .has-medium-font-size{ + font-size: 18px; + } + + .editor-styles-wrapper .has-large-font-size, + .has-large-font-size{ + font-size: 23px; + } + + .editor-styles-wrapper .has-huge-font-size, + .has-huge-font-size{ + font-size: 30px; + } + + .editor-styles-wrapper .has-gigantic-font-size, + .has-gigantic-font-size{ + font-size: 36px; + } + + .editor-styles-wrapper .has-massive-font-size, + .has-massive-font-size{ + font-size: 44px; + } +} + +/*-------------------------------------------------------------- +## WooCommerce +--------------------------------------------------------------*/ + +.wc-block-attribute-filter .wc-block-attribute-filter-list li{ + text-decoration: none; +} + +.wc-block-active-filters .wc-block-active-filters__clear-all{ + color: inherit; +} + +.wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress, +.rtl .wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress{ + --range-color: #d82978; +} + +.wc-block-price-filter .wc-block-price-filter__range-input-wrapper input[type="range"]:focus{ + border: none; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__controls .wc-block-price-filter__amount{ + border-radius: 0; +} + +.wc-block-featured-product, +.wc-block-featured-category{ + background-color: #2d2354; + overflow: hidden; +} + +.wc-block-featured-product .wc-block-featured-product__price{ + font-size: 1.25em; +} + +.wc-block-featured-product .wc-block-featured-product__description p{ + color: #fff; + background: transparent; +} + +.wc-block-grid .wc-block-grid__products, +.wc-block-grid__products{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 1%; + grid-row-gap: 1em; +} + +.wc-block-grid.has-1-columns .wc-block-grid__products{ + grid-template-columns: 100%; +} + +.wc-block-grid.has-2-columns .wc-block-grid__products{ + grid-template-columns: 49.5% 49.5%; +} + +.wc-block-grid.has-3-columns .wc-block-grid__products{ + grid-template-columns: repeat(3,32.666666%); +} + +.wc-block-grid.has-4-columns .wc-block-grid__products{ + grid-template-columns: repeat(4,24.25%); +} + +.wc-block-grid.has-5-columns .wc-block-grid__products{ + grid-template-columns: repeat(5,19.2%); +} + +.wc-block-grid.has-6-columns .wc-block-grid__products{ + grid-template-columns: repeat(6,15.833333%); +} + +.wc-block-grid.has-7-columns .wc-block-grid__products{ + grid-template-columns: repeat(7,13.428571%); +} + +.wc-block-grid.has-8-columns .wc-block-grid__products{ + grid-template-columns: repeat(8,11.625%); +} + +.wc-block-grid.has-2-columns .wc-block-grid__product, +.wc-block-grid.has-3-columns .wc-block-grid__product, +.wc-block-grid.has-4-columns .wc-block-grid__product, +.wc-block-grid.has-5-columns .wc-block-grid__product, +.wc-block-grid.has-6-columns .wc-block-grid__product, +.wc-block-grid.has-7-columns .wc-block-grid__product, +.wc-block-grid.has-8-columns .wc-block-grid__product{ + max-width: 100%; +} + +.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-5-columns:not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-6-columns:not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-7-columns .wc-block-grid__product, +.wc-block-grid.has-8-columns .wc-block-grid__product{ + font-size: 1em; +} + +.wc-block-grid__product{ + background: #fbfbfb; + border: 1px solid #f1f1f1; + margin: 0 !important; + padding: 0 !important; + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1 1 auto; + overflow: hidden; +} + +.wc-block-grid__product .wc-block-grid__product-image{ + margin: 0; +} + +.wc-block-grid__product .wc-block-grid__product-image img{ + width: 100%; +} + +.wc-block-grid__product .product-extra-img{ + display: none; +} + +.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product a.wc-block-grid__product-link{ + text-decoration: none; +} + +.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title, +.wc-block-grid__product .wc-block-grid__product-title{ + padding: 0; + margin: 1em 0 .5em; + font-size: 1.125em; + font-weight: normal; + font-family: 'Montserrat'; + color: #313131; +} + +.wc-block-grid__product .wc-block-grid__product-price{ + padding: 0; + margin: 0 0 .5em; + font-size: 1em; + font-weight: 300; +} + +.wc-block-grid__product .wc-block-grid__product-price del{ + opacity: .5; +} + +.wc-block-grid__product .wc-block-grid__product-price ins{ + background: 0 0; + font-weight: 400; + text-decoration: none; +} + +.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale, +.wc-block-grid__product-onsale{ + background-color: #d82978; + margin: 0; + padding: .25em .5em; + position: absolute; + top: 0; + left: 0; + right: auto; + font-weight: normal; + min-width: auto; + min-height: auto; + line-height: 2em; + border-radius: 0; + border: none; + color: #fff; + text-transform: none; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart{ + margin: 0; + border-top: 1px solid #f1f1f1; + padding-bottom: 0 !important; + color: #d82978; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button, +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart{ + position: relative; + background: transparent; + color: #d82978; + padding: 1em 1.25em 1em 0; + font-weight: 400; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button[href*="add-to-cart"]{ + padding: 1em 0 1em 1.25em; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button:before{ + position: absolute; + top: auto; + right: 0; + font-family: 'dashicons'; + content: "\f345"; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button[href*="add-to-cart"]:before{ + position: absolute; + top: auto; + right: auto; + left: 0; + font-family: 'dashicons'; + content: "\f174"; +} + +/*-------------------------------------------------------------- +## Block Styles +--------------------------------------------------------------*/ + +.is-style-rc-1{ + border-radius: 1px; +} +.is-style-rc-2{ + border-radius: 2px; +} +.is-style-rc-3{ + border-radius: 3px; +} +.is-style-rc-4{ + border-radius: 4px; +} +.is-style-rc-5{ + border-radius: 5px; +} +.is-style-rc-6{ + border-radius: 6px; +} +.is-style-rc-7{ + border-radius: 7px; +} +.is-style-rc-8{ + border-radius: 8px; +} +.is-style-rc-9{ + border-radius: 9px; +} +.is-style-rc-10{ + border-radius: 10px; +} +.is-style-rc-11{ + border-radius: 11px; +} +.is-style-rc-12{ + border-radius: 12px; +} +.is-style-rc-13{ + border-radius: 13px; +} +.is-style-rc-14{ + border-radius: 14px; +} +.is-style-rc-15{ + border-radius: 15px; +} +.is-style-rc-16{ + border-radius: 16px; +} +.is-style-rc-17{ + border-radius: 17px; +} +.is-style-rc-18{ + border-radius: 18px; +} +.is-style-rc-19{ + border-radius: 19px; +} +.is-style-rc-20{ + border-radius: 20px; +} + +.is-style-content-width{ + width: max-content; + margin: 0; + margin-bottom: 0 !important; +} + +.is-style-content-width.has-background{ + padding: 0.125em !important; +} + +.is-style-content-width.has-text-align-left{ + margin: 0 auto 0 0; + margin-bottom: 0 !important; +} + +.is-style-content-width.has-text-align-center{ + margin: 0 auto; + margin-bottom: 0 !important; +} + +.is-style-content-width.has-text-align-right{ + margin: 0 0 0 auto; + margin-bottom: 0 !important; +} + +.editor-styles-wrapper p.is-style-zero-margin, +.editor-styles-wrapper h1.is-style-zero-margin, +.editor-styles-wrapper h2.is-style-zero-margin, +.editor-styles-wrapper h3.is-style-zero-margin, +.editor-styles-wrapper h4.is-style-zero-margin, +.editor-styles-wrapper h5.is-style-zero-margin, +.editor-styles-wrapper h6.is-style-zero-margin{ + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.is-style-translucent{ + opacity: 0.8; +} + +.is-style-with-separator{ + display: flex; + align-items: center; +} + +.is-style-with-separator:before, +.is-style-with-separator:after{ + border-radius: 0 !important; +} + +.is-style-with-separator:before, +.is-style-with-separator:after, +.is-style-with-separator-2:before, +.is-style-with-separator-2:after{ + height: 0 !important; + position: relative !important; +} + +.is-style-with-separator:after{ + display: block; + content: ""; + margin-left: .5em; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-right.is-style-with-separator:after{ + display: none; +} + +.has-text-align-right.is-style-with-separator:before{ + display: block; + content: ""; + margin-right: .5em; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator:before, +.has-text-align-center.is-style-with-separator:after{ + display: block; + content: ""; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator:before{ + margin-right: .5em; +} + +.has-text-align-center.is-style-with-separator:after{ + margin-left: .5em; +} + +p.is-style-with-separator:after, +p.has-text-align-right.is-style-with-separator:before, +p.has-text-align-center.is-style-with-separator:before, +p.has-text-align-center.is-style-with-separator:after{ + border-bottom: 1px solid; +} + +.is-style-with-separator-2{ + display: flex; + align-items: center; +} + +.is-style-with-separator-2:after{ + display: block; + content: ""; + margin-left: .5em; + border: .125em solid; + border-radius: .125em !important; + flex-grow: 1; +} + +.has-text-align-right.is-style-with-separator-2:after{ + display: none; +} + +.has-text-align-right.is-style-with-separator-2:before{ + display: block; + content: ""; + margin-right: .5em; + border: .125em solid; + border-radius: .125em !important; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator-2:before, +.has-text-align-center.is-style-with-separator-2:after{ + display: block; + content: ""; + border: .125em solid; + border-radius: .125em !important; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator-2:before{ + margin-right: .5em; +} + +.has-text-align-center.is-style-with-separator-2:after{ + margin-left: .5em; +} + +.wp-block-cover.is-style-no-padding, +.wp-block-cover-image.is-style-no-padding{ + padding: 0; +} + +.block-editor-block-list__block.wp-block-cover.is-style-no-padding .block-list-appender, +.block-editor-block-list__block.wp-block-cover-image.is-style-no-padding .block-list-appender{ + margin: 0; +} + +.is-style-point-down{ + clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%); +} + +.is-style-point-up{ + clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%); +} + +.is-style-box-shadow{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-image.is-style-box-shadow{ + box-shadow: none; +} + +.wp-block-image.is-style-box-shadow img{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1); +} + +.wp-block-image.is-style-chevron-left img{ + clip-path: polygon(100% 0%, 75% 50%, 100% 100%, 25% 100%, 0% 50%, 25% 0%); +} + +.wp-block-image.is-style-chevron-right img{ + clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%); +} + +.wp-block-image.is-style-point-down, +.wp-block-image.is-style-point-up{ + clip-path: none; +} + +.wp-block-image.is-style-point-down img{ + clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%); +} + +.wp-block-image.is-style-point-up img{ + clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%); +} + +.wp-block-group.is-style-quote p:first-of-type, +.wp-block-group.is-style-quote p:last-of-type{ + position: relative; +} + +.wp-block-group.is-style-quote p:last-of-type{ + padding-bottom: .33em; +} + +.wp-block-group.is-style-quote p:first-of-type:before, +.wp-block-group.is-style-quote p:last-of-type:after{ + font-family: dashicons; + content: "\f122"; + display: inline-block; + position: relative; + font-size: 2em; + opacity: .25; +} + +.wp-block-group.is-style-quote p:first-of-type:before{ + top: 0; + right: -.33em; +} + +.wp-block-group.is-style-quote p:last-of-type:after{ + vertical-align: text-top; + transform: rotate(180deg); + top: .165em; + left: -.33em; +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-bordered .blocks-gallery-image, +.wp-block-gallery.is-style-bordered .blocks-gallery-item{ + border-radius: 10px; + padding: 10px; + background-color: rgba(0,0,0,0.1); +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image figure img, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item figure img, +.wp-block-gallery.is-style-bordered .blocks-gallery-image figure img, +.wp-block-gallery.is-style-bordered .blocks-gallery-item figure img{ + border-radius: 6px; +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image figcaption, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item figcaption, +.wp-block-gallery.is-style-bordered .blocks-gallery-image figcaption, +.wp-block-gallery.is-style-bordered .blocks-gallery-item figcaption{ + bottom: 10px; + width: calc(100% - 20px); + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +.is-style-box-shadow .blocks-gallery-grid, +.wp-block-gallery.is-style-box-shadow{ + box-shadow: none; +} + +.is-style-box-shadow .blocks-gallery-grid .blocks-gallery-image, +.is-style-box-shadow .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-box-shadow .blocks-gallery-image, +.wp-block-gallery.is-style-boc-shadow .blocks-gallery-item{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1); +} + +.is-style-framed .blocks-gallery-grid .blocks-gallery-image, +.is-style-framed .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-framed .blocks-gallery-image, +.wp-block-gallery.is-style-framed .blocks-gallery-item{ + padding: 5px; + border: 5px solid rgba(0,0,0,0.1); +} + +.is-style-framed .blocks-gallery-grid .blocks-gallery-image figcaption, +.is-style-framed .blocks-gallery-grid .blocks-gallery-item figcaption, +.wp-block-gallery.is-style-framed .blocks-gallery-image figcaption, +.wp-block-gallery.is-style-framed .blocks-gallery-item figcaption{ + bottom: 5px; + width: calc(100% - 10px); +} + +.wp-block-media-text.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(100% 0%,90% 100%,0% 100%,0% 0%); +} + +.wp-block-media-text.is-style-angled-divider.is-selected .wp-block-media-text__media:hover{ + clip-path: none; +} + +.wp-block-media-text.has-media-on-the-right.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(0% 0%,100% 0%,100% 100%,10% 100%); +} + +@media (max-width:599px){ + .wp-block-media-text.is-stacked-on-mobile.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(100% 0%,100% 90%,0% 100%,0% 0%); + } + + .wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(0% 0%,100% 10%,100% 100%,0% 100%); + } +} + +.wp-block-media-text.is-style-inset-frame .wp-block-media-text__media{ + position: relative; +} + +.wp-block-media-text.is-style-inset-frame .wp-block-media-text__media:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); +} + +.wp-block-media-text.is-style-inset-frame.media-text-overlap-heading .wp-block-media-text__content, +.wp-block-media-text.is-style-inset-frame.is-style-media-text-overlap .wp-block-media-text__content{ + z-index: 1; +} + +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-image figure, +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-item figure, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-image figure, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-item figure{ + position: relative; +} + +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-image figure:after, +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-item figure:after, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-image figure:after, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-item figure:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); +} + +.wp-block-cover.is-style-inset-frame, +.wp-block-cover-image.is-style-inset-frame{ + padding: 40px; +} + +.wp-block-cover.is-style-inset-frame:after, +.wp-block-cover-image.is-style-inset-frame:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); + min-height: calc(100% - 40px); +} +/*-------------------------------------------------------------- +## Block Patterns +--------------------------------------------------------------*/ + +.featured-style-1 .wp-block-columns, +.wp-block-columns.featured-style-1{ + margin-top: 60px; +} + +.featured-style-1 .wp-block-columns .wp-block-column, +.wp-block-columns.featured-style-1 .wp-block-column{ + background-color: #fbfbfb; + padding-left: 1em; + padding-right: 1em; + border-radius: 6px; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.featured-style-1 figure.wp-block-image > div{ + margin-top: -60px; + background-color: #2d2354; + border-radius: 50%; + box-shadow: 0px 0px 0px 4px rgba(45, 35, 84, 0.45); +} + +.featured-style-1 figure.wp-block-image > div > img{ + margin: 1em; + width: calc(100% - 2em); + height: calc(100% - 2em); +} + +.wp-block-columns.pricing-table.has-featured{ + margin-top: 30px; +} + +.wp-block-columns.pricing-table .wp-block-column{ + background-color: #fbfbfb; + padding: 1em; + border-radius: 6px; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-columns.pricing-table .wp-block-column.is-featured{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.06); + transform: translateY(-30px); +} + +.wp-block-columns.pricing-table ul{ + list-style: none; + margin: 0; +} + +.wp-block-columns.pricing-table li{ + display: block; + margin-left: 2em; +} + +.wp-block-columns.pricing-table li:before{ + font-family: dashicons; + content: "\f147"; + font-size: 1.4em; + vertical-align: middle; + margin-right: 0.5em; + margin-left: -1.5em; +} + +.wp-block-columns.pricing-table div.wp-block-buttons{ + margin-bottom: 0; +} + +.wp-block-cover.has-overlap{ + padding-bottom: 120px; +} + +.wp-block-columns.overlap, +.wp-block-columns.pricing-table.has-featured.overlap{ + position: relative; + z-index: 9; + margin-top: -90px; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns:last-child{ + margin-bottom: 0; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18%; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78%; + margin-left: 4%; +} + +.wp-block-columns.with-offset{ + margin-top: 4em; +} + +.wp-block-columns.with-offset .wp-block-column.has-offset, +.wp-block-column.is-style-offset{ + margin-top: -4em !important; + margin-bottom: 4em !important; +} + +.wp-block-column.is-style-offset-box-shadow{ + margin-top: -4em !important; + margin-bottom: 4em !important; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-columns.without-gaps .wp-block-column:not(:first-child), +.wp-block-columns.is-style-no-spacing .wp-block-column:not(:first-child){ + margin-left: 0; +} + +.wp-block-gallery.without-gaps .blocks-gallery-item, +.wp-block-gallery.is-style-no-spacing .blocks-gallery-item{ + margin: 0 !important; +} + +.wp-block-media-text.food-menu-item .wp-block-media-text__content .wp-block-separator{ + margin-left: -25%; + margin-top: -28px; + height: 1px; + width: 45%; +} + +.wp-block-media-text.has-media-on-the-right.food-menu-item .wp-block-media-text__content .wp-block-separator{ + margin-left: 80%; +} + +.wp-block-cover.about-profile .wp-block-columns{ + margin-top: 2em; + margin-bottom: 2em; +} + +.about-profile .wp-block-column .wp-block-image{ + margin-bottom: 0; +} + +.about-profile .wp-block-column hr.wp-block-separator{ + width: 150%; + max-width: unset; +} + +.about-profile .wp-block-column .wp-block-social-links{ + margin-top: 2em; +} + +.wp-block-group.testimonial:before{ + font-family: dashicons; + font-size: 2.4em; + content: "\f122"; + color: #d82978; +} + +.wp-block-group.testimonial hr.wp-block-separator{ + margin-bottom: 1em; +} + +.media-text-overlap-heading.wp-block-media-text{ + -ms-grid-columns: 50% 1fr !important; + grid-template-columns: 50% 1fr !important; +} + +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right{ + -ms-grid-columns: 1fr 50% !important; + grid-template-columns: 1fr 50% !important; +} + +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h1:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h2:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h3:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h4:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h5:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h6:first-child{ + width: 216%; + margin-left: -117.5%; + margin-top: 1em !important; +} + +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h1:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h2:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h3:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h4:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h5:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h6:first-child{ + margin-left: 0; + margin-right: -117.5%; +} + +.wp-block-media-text.is-image-fill.media-text-overlap, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap{ + margin-top: 60px; + margin-bottom: 60px; +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.media-text-overlap, +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.is-style-media-text-overlap{ + margin-top: 0; + margin-bottom: 90px; +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.media-text-overlap, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.is-style-media-text-overlap{ + margin-top: 90px; + margin-bottom: 0; +} + +.wp-block-media-text.is-image-fill.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap figure.wp-block-media-text__media{ + height: calc(100% + 120px) !important; +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.is-style-media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.is-style-media-text-overlap figure.wp-block-media-text__media{ + height: calc(100% + 90px) !important; +} + +.wp-block-media-text.is-image-fill.media-text-overlap .wp-block-media-text__content, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-left: -120px; + padding-top: 20%; + padding-bottom: 20%; + background: inherit; +} + +.wp-block-media-text.has-media-on-the-right.is-image-fill.media-text-overlap .wp-block-media-text__content, +.wp-block-media-text.has-media-on-the-right.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-left: 0; + margin-right: -120px; +} + +.ribbon-group { + margin-bottom: 40px; +} + +.ribbon-group > .wp-block-group__inner-container > *:not(.alignfull){ + max-width: calc(100% - 60px) !important; +} + +.ribbon-group .wp-block-group__inner-container > h1, +.ribbon-group .wp-block-group__inner-container > h2, +.ribbon-group .wp-block-group__inner-container > h3, +.ribbon-group .wp-block-group__inner-container > h4, +.ribbon-group .wp-block-group__inner-container > h5, +.ribbon-group .wp-block-group__inner-container > h6{ + position: relative; + display: inline-block; + padding: 20px 30px; + margin: 0 !important; + z-index: 1; +} + +.ribbon-group .wp-block-group__inner-container > h1:before, +.ribbon-group .wp-block-group__inner-container > h2:before, +.ribbon-group .wp-block-group__inner-container > h3:before, +.ribbon-group .wp-block-group__inner-container > h4:before, +.ribbon-group .wp-block-group__inner-container > h5:before, +.ribbon-group .wp-block-group__inner-container > h6:before{ + content: ""; + position: absolute; + width: 0; + height: 0; + left: 0; + top: 100%; + background: inherit; + border: 30px solid rgba(0,0,0,0.25); + clip-path: polygon(0% 0%, 100% 0%, 100% 100%); +} + +.ribbon-group > .wp-block-group__inner-container > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){ + position: relative; + margin: -10px 0 10px 60px !important; +} + +.rtl .ribbon-group .wp-block-group__inner-container > h1:before, +.rtl .ribbon-group .wp-block-group__inner-container > h2:before, +.rtl .ribbon-group .wp-block-group__inner-container > h3:before, +.rtl .ribbon-group .wp-block-group__inner-container > h4:before, +.rtl .ribbon-group .wp-block-group__inner-container > h5:before, +.rtl .ribbon-group .wp-block-group__inner-container > h6:before{ + left: auto; + right: 0; + clip-path: polygon(0% 0%, 100% 0%, 0% 100%); +} + +.rtl .ribbon-group > .wp-block-group__inner-container > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){ + position: relative; + margin: -10px 60px 10px 0; +} + +@media (max-width: 781px){ + .featured-style-1 .wp-block-columns .wp-block-column, + .wp-block-columns.featured-style-1 .wp-block-column{ + flex-basis: 100% !important; + margin-bottom: 90px; + } + + .wp-block-columns.pricing-table .wp-block-column{ + flex-basis: 100% !important; + margin-bottom: 30px; + } + + .wp-block-columns.pricing-table .wp-block-column.is-featured{ + transform: none; + } + + .featured-style-1 .wp-block-columns .wp-block-column:nth-child(2n), + .wp-block-columns.featured-style-1 .wp-block-column:nth-child(2n), + .wp-block-columns.pricing-table .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .featured-style-1 .wp-block-columns .wp-block-column:last-child, + .wp-block-columns.featured-style-1 .wp-block-column:last-child, + .wp-block-columns.pricing-table .wp-block-column:last-child{ + margin-bottom: 0; + } + + .features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18% !important; + } + + .features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78% !important; + } + + .wp-block-columns.without-gaps .wp-block-column:nth-child(2n), + .wp-block-columns.is-style-no-spacing .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .wp-block-columns.is-style-not-stacked-on-mobile, + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile{ + flex-wrap: nowrap; + } + + .wp-block-columns.is-style-not-stacked-on-mobile .wp-block-column, + .wp-block-columns.is-style-not-stacked-on-mobile.is-style-no-spacing .wp-block-column, + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile .wp-block-column{ + flex-basis: auto !important; + flex-grow: 1; + } + + .wp-block-columns.is-style-not-stacked-on-mobile .wp-block-column:not(:first-child){ + margin-left: 32px !important; + } + + .wp-block-columns.is-style-not-stacked-on-mobile.is-style-no-spacing .wp-block-column:not(:first-child), + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile .wp-block-column:not(:first-child){ + margin-left: 0 !important; + } +} + +@media (min-width:600px) and (max-width: 781px){ + .wp-block-columns.without-gaps .wp-block-column, + .wp-block-columns.is-style-no-spacing .wp-block-column{ + flex-basis: 50% !important; + } + + .wp-block-columns.cta-with-images .wp-block-column, + .wp-block-columns.food-menu-item .wp-block-column{ + flex-basis: 100% !important; + } + + .wp-block-columns.cta-with-images .wp-block-column:nth-child(2n), + .wp-block-columns.food-menu-item .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .wp-block-columns.food-menu-item .wp-block-column .has-text-align-right{ + text-align: left; + } + + .wp-block-media-text.food-menu-item{ + margin-bottom: .5em; + } + + .wp-block-media-text.food-menu-item .wp-block-media-text__content .has-large-font-size{ + font-size: 24px; + } + + .about-profile .wp-block-column hr.wp-block-separator{ + width: 50%; + } +} + +@media (max-width:599px){ + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{ + margin-top: 2em; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content{ + margin-top: 0; + margin-bottom: 1em; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18% !important; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78% !important; + } + + .wp-block-columns.with-offset{ + margin-top: 0; + } + + .wp-block-columns.with-offset .wp-block-column.has-offset, + .wp-block-column.is-style-offset, + .wp-block-column.is-style-offset-box-shadow{ + margin-top: 0 !important; + margin-bottom: 0 !important; + } + + .wp-block-columns.food-menu > .wp-block-column:first-child{ + margin-bottom: 2em; + } + + .wp-block-columns.food-menu-item .wp-block-column:first-child{ + flex-basis: 66.66% !important; + } + + .wp-block-columns.food-menu-item .wp-block-column:nth-child(2n){ + flex-basis: 33.33% !important; + } + + .wp-block-media-text.food-menu-item{ + margin-bottom: 2em; + } + + .wp-block-media-text.food-menu-item .wp-block-media-text__content .wp-block-separator{ + display: none; + } + + .about-profile .wp-block-column hr.wp-block-separator{ + width: 25%; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right{ + -ms-grid-columns: 100% !important; + grid-template-columns: 100% !important; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h1:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h2:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h3:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h4:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h5:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h6:first-child{ + width: 100%; + margin-left: 0; + margin-top: -1em !important; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h1:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h2:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h3:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h4:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h5:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h6:first-child{ + margin-right: 0; + margin-top: 1em !important; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile{ + width: 90%; + margin-left: 5%; + margin-right: 5%; + margin-top: 0; + margin-bottom: 0; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile figure.wp-block-media-text__media, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile figure.wp-block-media-text__media{ + height: 100% !important; + width: 111% !important; + max-width: 111% !important; + margin-left: -5.5%; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile .wp-block-media-text__content, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile .wp-block-media-text__content{ + margin-top: -40px; + margin-left: 0; + padding-top: 8%; + padding-bottom: 8%; + } + + .wp-block-media-text.has-media-on-the-right.is-image-fill.media-text-overlap .wp-block-media-text__content, + .wp-block-media-text.has-media-on-the-right.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-bottom: -40px; + margin-top: 0; + margin-right: 0; + } +} diff --git a/css/editor-style.css b/css/editor-style.css new file mode 100644 index 0000000..ca8118f --- /dev/null +++ b/css/editor-style.css @@ -0,0 +1,352 @@ +/* +Theme Name: Cordero +Description: Used to style the TinyMCE editor. +*/ + +/** + * Body + */ + +body { + background-color: #fff; + color: #313131; +} + +/** + * Typography + */ + +body, +button, +input, +select, +textarea { + color: #313131; + font-family: 'Work Sans'; + font-size: 16px; + font-weight: 300; + line-height: 1.68; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + color: #313131; + font-weight: 600; + line-height: 1.2; + font-family: 'Montserrat'; + margin: 0 0 20px; +} + +h1{ + font-size: 32px; +} + +h2{ + font-size: 30px; +} + +h3{ + font-size: 28px; +} + +h4{ + font-size: 26px; +} + +h5{ + font-size: 24px; +} + +h6{ + font-size: 22px; +} + +p{ + margin: 0 0 15px; +} + +dfn, +cite, +em, +i{ + font-style: italic; +} + +blockquote{ + margin: 0 15px; +} + +address{ + margin: 0 0 15px; +} + +pre{ + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} + +code{ + background-color: #f2f2f2; + padding: 0.125em 0.25em; +} + +code, +kbd, +tt, +var{ + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; +} + +abbr, +acronym{ + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins{ + background: #fff9c0; + text-decoration: none; +} + +big { + font-size: 125%; +} + +blockquote:before, +blockquote:after{ + content: "\""; + position: absolute; + top: 0; + font-size: 200%; + text-align: center; + width: 30px; + height: 100%; + background: #f2f2f2; +} +blockquote:before{ + left: 0; +} +blockquote:after{ + right: 0; +} + +q:before{ + content: "\""; + position: absolute; + top: -.5em; + left: 0; + font-size: 2em; +} +q:after{ + content: "\""; + position: absolute; + top: -.5em; + right: 0; + font-size: 2em; +} + +blockquote{ + quotes: "" ""; + position: relative; + font-style: italic; + font-size: 105%; + font-weight: 500; + padding: 10px 40px 10px 40px; + background: #f8f8f8; + border-radius: 2px; +} + +q{ + quotes: "" ""; + position: relative; + padding: 0 17px; +} + +/** + * Elements + */ + +hr { + background-color: rgba(0,0,0,0.2); + border: 0; + height: 1px; + margin-bottom: 15px; +} + +ul, +ol { + margin: 0 0 15px 20px; + padding: 0; +} + +ul { + list-style: disc; +} + +ol { + list-style: decimal; +} + +li > ul, +li > ol{ + margin-bottom: 0; + margin-left: 15px; +} + +dt{ + font-weight: bold; +} + +dd{ + margin: 0 15px 15px; +} + +table{ + margin: 0 0 15px; + width: 100%; + border: 1px solid #f2f3f5; +} + +a{ + color: #d82978; + text-decoration: underline; +} + +a:hover, +a:focus, +a:active{ + color: #d82978; +} + +a:focus{ + outline: 0; +} + +a:hover, +a:active{ + outline: 0; +} + + +button, +.button, +a.button{ + display: inline-block; + background: #d82978; + padding: .5em 1em; + color: #fff; + text-decoration: none; + border: 0; + border-radius: 0; + line-height: 1.6; + height: auto; +} + +/** + * Alignment + */ + +img { + border: 0; + height: auto; /* Make sure images are scaled correctly. */ + max-width: 100%; /* Adhere to container width. */ + vertical-align: middle; +} + +embed, +iframe, +object { + max-width: 100%; +} + +/** + * Captions + */ + +.wp-caption{ + margin-bottom: 15px; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"]{ + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption .wp-caption-text{ + margin: 0.8075em 0; +} + +.wp-caption-text{ + background: #f9f9f9; + border: 1px solid #f2f3f5; + text-align: center; + font-size: 16px; +} + +/** + * Gallery + */ + +.gallery{ + margin-bottom: 15px; +} + +.gallery-item{ + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item{ + max-width: 50%; +} + +.gallery-columns-3 .gallery-item{ + max-width: 33.33%; +} + +.gallery-columns-4 .gallery-item{ + max-width: 25%; +} + +.gallery-columns-5 .gallery-item{ + max-width: 20%; +} + +.gallery-columns-6 .gallery-item{ + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item{ + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item{ + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item{ + max-width: 11.11%; +} + +.gallery-caption{ + display: block; + margin: 0 10px 10px 10px; +} \ No newline at end of file diff --git a/css/theme-help.css b/css/theme-help.css new file mode 100644 index 0000000..155fd65 --- /dev/null +++ b/css/theme-help.css @@ -0,0 +1,157 @@ +/* + * Theme admin help css + */ + +.theme-help-wrap { + margin: 25px 40px 0 20px; + max-width: 1050px; + position: relative; +} +.theme-help-wrap img { + max-width: 100%; +} + +.theme-help-wrap img.pattern-img { + margin-bottom: 5em; +} + +/* Clearing Floats */ +.theme-help-wrap .clearfix:before, .theme-help-wrap .clearfix:after { + content: " "; + display: table; +} +.theme-help-wrap .clearfix:after { + clear: both; +} +.theme-help-wrap .clearfix { + *zoom: 1; /* For IE 6/7 only */ +} + +/* Columns */ +.theme-help-wrap .columns-wrapper { + margin-right: -4em; +} +.theme-help-wrap .columns-wrapper .column { + float: left; + padding-right: 4em; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.theme-help-wrap .columns-wrapper .column-half { + width: 50%; +} +.theme-help-wrap .columns-wrapper .column-third { + width: 33.3333333333333%; +} +.theme-help-wrap .columns-wrapper .column-quarter { + width: 25%; +} + +/* Font Styles */ +.theme-help-wrap h3 { + font-size: 1.6em; + font-weight: 400; + line-height: 1.5em; + margin: 1em 0 0.6em; +} +.theme-help-wrap h4 { + font-size: 1.3em; + font-weight: 400; + margin: 0.2em 0; +} + +/* Theme help Header */ +.theme-help-wrap h1 { + color: #23282d; + font-size: 2.25em; + line-height: 1.2em; + margin: 0.2em 0 0 0; +} +.theme-help-wrap h1 .theme-version { + display: inline-block; + font-size: 0.5em; + line-height: 1; + padding: 0.2em 0.3em; + background: #fbfbfb; + border-radius: 2px; + transform: translateY(-0.2em); +} +.theme-help-wrap .theme-description { + color: #444; + font-size: 1.25em; + margin: 1em 0; + min-height: 60px; + line-height: 1.6em; +} + +/* Getting Started */ +#getting-started { + margin: 1em 0; +} +#getting-started .section { + margin: 0.5em 0 2.5em; +} +#getting-started .section .about { + color: #444; + font-size: 1.15em; + line-height: 1.6em; +} +#getting-started img { + margin-top: 1em; +} +#getting-started .section ul { + padding-left: 25px; +} +#getting-started .section li { + list-style-type: disc; +} + +/* Screenshot image */ +.screenshot { + position: relative; +} +.screenshot img { + transition: all .3s ease; +} +.screenshot .button { + position: absolute; + top: 40%; + left: 50%; + transform: translateX(-50%); + font-size: 1.25em; + padding: 20px 40px; + visibility: hidden; + opacity: 0; + transition: all .3s ease; +} +.screenshot:hover img { + opacity: .3; + transition: all .3s ease; +} +.screenshot:hover .button { + visibility: visible; + opacity: 1; + transition: all .3s ease; +} + +/* Theme Author */ +#theme-author { + margin: 1em 0; +} +#theme-author p { + color: #444; + font-size: 1.2em; + line-height: 1.6em; +} + +/* Buttons */ +.button-pro { + background: #d9595c !important; + border-color: #d03337 #d03337 #d03337 !important; + -webkit-box-shadow: 0 1px 0 #d03337 !important; + box-shadow: 0 1px 0 #d03337 !important; + color: #fff !important; + text-decoration: none !important; + text-shadow: 0 -1px 1px #d03337,1px 0 1px #d03337,0 1px 1px #d03337,-1px 0 1px #d03337 !important; +} \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..78d026d --- /dev/null +++ b/footer.php @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + diff --git a/front-page.php b/front-page.php new file mode 100644 index 0000000..4b005f1 --- /dev/null +++ b/front-page.php @@ -0,0 +1,44 @@ + + + + +
+
+ + + +
+
+ + + + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..7c35014 --- /dev/null +++ b/functions.php @@ -0,0 +1,597 @@ + array( + 'min_columns' => 2, + 'max_columns' => 8, + ), + ) ); + + // Enable support for Post Thumbnails on posts and pages. + add_theme_support( 'post-thumbnails' ); + + // Add custom image size(s) + add_image_size( 'cordero-featured-service', 60, 60, true ); + + + // Make custom image size(s) available to editor + add_filter( 'image_size_names_choose', 'cordero_custom_image_sizes' ); + function cordero_custom_image_sizes( $sizes ) { + return array_merge( $sizes, array( + 'cordero-featured-service' => __( 'Featured Service', 'cordero' ), + )); + } + + // This theme uses wp_nav_menu() in two locations + register_nav_menus( array( + 'primary' => esc_html__( 'Primary Menu', 'cordero' ), + 'footer' => esc_html__( 'Footer Menu', 'cordero' ), + ) ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( 'html5', array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) ); + + // Enable support for post formats + add_theme_support( 'post-formats', array( + 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat', + ) ); + + // Set up the WordPress core custom background feature + add_theme_support( 'custom-background', apply_filters( 'cordero_custom_background_args', array( + 'default-color' => 'ffffff', + 'default-image' => '', + ) ) ); + + // Enable support for Custom Logo + add_theme_support( 'custom-logo', array( + 'width' => '', + 'height' => '', + 'flex-height' => true, + 'flex-width' => true, + ) ); + + // Enable support for widgets selective refresh + add_theme_support( 'customize-selective-refresh-widgets' ); + + // Style the visual editor to resemble the theme style + add_editor_style( array( 'css/editor-style.css', cordero_editor_fonts_url() ) ); + + add_theme_support( 'wc-product-gallery-zoom' ); + add_theme_support( 'wc-product-gallery-lightbox' ); + add_theme_support( 'wc-product-gallery-slider' ); + + // Support for Gutenberg (5.0+ block editor) + add_theme_support( 'align-wide' ); + add_theme_support( 'editor-color-palette', cordero_custom_color_palette() ); + add_theme_support( 'editor-font-sizes', cordero_custom_font_sizes() ); + add_theme_support( 'custom-line-height' ); + + // https://jetpack.com/support/infinite-scroll/ + add_theme_support( 'infinite-scroll', array( + 'container' => 'main', + 'footer' => false, + ) ); + +} +endif; // cordero_setup +add_action( 'after_setup_theme', 'cordero_setup' ); + +function cordero_content_width() { + $GLOBALS['content_width'] = apply_filters( 'cordero_content_width', 1160 ); +} +add_action( 'after_setup_theme', 'cordero_content_width', 0 ); + +// Set up the WordPress core custom header feature +function cordero_custom_header_setup() { + add_theme_support( 'custom-header', apply_filters( 'cordero_custom_header_args', array( + 'default-image' => '', + 'default-text-color' => 'ffffff', + 'header-text' => false, + 'width' => '1920', + 'height' => '180', + 'flex-height' => false, + 'flex-width' => false, + 'wp-head-callback' => '', + ) ) ); +} +add_action( 'after_setup_theme', 'cordero_custom_header_setup' ); + +// Enables the Excerpt meta box in Page edit screen +function cordero_add_excerpt_support_for_pages() { + add_post_type_support( 'page', 'excerpt' ); +} +add_action( 'init', 'cordero_add_excerpt_support_for_pages' ); + +// Register widget area +function cordero_widgets_init() { + register_sidebar( array( + 'name' => esc_html__( 'Blog Sidebar', 'cordero' ), + 'id' => 'cordero-sidebar', + 'before_widget' => '', + 'before_title' => '', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Page Sidebar', 'cordero' ), + 'id' => 'cordero-sidebar-page', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Shop Sidebar', 'cordero' ), + 'id' => 'cordero-sidebar-shop', + 'description' => esc_html__( 'Requires WooCommerce plugin.', 'cordero' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Shop Filters', 'cordero' ), + 'id' => 'cordero-sidebar-shop-filters', + 'description' => esc_html__( 'Horizontal widget area for product archives. Requires WooCommerce plugin.', 'cordero' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Top Bar', 'cordero' ), + 'id' => 'cordero-top-bar', + 'description' => esc_html__( 'Add your own content above the header.', 'cordero' ), + 'before_widget' => '', + 'before_title' => '
', + 'after_title' => '
', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Top Footer', 'cordero' ), + 'description' => esc_html__( 'Full width area above the footer columns.', 'cordero' ), + 'id' => 'cordero-top-footer', + 'description' => '', + 'before_widget' => '', + 'before_title' => '', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Footer Column 1', 'cordero' ), + 'id' => 'cordero-footer1', + 'description' => '', + 'before_widget' => '', + 'before_title' => '', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Footer Column 2', 'cordero' ), + 'id' => 'cordero-footer2', + 'description' => '', + 'before_widget' => '', + 'before_title' => '', + ) ); + + register_sidebar( array( + 'name' => esc_html__( 'Footer Column 3', 'cordero' ), + 'id' => 'cordero-footer3', + 'description' => '', + 'before_widget' => '', + 'before_title' => '', + ) ); + +} +add_action( 'widgets_init', 'cordero_widgets_init' ); + +if ( ! function_exists( 'cordero_fonts_url' ) ) : +/** + * Register Google fonts for Cordero + * @return string Google fonts URL for the theme + */ +function cordero_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* + * Translators: If there are characters in your language that are not supported + * translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Google fonts: on or off', 'cordero' ) ) { + + $fonts[] = get_theme_mod( 'font_site_title', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_nav', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_content', 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_headings', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + + $fonts = str_replace('Arial, Helvetica, sans-serif', '', $fonts); + $fonts = str_replace('Impact, Charcoal, sans-serif', '', $fonts); + $fonts = str_replace('"Lucida Sans Unicode", "Lucida Grande", sans-serif', '', $fonts); + $fonts = str_replace('Tahoma, Geneva, sans-serif', '', $fonts); + $fonts = str_replace('"Trebuchet MS", Helvetica, sans-serif', '', $fonts); + $fonts = str_replace('Verdana, Geneva, sans-serif', '', $fonts); + $fonts = str_replace('Georgia, serif', '', $fonts); + $fonts = str_replace('"Palatino Linotype", "Book Antiqua", Palatino, serif', '', $fonts); + $fonts = str_replace('"Times New Roman", Times, serif', '', $fonts); + + } + + $fonts = array_filter( $fonts ); + + if ( empty( $fonts ) ) { + $google_fonts_empty = 1; + } else { + $google_fonts_empty = 0; + } + + /* + * Translators: To add an additional character subset specific to your language, + * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. + */ + $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'cordero' ); + + if ( 'cyrillic' == $subset ) { + $subsets .= ',cyrillic,cyrillic-ext'; + } elseif ( 'greek' == $subset ) { + $subsets .= ',greek,greek-ext'; + } elseif ( 'devanagari' == $subset ) { + $subsets .= ',devanagari'; + } elseif ( 'vietnamese' == $subset ) { + $subsets .= ',vietnamese'; + } + + if ( $google_fonts_empty == 0 ) { + $fonts_url = add_query_arg( array( + 'family' => urlencode( implode( '|', array_unique($fonts) ) ), + 'subset' => urlencode( $subsets ), + ), '//fonts.googleapis.com/css' ); + return esc_url_raw($fonts_url); + } else { + return; + } +} +endif; + +if ( ! function_exists( 'cordero_editor_fonts_url' ) ) : +/** + * Register Google fonts for Cordero + * @return string Google fonts URL for the tinyMCE editor + */ +function cordero_editor_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* + * Translators: If there are characters in your language that are not supported + * translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Google fonts: on or off', 'cordero' ) ) { + + $fonts[] = get_theme_mod( 'font_site_title', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_nav', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_content', 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + $fonts[] = get_theme_mod( 'font_headings', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + + $fonts = str_replace('Arial, Helvetica, sans-serif', '', $fonts); + $fonts = str_replace('Impact, Charcoal, sans-serif', '', $fonts); + $fonts = str_replace('"Lucida Sans Unicode", "Lucida Grande", sans-serif', '', $fonts); + $fonts = str_replace('Tahoma, Geneva, sans-serif', '', $fonts); + $fonts = str_replace('"Trebuchet MS", Helvetica, sans-serif', '', $fonts); + $fonts = str_replace('Verdana, Geneva, sans-serif', '', $fonts); + $fonts = str_replace('Georgia, serif', '', $fonts); + $fonts = str_replace('"Palatino Linotype", "Book Antiqua", Palatino, serif', '', $fonts); + $fonts = str_replace('"Times New Roman", Times, serif', '', $fonts); + + } + + $fonts = array_filter( $fonts ); + + if ( empty( $fonts ) ) { + $google_fonts_empty = 1; + } else { + $google_fonts_empty = 0; + } + + /* + * Translators: To add an additional character subset specific to your language, + * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. + */ + $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'cordero' ); + + if ( 'cyrillic' == $subset ) { + $subsets .= ',cyrillic,cyrillic-ext'; + } elseif ( 'greek' == $subset ) { + $subsets .= ',greek,greek-ext'; + } elseif ( 'devanagari' == $subset ) { + $subsets .= ',devanagari'; + } elseif ( 'vietnamese' == $subset ) { + $subsets .= ',vietnamese'; + } + + if ( $google_fonts_empty == 0 ) { + $fonts_url = add_query_arg( array( + 'family' => urlencode( implode( '|', array_unique($fonts) ) ), + 'subset' => urlencode( $subsets ), + ), '//fonts.googleapis.com/css' ); + return esc_url_raw($fonts_url); + } else { + return; + } +} +endif; + +/** + * Enqueue scripts and styles. + */ +function cordero_scripts() { + wp_enqueue_style( 'dashicons' ); + wp_enqueue_script( 'touchswipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array( 'jquery' ), '1.6.18', true ); + wp_enqueue_script( 'cordero-custom', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0', true ); + wp_enqueue_script( 'cordero-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '1.0', true ); + wp_enqueue_style( 'cordero-fonts', cordero_fonts_url(), array(), null ); + wp_enqueue_style( 'cordero-style', get_stylesheet_uri() ); + wp_add_inline_style( 'cordero-style', cordero_dynamic_style() ); + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } +} +add_action( 'wp_enqueue_scripts', 'cordero_scripts' ); + +/** + * Enqueue scripts and styles for Block Editor. + */ +function cordero_block_editor_assets() { + wp_enqueue_style( 'cordero-block-editor-fonts', cordero_editor_fonts_url() ); + wp_enqueue_style( 'cordero-block-editor-style', get_template_directory_uri() . '/css/block-editor-style.css' ); + wp_add_inline_style( 'cordero-block-editor-style', cordero_block_editor_dynamic_style() ); +} +add_action( 'enqueue_block_editor_assets', 'cordero_block_editor_assets' ); + +/** + * Custom block editor color palette. + */ +if ( !function_exists( 'cordero_custom_color_palette' ) ) { + function cordero_custom_color_palette() { + return array( + array( + 'name' => esc_html__( 'Cordero - Accent color', 'cordero' ), + 'slug' => 'accent-color', + 'color' => get_theme_mod( 'accent_color', '#d82978' ), + ), + array( + 'name' => esc_html__( 'Cordero - Color 2', 'cordero' ), + 'slug' => 'accent-color2', + 'color' => get_theme_mod( 'accent_color2', '#2d2354' ), + ), + array( + 'name' => esc_html__( 'Cordero - Color 3', 'cordero' ), + 'slug' => 'accent-color3', + 'color' => get_theme_mod( 'accent_color3', '#fbfbfb' ), + ), + array( + 'name' => esc_html__( 'Black', 'cordero' ), + 'slug' => 'black', + 'color' => '#000000' + ), + array( + 'name' => esc_html__( 'White', 'cordero' ), + 'slug' => 'white', + 'color' => '#ffffff' + ), + array( + 'name' => esc_html__( 'Pale pink', 'cordero' ), + 'slug' => 'pale-pink', + 'color' => '#f78da7' + ), + array( + 'name' => esc_html__( 'Vivid red', 'cordero' ), + 'slug' => 'vivid-red', + 'color' => '#cf2e2e', + ), + array( + 'name' => esc_html__( 'Luminous vivid orange', 'cordero' ), + 'slug' => 'luminous-vivid-orange', + 'color' => '#ff6900', + ), + array( + 'name' => esc_html__( 'Luminous vivid amber', 'cordero' ), + 'slug' => 'luminous-vivid-amber', + 'color' => '#fcb900', + ), + array( + 'name' => esc_html__( 'Light green cyan', 'cordero' ), + 'slug' => 'light-green-cyan', + 'color' => '#7bdcb5', + ), + array( + 'name' => esc_html__( 'Vivid green cyan', 'cordero' ), + 'slug' => 'vivid-green-cyan', + 'color' => '#00d084', + ), + array( + 'name' => esc_html__( 'Pale cyan blue', 'cordero' ), + 'slug' => 'pale-cyan-blue', + 'color' => '#8ed1fc', + ), + array( + 'name' => esc_html__( 'Vivid cyan blue', 'cordero' ), + 'slug' => 'vivid-cyan-blue', + 'color' => '#0693e3', + ), + array( + 'name' => esc_html__( 'Vivid purple', 'cordero' ), + 'slug' => 'vivid-purple', + 'color' => '#9b51e0', + ), + array( + 'name' => esc_html__( 'Very light gray', 'cordero' ), + 'slug' => 'very-light-gray', + 'color' => '#eeeeee', + ), + array( + 'name' => esc_html__( 'Cyan bluish gray', 'cordero' ), + 'slug' => 'cyan-bluish-gray', + 'color' => '#abb8c3', + ), + array( + 'name' => esc_html__( 'Very dark gray', 'cordero' ), + 'slug' => 'very-dark-gray', + 'color' => '#313131', + ), + ); + } +} + +/** + * Custom block editor font sizes. + */ +if ( !function_exists( 'cordero_custom_font_sizes' ) ) { + function cordero_custom_font_sizes() { + return array( + array( + 'name' => __( 'Tiny', 'cordero' ), + 'size' => 10, + 'slug' => 'tiny' + ), + array( + 'name' => __( 'Small', 'cordero' ), + 'size' => 13, + 'slug' => 'small' + ), + array( + 'name' => __( 'Normal', 'cordero' ), + 'size' => 16, + 'slug' => 'normal' + ), + array( + 'name' => __( 'Medium', 'cordero' ), + 'size' => 24, + 'slug' => 'medium' + ), + array( + 'name' => __( 'Large', 'cordero' ), + 'size' => 36, + 'slug' => 'large' + ), + array( + 'name' => __( 'Huge', 'cordero' ), + 'size' => 48, + 'slug' => 'huge' + ), + array( + 'name' => __( 'Gigantic', 'cordero' ), + 'size' => 60, + 'slug' => 'gigantic' + ), + array( + 'name' => __( 'Massive', 'cordero' ), + 'size' => 72, + 'slug' => 'massive' + ), + ); + } +} + +/** + * Custom template tags for this theme. + */ +require get_template_directory() . '/functions/template-tags.php'; + +/** + * Custom functions. + */ +require get_template_directory() . '/functions/extras.php'; +require get_template_directory() . '/functions/hooks.php'; +require get_template_directory() . '/functions/schema.php'; +require get_template_directory() . '/functions/style-output.php'; +require get_template_directory() . '/functions/fonts.php'; + +/** + * Block patterns. + */ +if ( function_exists( 'register_block_pattern' ) ) { + require get_template_directory() . '/functions/block-patterns.php'; +} + +/** + * Block styles. + */ +if ( function_exists( 'register_block_style' ) ) { + require get_template_directory() . '/functions/block-styles.php'; +} + +/** + * Customizer additions. + */ +require get_template_directory() . '/functions/customizer-controls.php'; +require get_template_directory() . '/functions/customizer.php'; + +/** + * Theme help page. + */ +if ( is_admin() ) { + require get_template_directory() . '/functions/theme-help.php'; +} + +if ( !function_exists( 'wp_body_open' ) ) { + function wp_body_open() { + do_action( 'wp_body_open' ); + } +} + +/** + * TGM Plugin activation. + */ +require_once get_template_directory() . '/functions/class-tgm-plugin-activation.php'; +function cordero_reg_plugin() { + $plugins[] = array( + 'name' => esc_html__( 'Starter Sites', 'cordero' ), + 'slug' => 'starter-sites', + 'required' => false, + ); + tgmpa( $plugins); +} +add_action( 'tgmpa_register', 'cordero_reg_plugin' ); diff --git a/functions/block-patterns.php b/functions/block-patterns.php new file mode 100644 index 0000000..8b950c7 --- /dev/null +++ b/functions/block-patterns.php @@ -0,0 +1,1429 @@ + __( 'Cordero', 'cordero' ) ) +); + + +register_block_pattern_category( + 'cordero-theme-wc', + array( 'label' => __( 'Cordero - Products', 'cordero' ) ) +); + + +if ( class_exists( 'WooCommerce' ) ) { + register_block_pattern( + 'cordero/cover-and-products', + array( + 'title' => __( 'Cover and Products', 'cordero' ), + 'description' => _x( 'Two columns with a cover image to the left, and latest products on the right.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit suscipit, auctor etiam eu scelerisque nunc sociosqu mus felis, non eleifend porta imperdiet fermentum nullam elementum.', 'Theme starter content', 'cordero' ) . '

+ + + + +
+
+ + + +
+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme-wc' ), + 'keywords' => array( 'woocommerce' ), + ) + ); +} + + +register_block_pattern( + 'cordero/cta-hero-cover', + array( + 'title' => __( 'Call to action hero cover', 'cordero' ), + 'description' => _x( 'A full width cover image with inner group containing heading, paragraph and button.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+

An Example Heading

+ + + +

' . _x( 'Works well with Transparent Header page template', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( '(Document > Page Attributes > Template: Transparent Header)', 'Theme starter content', 'cordero' ) . '

+ + + + +
+
+', + + 'viewportWidth' => 1600, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'heading', 'full width' ), + ) +); + + +register_block_pattern( + 'cordero/group-container', + array( + 'title' => __( 'Full-width group with inner container', 'cordero' ), + 'description' => _x( 'A full width group containing an inner group with the default container width.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+

' . _x( 'This pattern contains a paragraph inside an inner group within a full-width group.', 'Theme starter content', 'cordero' ) . '

+
+
+', + + 'viewportWidth' => 1600, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/gigantic-heading', + array( + 'title' => __( 'Gigantic heading with separator', 'cordero' ), + 'description' => _x( 'A gigantic centered bold heading with separator and three colors', 'Block pattern description', 'cordero' ), + + 'content' => ' +

Example Heading

+', + + 'viewportWidth' => 1200, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'large', 'huge', 'bold' ), + ) +); + + +register_block_pattern( + 'cordero/quote-group', + array( + 'title' => __( 'Quote group with mulitple paragraphs', 'cordero' ), + 'description' => _x( 'A group containing multiple paragraphs, with quote styling on the first and last paragraphs.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Do you see over yonder,', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'friend Sancho,', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'thirty or forty hulking giants?', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'I intend to do battle with them and slay them.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1000, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'quotation' ), + ) +); + + +register_block_pattern( + 'cordero/cover-translucent-content', + array( + 'title' => __( 'Cover with Translucent Content', 'cordero' ), + 'description' => _x( 'A cover block with a background image and translucent inner group.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit', 'Theme starter content', 'cordero' ) . '

+ + + + +
+
+', + + 'viewportWidth' => 1200, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/ribbon-group', + array( + 'title' => __( 'Ribbon Heading and Content', 'cordero' ), + 'description' => _x( 'A ribbon style heading and content.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, feugiat pellentesque himenaeos rutrum dui libero, tristique fames eu venenatis dictumst tortor, posuere fusce pulvinar a mi magna quis euismod.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 800, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/media-text-angled', + array( + 'title' => __( 'Media and text with angled separator', 'cordero' ), + 'description' => _x( 'An image and text with an angled horizontal line between image and content.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/media-text-overlap-heading', + array( + 'title' => __( 'Media and text with overlapping heading', 'cordero' ), + 'description' => _x( 'An image and text with a wide overlapping heading.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'An Example of a Wide Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Please note, the resizing handle has been disabled in this block pattern. The width needs to be 50/50 for the wide heading to work correctly.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/media-text-overlap', + array( + 'title' => __( 'Media and text overlapped', 'cordero' ), + 'description' => _x( 'An image and text with the text area overlapping the image.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/media-on-right-text-overlap', + array( + 'title' => __( 'Media and text overlapped', 'cordero' ), + 'description' => _x( 'An image on the right and text with the text area overlapping the image.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/three-media-text-overlap', + array( + 'title' => __( 'Stacked media and text overlap', 'cordero' ), + 'description' => _x( 'Three overlapping media and text patterns, stacked.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Welcome to the Cordero theme', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus litora per.', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/about-profile', + array( + 'title' => __( 'About Me Profile', 'cordero' ), + 'description' => _x( 'An easy to edit author profile with image.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+

' . _x( 'Example Name', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit a tellus iaculis, enim est viverra cubilia nulla nunc congue nostra semper velit.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Montes tempor quis curae dignissim egestas lacus gravida interdum auctor orci ornare odio tempor curae eu curabitur aliquet, parturient eleifend id condimentum enim est.', 'Theme starter content', 'cordero' ) . '

+ + + + +
+ + + +
+
+
+
+', + + 'viewportWidth' => 1600, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'columns', 'author' ), + ) +); + + +register_block_pattern( + 'cordero/cover-about-profile', + array( + 'title' => __( 'About Me Profile with Cover', 'cordero' ), + 'description' => _x( 'An easy to edit full-width cover with author profile and image.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +
+
+

' . _x( 'Example Name', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit a tellus iaculis, enim est viverra cubilia nulla nunc congue nostra semper velit.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Montes tempor quis curae dignissim egestas lacus gravida interdum auctor orci ornare odio tempor curae eu curabitur aliquet, parturient eleifend id condimentum enim est.', 'Theme starter content', 'cordero' ) . '

+ + + + +
+ + + +
+
+
+
+ + +
+', + + 'viewportWidth' => 1600, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'columns', 'author' ), + ) +); + + +register_block_pattern( + 'cordero/hero-with-buttons-1', + array( + 'title' => __( 'Hero with Two Buttons', 'cordero' ), + 'description' => _x( 'A large full width hero cover with a title, sub-title, and two buttons.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + + + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+ + + + + + + + +
+', + + 'viewportWidth' => 1000, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/features', + array( + 'title' => __( 'Image and Features', 'cordero' ), + 'description' => _x( 'Three features with an image.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + + + + + +
+
+
+
+
+ + + +
+

' . _x( 'Feature One', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+
+
+ + + +
+

' . _x( 'Feature Two', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+
+
+ + + +
+

' . _x( 'Feature Three', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+
+ + +
+', + + 'viewportWidth' => 1000, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/offset-feature-columns', + array( + 'title' => __( 'Offset Feature Columns', 'cordero' ), + 'description' => _x( 'Four offset columns with overlay background images.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+
+

' . _x( 'One', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+

' . _x( 'Two', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+

' . _x( 'Three', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+

' . _x( 'Four', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+
+
+
+', + + 'viewportWidth' => 1000, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/cta-two-images', + array( + 'title' => __( 'Call-to-action with images', 'cordero' ), + 'description' => _x( 'A call-to-action with two images.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+
+
+
+ + + +
+

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit suscipit, auctor etiam eu scelerisque nunc sociosqu mus felis, non eleifend porta imperdiet fermentum nullam elementum.', 'Theme starter content', 'cordero' ) . '

+ + + + +
+ + + +
+
+
+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/food-menu-images', + array( + 'title' => __( 'Food menu with background images', 'cordero' ), + 'description' => _x( 'A food menu with background image for each item.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +

' . _x( 'Menu Heading', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +
+
+
+
+
+

' . _x( 'Item One', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+
+
+

' . _x( 'Item Two', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+
+ + + +
+
+
+
+
+

' . _x( 'Item Three', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+
+
+

' . _x( 'Item Four', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+
+
+ + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/food-menu-images-2', + array( + 'title' => __( 'Food menu with images', 'cordero' ), + 'description' => _x( 'A food menu with an image for each item.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +

' . _x( 'Menu Heading', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +
+
+
+

' . _x( 'Item One', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+
+
+

' . _x( 'Item Two', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+
+
+

' . _x( 'Item Three', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+
+
+

' . _x( 'Item Four', 'Theme starter content', 'cordero' ) . '

+
+ + + +
+

' . _x( '$34', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+
+ + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/testimonial', + array( + 'title' => __( 'Client testimonial quote', 'cordero' ), + 'description' => _x( 'An easy to edit client testimonial quote.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit ornare mollis ac ultrices, tempus per mus fusce aliquet id nec non erat penatibus. Quam sapien lectus laoreet ac lobortis tellus convallis phasellus massa iaculis ridiculus, taciti ultrices erat pretium feugiat faucibus aptent tortor class.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Example Name', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +

' . _x( 'Example extra information', 'Theme starter content', 'cordero' ) . '

+
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'reviews' ), + ) +); + + +register_block_pattern( + 'cordero/testimonials', + array( + 'title' => __( 'Client testimonial quotes', 'cordero' ), + 'description' => _x( 'An easy to edit client testimonial quotes block.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros.', 'Theme starter content', 'cordero' ) . '

+ + + +
+
+
+

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit ornare mollis ac ultrices, tempus per mus fusce aliquet id nec non erat penatibus. Quam sapien lectus laoreet ac lobortis tellus convallis phasellus massa iaculis ridiculus, taciti ultrices erat pretium feugiat faucibus aptent tortor class.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Example Name', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +

' . _x( 'Example extra information', 'Theme starter content', 'cordero' ) . '

+
+
+ + + +
+
+

' . _x( 'Lorem ipsum dolor sit amet consectetur adipiscing elit ornare mollis ac ultrices, tempus per mus fusce aliquet id nec non erat penatibus. Quam sapien lectus laoreet ac lobortis tellus convallis phasellus massa iaculis ridiculus, taciti ultrices erat pretium feugiat faucibus aptent tortor class.', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Example Name', 'Theme starter content', 'cordero' ) . '

+ + + +
+ + + +

' . _x( 'Example extra information', 'Theme starter content', 'cordero' ) . '

+
+
+
+ + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'reviews' ), + ) +); + + +register_block_pattern( + 'cordero/featured-services-1', + array( + 'title' => __( 'Featured Services', 'cordero' ), + 'description' => _x( 'Three featured services.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + + + + + + + + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/featured-services-1-overlap', + array( + 'title' => __( 'Cover and Overlapped Featured Services', 'cordero' ), + 'description' => _x( 'A full width cover block and three overlapped featured services.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +
+ + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+ + + + +
+ + + + + + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + ) +); + + +register_block_pattern( + 'cordero/pricing-table-1', + array( + 'title' => __( 'Pricing Table', 'cordero' ), + 'description' => _x( 'A three column pricing table.', 'Block pattern description', 'cordero' ), + + 'content' => ' + +', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'prices' ), + ) +); + + +register_block_pattern( + 'cordero/pricing-table-1-overlap', + array( + 'title' => __( 'Cover and Overlapped Pricing Table', 'cordero' ), + 'description' => _x( 'A full width cover block and three column overlapped pricing table.', 'Block pattern description', 'cordero' ), + + 'content' => ' +
+ + +
+ + +

' . _x( 'Example Heading', 'Theme starter content', 'cordero' ) . '

+ + + +

' . _x( 'Lorem ipsum dolor sit amet consectetur', 'Theme starter content', 'cordero' ) . '

+ + +
+ + + + + + +
+', + + 'viewportWidth' => 1400, + 'categories' => array( 'cordero-theme' ), + 'keywords' => array( 'prices' ), + ) +); diff --git a/functions/block-styles.php b/functions/block-styles.php new file mode 100644 index 0000000..5816e47 --- /dev/null +++ b/functions/block-styles.php @@ -0,0 +1,431 @@ + 'translucent', + 'label' => __( 'Translucent', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/group', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/group', + array( + 'name' => 'quote', + 'label' => __( 'Quote', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/group', + array( + 'name' => 'point-down', + 'label' => __( 'Point - down', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); +register_block_style( + 'core/group', + array( + 'name' => 'point-up', + 'label' => __( 'Point - up', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/heading', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/heading', + array( + 'name' => 'with-separator', + 'label' => __( 'With Separator (style 1)', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/heading', + array( + 'name' => 'with-separator-2', + 'label' => __( 'With Separator (style 2)', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/heading', + array( + 'name' => 'zero-margin', + 'label' => __( 'Without Bottom Margin', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/heading', + array( + 'name' => 'content-width', + 'label' => __( 'Content Width', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/heading', + array( + 'name' => 'rc-10', + 'label' => __( 'Rounded Corners', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/paragraph', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/paragraph', + array( + 'name' => 'with-separator', + 'label' => __( 'With Separator (style 1)', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/paragraph', + array( + 'name' => 'with-separator-2', + 'label' => __( 'With Separator (style 2)', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/paragraph', + array( + 'name' => 'zero-margin', + 'label' => __( 'Without Bottom Margin', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/paragraph', + array( + 'name' => 'content-width', + 'label' => __( 'Content Width', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/paragraph', + array( + 'name' => 'rc-10', + 'label' => __( 'Rounded Corners', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/image', + array( + 'name' => 'chevron-left', + 'label' => __( 'Chevron - left', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/image', + array( + 'name' => 'chevron-right', + 'label' => __( 'Chevron - right', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/image', + array( + 'name' => 'point-down', + 'label' => __( 'Point - down', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/image', + array( + 'name' => 'point-up', + 'label' => __( 'Point - up', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/image', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/columns', + array( + 'name' => 'no-spacing', + 'label' => __( 'No Spacing', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/columns', + array( + 'name' => 'not-stacked-on-mobile', + 'label' => __( 'Not Stacked on Mobile', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/columns', + array( + 'name' => 'no-spacing-not-stacked-on-mobile', + 'label' => __( 'No Spacing + Not Stacked on Mobile', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/gallery', + array( + 'name' => 'no-spacing', + 'label' => __( 'No Spacing', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/gallery', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/gallery', + array( + 'name' => 'bordered', + 'label' => __( 'Bordered', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/gallery', + array( + 'name' => 'framed', + 'label' => __( 'Framed', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/gallery', + array( + 'name' => 'inset-frame', + 'label' => __( 'Inset Frame', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/cover', + array( + 'name' => 'no-padding', + 'label' => __( 'No Padding', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/cover', + array( + 'name' => 'point-down', + 'label' => __( 'Point - down', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/cover', + array( + 'name' => 'point-up', + 'label' => __( 'Point - up', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/cover', + array( + 'name' => 'inset-frame', + 'label' => __( 'Inset Frame', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/column', + array( + 'name' => 'offset', + 'label' => __( 'Offset', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/column', + array( + 'name' => 'box-shadow', + 'label' => __( 'Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/column', + array( + 'name' => 'offset-box-shadow', + 'label' => __( 'Offset and Box Shadow', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/separator', + array( + 'name' => 'extra-small', + 'label' => __( 'Extra Small', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/separator', + array( + 'name' => 'small', + 'label' => __( 'Small', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/separator', + array( + 'name' => 'medium', + 'label' => __( 'Medium', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/separator', + array( + 'name' => 'large', + 'label' => __( 'Large', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/separator', + array( + 'name' => 'extra-large', + 'label' => __( 'Extra Large', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/separator', + array( + 'name' => 'huge', + 'label' => __( 'Huge', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + + +register_block_style( + 'core/media-text', + array( + 'name' => 'inset-frame', + 'label' => __( 'Inset Frame', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/media-text', + array( + 'name' => 'angled-divider', + 'label' => __( 'Angled Divider', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); + +register_block_style( + 'core/media-text', + array( + 'name' => 'media-text-overlap', + 'label' => __( 'Overlapping Content (requires image fill)', 'cordero' ), + 'style_handle' => 'cordero-style', + ) +); diff --git a/functions/class-tgm-plugin-activation.php b/functions/class-tgm-plugin-activation.php new file mode 100644 index 0000000..2dd7e77 --- /dev/null +++ b/functions/class-tgm-plugin-activation.php @@ -0,0 +1,3763 @@ +wp_version = $GLOBALS['wp_version']; + + // Announce that the class is ready, and pass the object (for advanced use). + do_action_ref_array( 'tgmpa_init', array( $this ) ); + + + + // When the rest of WP has loaded, kick-start the rest of the class. + add_action( 'init', array( $this, 'init' ) ); + } + + /** + * Magic method to (not) set protected properties from outside of this class. + * + * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property + * is being assigned rather than tested in a conditional, effectively rendering it useless. + * This 'hack' prevents this from happening.}} + * + * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 + * + * @since 2.5.2 + * + * @param string $name Name of an inaccessible property. + * @param mixed $value Value to assign to the property. + * @return void Silently fail to set the property when this is tried from outside of this class context. + * (Inside this class context, the __set() method if not used as there is direct access.) + */ + public function __set( $name, $value ) { + return; + } + + /** + * Magic method to get the value of a protected property outside of this class context. + * + * @since 2.5.2 + * + * @param string $name Name of an inaccessible property. + * @return mixed The property value. + */ + public function __get( $name ) { + return $this->{$name}; + } + + /** + * Initialise the interactions between this class and WordPress. + * + * Hooks in three new methods for the class: admin_menu, notices and styles. + * + * @since 2.0.0 + * + * @see TGM_Plugin_Activation::admin_menu() + * @see TGM_Plugin_Activation::notices() + * @see TGM_Plugin_Activation::styles() + */ + public function init() { + /** + * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter + * you can overrule that behaviour. + * + * @since 2.5.0 + * + * @param bool $load Whether or not TGMPA should load. + * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. + */ + if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { + return; + } + + // Load class strings. + $this->strings = array( + 'page_title' => __( 'Recommended Plugin', 'cordero' ), + 'menu_title' => __( 'Recommended Plugin', 'cordero' ), + /* translators: %s: plugin name. */ + 'installing' => __( 'Installing Plugin: %s', 'cordero' ), + /* translators: %s: plugin name. */ + 'updating' => __( 'Updating Plugin: %s', 'cordero' ), + 'oops' => __( 'Something went wrong with the plugin API.', 'cordero' ), + 'notice_can_install_required' => _n_noop( + /* translators: 1: plugin name(s). */ + 'This theme requires the following plugin: %1$s.', + 'This theme requires the following plugins: %1$s.', + 'cordero' + ), + 'notice_can_install_recommended' => _n_noop( + /* translators: 1: plugin name(s). */ + 'Setup your new website quickly with %1$s.', + 'This theme recommends the following plugins: %1$s.', + 'cordero' + ), + 'notice_ask_to_update' => _n_noop( + /* translators: 1: plugin name(s). */ + 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', + 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', + 'cordero' + ), + 'notice_ask_to_update_maybe' => _n_noop( + /* translators: 1: plugin name(s). */ + 'There is an update available for: %1$s.', + 'There are updates available for the following plugins: %1$s.', + 'cordero' + ), + 'notice_can_activate_required' => _n_noop( + /* translators: 1: plugin name(s). */ + 'The following required plugin is currently inactive: %1$s.', + 'The following required plugins are currently inactive: %1$s.', + 'cordero' + ), + + 'notice_can_activate_recommended' => _n_noop( + /* translators: 1: plugin name(s). */ + 'Did you know you can import demo content and set up your new website quickly and easily with %1$s?', + 'The following recommended plugins are currently inactive: %1$s.', + 'cordero' + ), + + 'install_link' => _n_noop( + 'Install plugin', + 'Install plugins', + 'cordero' + ), + 'update_link' => _n_noop( + 'Update plugin', + 'Update plugins', + 'cordero' + ), + 'activate_link' => _n_noop( + 'Activate plugin', + 'Activate plugins', + 'cordero' + ), + 'return' => __( 'Return to Required Plugins Installer', 'cordero' ), + 'dashboard' => __( 'Return to the Dashboard', 'cordero' ), + 'plugin_activated' => __( 'Plugin activated successfully.', 'cordero' ), + 'activated_successfully' => __( 'The following plugin was activated successfully:', 'cordero' ), + /* translators: 1: plugin name. */ + 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'cordero' ), + /* translators: 1: plugin name. */ + 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'cordero' ), + /* translators: 1: dashboard link. */ + 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'cordero' ), + 'dismiss' => __( 'Dismiss this notice', 'cordero' ), + 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'cordero' ), + 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'cordero' ), + ); + + do_action( 'tgmpa_register' ); + + /* After this point, the plugins should be registered and the configuration set. */ + + // Proceed only if we have plugins to handle. + if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { + return; + } + + // Set up the menu and notices if we still have outstanding actions. + if ( true !== $this->is_tgmpa_complete() ) { + // Sort the plugins. + array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); + + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + add_action( 'admin_head', array( $this, 'dismiss' ) ); + + // Prevent the normal links from showing underneath a single install/update page. + add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); + add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); + + if ( $this->has_notices ) { + add_action( 'admin_notices', array( $this, 'notices' ) ); + add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); + add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); + } + } + + // If needed, filter plugin action links. + add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); + + // Make sure things get reset on switch theme. + add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); + + if ( $this->has_notices ) { + add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); + } + + // Setup the force activation hook. + if ( true === $this->has_forced_activation ) { + add_action( 'admin_init', array( $this, 'force_activation' ) ); + } + + // Setup the force deactivation hook. + if ( true === $this->has_forced_deactivation ) { + add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); + } + } + + + + + + + + /** + * Hook in plugin action link filters for the WP native plugins page. + * + * - Prevent activation of plugins which don't meet the minimum version requirements. + * - Prevent deactivation of force-activated plugins. + * - Add update notice if update available. + * + * @since 2.5.0 + */ + public function add_plugin_action_link_filters() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( false === $this->can_plugin_activate( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); + } + + if ( true === $plugin['force_activation'] ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); + } + + if ( false !== $this->does_plugin_require_update( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); + } + } + } + + /** + * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_activate( $actions ) { + unset( $actions['activate'] ); + + return $actions; + } + + /** + * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_deactivate( $actions ) { + unset( $actions['deactivate'] ); + + return $actions; + } + + /** + * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_update( $actions ) { + $actions['update'] = sprintf( + '%3$s', + esc_url( $this->get_tgmpa_status_url( 'update' ) ), + esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'cordero' ), + esc_html__( 'Update Required', 'cordero' ) + ); + + return $actions; + } + + /** + * Handles calls to show plugin information via links in the notices. + * + * We get the links in the admin notices to point to the TGMPA page, rather + * than the typical plugin-install.php file, so we can prepare everything + * beforehand. + * + * WP does not make it easy to show the plugin information in the thickbox - + * here we have to require a file that includes a function that does the + * main work of displaying it, enqueue some styles, set up some globals and + * finally call that function before exiting. + * + * Down right easy once you know how... + * + * Returns early if not the TGMPA page. + * + * @since 2.1.0 + * + * @global string $tab Used as iframe div class names, helps with styling + * @global string $body_id Used as the iframe body ID, helps with styling + * + * @return null Returns early if not the TGMPA page. + */ + public function admin_init() { + if ( ! $this->is_tgmpa_page() ) { + return; + } + + if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { + // Needed for install_plugin_information(). + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + + wp_enqueue_style( 'plugin-install' ); + + global $tab, $body_id; + $body_id = 'plugin-information'; + // @codingStandardsIgnoreStart + $tab = 'plugin-information'; + // @codingStandardsIgnoreEnd + + install_plugin_information(); + + exit; + } + } + + /** + * Enqueue thickbox scripts/styles for plugin info. + * + * Thickbox is not automatically included on all admin pages, so we must + * manually enqueue it for those pages. + * + * Thickbox is only loaded if the user has not dismissed the admin + * notice or if there are any plugins left to install and activate. + * + * @since 2.1.0 + */ + public function thickbox() { + if ( ! get_user_meta( get_current_user_id(), 'cordero_tgmpa_dismissed_notice_' . $this->id, true ) ) { + add_thickbox(); + } + } + + /** + * Adds submenu page if there are plugin actions to take. + * + * This method adds the submenu page letting users know that a required + * plugin needs to be installed. + * + * This page disappears once the plugin has been installed and activated. + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + * @see TGM_Plugin_Activation::install_plugins_page() + * + * @return null Return early if user lacks capability to install a plugin. + */ + public function admin_menu() { + // Make sure privileges are correct to see the page. + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + $args = apply_filters( + 'tgmpa_admin_menu_args', + array( + 'parent_slug' => $this->parent_slug, // Parent Menu slug. + 'page_title' => $this->strings['page_title'], // Page title. + 'menu_title' => $this->strings['menu_title'], // Menu title. + 'capability' => $this->capability, // Capability. + 'menu_slug' => $this->menu, // Menu slug. + 'function' => array( $this, 'install_plugins_page' ), // Callback. + ) + ); + + $this->add_admin_menu( $args ); + } + + /** + * Add the menu item. + * + * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA + * generator on the website.}} + * + * @since 2.5.0 + * + * @param array $args Menu item configuration. + */ + protected function add_admin_menu( array $args ) { + $this->page_hook = add_theme_page( $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); + } + + /** + * Echoes plugin installation form. + * + * This method is the callback for the admin_menu method function. + * This displays the admin page and form area where the user can select to install and activate the plugin. + * Aborts early if we're processing a plugin installation action. + * + * @since 1.0.0 + * + * @return null Aborts early if we're processing a plugin installation action. + */ + public function install_plugins_page() { + // Store new instance of plugin table in object. + $plugin_table = new TGMPA_List_Table; + + // Return early if processing a plugin installation action. + if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { + return; + } + + // Force refresh of available plugin information so we'll know about manual updates/deletes. + wp_clean_plugins_cache( false ); + + ?> +
+

+ prepare_items(); ?> + + message ) && is_string( $this->message ) ) { + echo wp_kses_post( $this->message ); + } + ?> + views(); ?> + +
+ + + display(); ?> +
+
+ sanitize_key( urldecode( $_GET['plugin'] ) ); + + if ( ! isset( $this->plugins[ $slug ] ) ) { + return false; + } + + // Was an install or upgrade action link clicked? + if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { + + $install_type = 'install'; + if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { + $install_type = 'update'; + } + + check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); + + // Pass necessary information via URL if WP_Filesystem is needed. + $url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $slug ), + 'tgmpa-' . $install_type => $install_type . '-plugin', + ), + $this->get_tgmpa_url() + ), + 'tgmpa-' . $install_type, + 'tgmpa-nonce' + ); + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { + return true; + } + + if ( ! WP_Filesystem( $creds ) ) { + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. + return true; + } + + /* If we arrive here, we have the filesystem. */ + + // Prep variables for Plugin_Installer_Skin class. + $extra = array(); + $extra['slug'] = $slug; // Needed for potentially renaming of directory name. + $source = $this->get_download_url( $slug ); + $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; + $api = ( false !== $api ) ? $api : null; + + $url = add_query_arg( + array( + 'action' => $install_type . '-plugin', + 'plugin' => urlencode( $slug ), + ), + 'update.php' + ); + + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; + $skin_args = array( + 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', + 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), + 'url' => esc_url_raw( $url ), + 'nonce' => $install_type . '-plugin_' . $slug, + 'plugin' => '', + 'api' => $api, + 'extra' => $extra, + ); + unset( $title ); + + if ( 'update' === $install_type ) { + $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; + $skin = new Plugin_Upgrader_Skin( $skin_args ); + } else { + $skin = new Plugin_Installer_Skin( $skin_args ); + } + + // Create a new instance of Plugin_Upgrader. + $upgrader = new Plugin_Upgrader( $skin ); + + // Perform the action and install the plugin from the $source urldecode(). + add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'update' === $install_type ) { + // Inject our info into the update transient. + $to_inject = array( $slug => $this->plugins[ $slug ] ); + $to_inject[ $slug ]['source'] = $source; + $this->inject_update_info( $to_inject ); + + $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); + } else { + $upgrader->install( $source ); + } + + remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 ); + + // Make sure we have the correct file path now the plugin is installed/updated. + $this->populate_file_path( $slug ); + + // Only activate plugins if the config option is set to true and the plugin isn't + // already active (upgrade). + if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { + $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. + if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + $this->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + if ( $this->is_tgmpa_complete() ) { + echo '

', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'cordero' ) . '' ), '

'; + echo ''; + } else { + echo '

', esc_html( $this->strings['return'] ), '

'; + } + + return true; + } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { + // Activate action link was clicked. + check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); + + if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + return false; + } + + /** + * Inject information into the 'update_plugins' site transient as WP checks that before running an update. + * + * @since 2.5.0 + * + * @param array $plugins The plugin information for the plugins which are to be updated. + */ + public function inject_update_info( $plugins ) { + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! is_object( $repo_updates ) ) { + $repo_updates = new stdClass; + } + + foreach ( $plugins as $slug => $plugin ) { + $file_path = $plugin['file_path']; + + if ( empty( $repo_updates->response[ $file_path ] ) ) { + $repo_updates->response[ $file_path ] = new stdClass; + } + + // We only really need to set package, but let's do all we can in case WP changes something. + $repo_updates->response[ $file_path ]->slug = $slug; + $repo_updates->response[ $file_path ]->plugin = $file_path; + $repo_updates->response[ $file_path ]->new_version = $plugin['version']; + $repo_updates->response[ $file_path ]->package = $plugin['source']; + if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { + $repo_updates->response[ $file_path ]->url = $plugin['external_url']; + } + } + + set_site_transient( 'update_plugins', $repo_updates ); + } + + /** + * Adjust the plugin directory name if necessary. + * + * The final destination directory of a plugin is based on the subdirectory name found in the + * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this + * subdirectory name is not the same as the expected slug and the plugin will not be recognized + * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to + * the expected plugin slug. + * + * @since 2.5.0 + * + * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. + * @param string $remote_source Path to upgrade/zip-file-name.tmp. + * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. + * @return string $source + */ + public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { + if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { + return $source; + } + + // Check for single file plugins. + $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); + if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { + return $source; + } + + // Multi-file plugin, let's see if the directory is correctly named. + $desired_slug = ''; + + // Figure out what the slug is supposed to be. + if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { + $desired_slug = $upgrader->skin->options['extra']['slug']; + } else { + // Bulk installer contains less info, so fall back on the info registered here. + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { + $desired_slug = $slug; + break; + } + } + unset( $slug, $plugin ); + } + + if ( ! empty( $desired_slug ) ) { + $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); + + if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { + $from_path = untrailingslashit( $source ); + $to_path = trailingslashit( $remote_source ) . $desired_slug; + + if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) { + return trailingslashit( $to_path ); + } else { + return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'cordero' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'cordero' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } elseif ( empty( $subdir_name ) ) { + return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'cordero' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'cordero' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } + + return $source; + } + + /** + * Activate a single plugin and send feedback about the result to the screen. + * + * @since 2.5.0 + * + * @param string $file_path Path within wp-plugins/ to main plugin file. + * @param string $slug Plugin slug. + * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. + * This determines the styling of the output messages. + * @return bool False if an error was encountered, true otherwise. + */ + protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { + if ( $this->can_plugin_activate( $slug ) ) { + $activate = activate_plugin( $file_path ); + + if ( is_wp_error( $activate ) ) { + echo '

', wp_kses_post( $activate->get_error_message() ), '

', + '

', esc_html( $this->strings['return'] ), '

'; + + return false; // End it here if there is an error with activation. + } else { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

'; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

', esc_html( $this->strings['plugin_activated'] ), '

'; + } + } + } elseif ( $this->is_plugin_active( $slug ) ) { + // No simpler message format provided as this message should never be encountered + // on the plugin install page. + echo '

', + sprintf( + esc_html( $this->strings['plugin_already_active'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

'; + } elseif ( $this->does_plugin_require_update( $slug ) ) { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

', + sprintf( + esc_html( $this->strings['plugin_needs_higher_version'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

'; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

'; + } + } + + return true; + } + + /** + * Echoes required plugin notice. + * + * Outputs a message telling users that a specific plugin is required for + * their theme. If appropriate, it includes a link to the form page where + * users can install and activate the plugin. + * + * Returns early if we're on the Install page. + * + * @since 1.0.0 + * + * @global object $current_screen + * + * @return null Returns early if we're on the Install page. + */ + public function notices() { + // Remove nag on the install page / Return early if the nag message has been dismissed or user < author. + if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'cordero_tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) { + return; + } + + // Store for the plugin slugs by message type. + $message = array(); + + // Initialize counters used to determine plurality of action link texts. + $install_link_count = 0; + $update_link_count = 0; + $activate_link_count = 0; + $total_required_action_count = 0; + + foreach ( $this->plugins as $slug => $plugin ) { + if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { + continue; + } + + if ( ! $this->is_plugin_installed( $slug ) ) { + if ( current_user_can( 'install_plugins' ) ) { + $install_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_install_required'][] = $slug; + } else { + $message['notice_can_install_recommended'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } else { + if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { + if ( current_user_can( 'activate_plugins' ) ) { + $activate_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_activate_required'][] = $slug; + } else { + $message['notice_can_activate_recommended'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } + + if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + + if ( current_user_can( 'update_plugins' ) ) { + $update_link_count++; + + if ( $this->does_plugin_require_update( $slug ) ) { + $message['notice_ask_to_update'][] = $slug; + } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { + $message['notice_ask_to_update_maybe'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } + } + } + unset( $slug, $plugin ); + + // If we have notices to display, we move forward. + if ( ! empty( $message ) || $total_required_action_count > 0 ) { + krsort( $message ); // Sort messages. + $rendered = '' . esc_html__( 'Thank you for using the Cordero theme.', 'cordero' ) . ''; + + // As add_settings_error() wraps the final message in a

and as the final message can't be + // filtered, using

's in our html would render invalid html output. + $line_template = '%s' . "\n"; + + if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { + $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] ); + $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); + } else { + + // If dismissable is false and a message is set, output it now. + if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { + $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); + } + + // Render the individual message lines for the notice. + foreach ( $message as $type => $plugin_group ) { + $linked_plugins = array(); + + // Get the external info link for a plugin if one is available. + foreach ( $plugin_group as $plugin_slug ) { + $linked_plugins[] = $this->get_info_link( $plugin_slug ); + } + unset( $plugin_slug ); + + $count = count( $plugin_group ); + $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); + $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. + $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'cordero' ) . ' ' . $last_plugin ); + + $rendered .= sprintf( + $line_template, + sprintf( + translate_nooped_plural( $this->strings[ $type ], $count, 'cordero' ), + $imploded, + $count + ) + ); + + } + unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); + + $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template ); + } + + // Register the nag messages and prepare them to be processed. + add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() ); + } + + // Admin options pages already output settings_errors, so this is to avoid duplication. + if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { + $this->display_settings_errors(); + } + } + + /** + * Generate the user action links for the admin notice. + * + * @since 2.6.0 + * + * @param int $install_count Number of plugins to install. + * @param int $update_count Number of plugins to update. + * @param int $activate_count Number of plugins to activate. + * @param int $line_template Template for the HTML tag to output a line. + * @return string Action links. + */ + protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) { + // Setup action links. + $action_links = array( + 'install' => '', + 'update' => '', + 'activate' => '', + //'dismiss' => '', + 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', + ); + + $link_template = '%1$s'; + + if ( current_user_can( 'install_plugins' ) ) { + if ( $install_count > 0 ) { + $action_links['install'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['install_link'], $install_count, 'cordero' ), + esc_url( $this->get_tgmpa_status_url( 'install' ) ) + ); + } + if ( $update_count > 0 ) { + $action_links['update'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['update_link'], $update_count, 'cordero' ), + esc_url( $this->get_tgmpa_status_url( 'update' ) ) + ); + } + } + + if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { + $action_links['activate'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'cordero' ), + esc_url( $this->get_tgmpa_status_url( 'activate' ) ) + ); + } + + $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); + + $action_links = array_filter( (array) $action_links ); // Remove any empty array items. + + if ( ! empty( $action_links ) ) { + $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); + return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); + } else { + return ''; + } + } + + /** + * Get admin notice class. + * + * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7 + * (lowest supported version by TGMPA). + * + * @since 2.6.0 + * + * @return string + */ + protected function get_admin_notice_class() { + if ( ! empty( $this->strings['nag_type'] ) ) { + return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); + } else { + if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { + return 'notice-warning'; + } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) { + return 'notice'; + } else { + return 'updated'; + } + } + } + + /** + * Display settings errors and remove those which have been displayed to avoid duplicate messages showing + * + * @since 2.5.0 + */ + protected function display_settings_errors() { + global $wp_settings_errors; + + settings_errors( 'tgmpa' ); + + foreach ( (array) $wp_settings_errors as $key => $details ) { + if ( 'tgmpa' === $details['setting'] ) { + unset( $wp_settings_errors[ $key ] ); + break; + } + } + } + + /** + * Register dismissal of admin notices. + * + * Acts on the dismiss link in the admin nag messages. + * If clicked, the admin notice disappears and will no longer be visible to this user. + * + * @since 2.1.0 + */ + public function dismiss() { + if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) { + update_user_meta( get_current_user_id(), 'cordero_tgmpa_dismissed_notice_' . $this->id, 1 ); + } + } + + /** + * Add individual plugin to our collection of plugins. + * + * If the required keys are not set or the plugin has already + * been registered, the plugin is not added. + * + * @since 2.0.0 + * + * @param array|null $plugin Array of plugin arguments or null if invalid argument. + * @return null Return early if incorrect argument. + */ + public function register( $plugin ) { + if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { + return; + } + + if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { + return; + } + + $defaults = array( + 'name' => '', // String + 'slug' => '', // String + 'source' => 'repo', // String + 'required' => false, // Boolean + 'version' => '', // String + 'force_activation' => false, // Boolean + 'force_deactivation' => false, // Boolean + 'external_url' => '', // String + 'is_callable' => '', // String|Array. + ); + + // Prepare the received data. + $plugin = wp_parse_args( $plugin, $defaults ); + + // Standardize the received slug. + $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); + + // Forgive users for using string versions of booleans or floats for version number. + $plugin['version'] = (string) $plugin['version']; + $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; + $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); + $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); + $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); + + // Enrich the received data. + $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); + $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); + + // Set the class properties. + $this->plugins[ $plugin['slug'] ] = $plugin; + $this->sort_order[ $plugin['slug'] ] = $plugin['name']; + + // Should we add the force activation hook ? + if ( true === $plugin['force_activation'] ) { + $this->has_forced_activation = true; + } + + // Should we add the force deactivation hook ? + if ( true === $plugin['force_deactivation'] ) { + $this->has_forced_deactivation = true; + } + } + + /** + * Determine what type of source the plugin comes from. + * + * @since 2.5.0 + * + * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path + * (= bundled) or an external URL. + * @return string 'repo', 'external', or 'bundled' + */ + protected function get_plugin_source_type( $source ) { + if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { + return 'repo'; + } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { + return 'external'; + } else { + return 'bundled'; + } + } + + /** + * Sanitizes a string key. + * + * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* + * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase + * characters in the plugin directory path/slug. Silly them. + * + * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ + * + * @since 2.5.0 + * + * @param string $key String key. + * @return string Sanitized key + */ + public function sanitize_key( $key ) { + $raw_key = $key; + $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); + + /** + * Filter a sanitized key string. + * + * @since 2.5.0 + * + * @param string $key Sanitized key. + * @param string $raw_key The key prior to sanitization. + */ + return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); + } + + /** + * Amend default configuration settings. + * + * @since 2.0.0 + * + * @param array $config Array of config options to pass as class properties. + */ + public function config( $config ) { + $keys = array( + 'id', + 'default_path', + 'has_notices', + 'dismissable', + 'dismiss_msg', + 'menu', + 'parent_slug', + 'capability', + 'is_automatic', + 'message', + 'strings', + ); + + foreach ( $keys as $key ) { + if ( isset( $config[ $key ] ) ) { + if ( is_array( $config[ $key ] ) ) { + $this->$key = array_merge( $this->$key, $config[ $key ] ); + } else { + $this->$key = $config[ $key ]; + } + } + } + } + + /** + * Amend action link after plugin installation. + * + * @since 2.0.0 + * + * @param array $install_actions Existing array of actions. + * @return false|array Amended array of actions. + */ + public function actions( $install_actions ) { + // Remove action links on the TGMPA install page. + if ( $this->is_tgmpa_page() ) { + return false; + } + + return $install_actions; + } + + /** + * Flushes the plugins cache on theme switch to prevent stale entries + * from remaining in the plugin table. + * + * @since 2.4.0 + * + * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. + * Parameter added in v2.5.0. + */ + public function flush_plugins_cache( $clear_update_cache = true ) { + wp_clean_plugins_cache( $clear_update_cache ); + } + + /** + * Set file_path key for each installed plugin. + * + * @since 2.1.0 + * + * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. + * Parameter added in v2.5.0. + */ + public function populate_file_path( $plugin_slug = '' ) { + if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { + $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); + } else { + // Add file_path key for all plugins. + foreach ( $this->plugins as $slug => $values ) { + $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); + } + } + } + + /** + * Helper function to extract the file path of the plugin file from the + * plugin slug, if the plugin is installed. + * + * @since 2.0.0 + * + * @param string $slug Plugin slug (typically folder name) as provided by the developer. + * @return string Either file path for plugin if installed, or just the plugin slug. + */ + protected function _get_plugin_basename_from_slug( $slug ) { + $keys = array_keys( $this->get_plugins() ); + + foreach ( $keys as $key ) { + if ( preg_match( '|^' . $slug . '/|', $key ) ) { + return $key; + } + } + + return $slug; + } + + /** + * Retrieve plugin data, given the plugin name. + * + * Loops through the registered plugins looking for $name. If it finds it, + * it returns the $data from that plugin. Otherwise, returns false. + * + * @since 2.1.0 + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + public function _get_plugin_data_from_name( $name, $data = 'slug' ) { + foreach ( $this->plugins as $values ) { + if ( $name === $values['name'] && isset( $values[ $data ] ) ) { + return $values[ $data ]; + } + } + + return false; + } + + /** + * Retrieve the download URL for a package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL or path to local file or empty string if undetermined. + */ + public function get_download_url( $slug ) { + $dl_source = ''; + + switch ( $this->plugins[ $slug ]['source_type'] ) { + case 'repo': + return $this->get_wp_repo_download_url( $slug ); + case 'external': + return $this->plugins[ $slug ]['source']; + case 'bundled': + return $this->default_path . $this->plugins[ $slug ]['source']; + } + + return $dl_source; // Should never happen. + } + + /** + * Retrieve the download URL for a WP repo package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL. + */ + protected function get_wp_repo_download_url( $slug ) { + $source = ''; + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->download_link ) ) { + $source = $api->download_link; + } + + return $source; + } + + /** + * Try to grab information from WordPress API. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return object Plugins_api response object on success, WP_Error on failure. + */ + protected function get_plugins_api( $slug ) { + static $api = array(); // Cache received responses. + + if ( ! isset( $api[ $slug ] ) ) { + if ( ! function_exists( 'plugins_api' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + } + + $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); + + $api[ $slug ] = false; + + if ( is_wp_error( $response ) ) { + wp_die( esc_html( $this->strings['oops'] ) ); + } else { + $api[ $slug ] = $response; + } + } + + return $api[ $slug ]; + } + + /** + * Retrieve a link to a plugin information page. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Fully formed html link to a plugin information page if available + * or the plugin name if not. + */ + public function get_info_link( $slug ) { + if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { + $link = sprintf( + '%2$s', + esc_url( $this->plugins[ $slug ]['external_url'] ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { + $url = add_query_arg( + array( + 'tab' => 'plugin-information', + 'plugin' => urlencode( $slug ), + 'TB_iframe' => 'true', + 'width' => '640', + 'height' => '500', + ), + self_admin_url( 'plugin-install.php' ) + ); + + $link = sprintf( + '%2$s', + esc_url( $url ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } else { + $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. + } + + return $link; + } + + /** + * Determine if we're on the TGMPA Install page. + * + * @since 2.1.0 + * + * @return boolean True when on the TGMPA page, false otherwise. + */ + protected function is_tgmpa_page() { + return isset( $_GET['page'] ) && $this->menu === $_GET['page']; + } + + /** + * Determine if we're on a WP Core installation/upgrade page. + * + * @since 2.6.0 + * + * @return boolean True when on a WP Core installation/upgrade page, false otherwise. + */ + protected function is_core_update_page() { + // Current screen is not always available, most notably on the customizer screen. + if ( ! function_exists( 'get_current_screen' ) ) { + return false; + } + + $screen = get_current_screen(); + + if ( 'update-core' === $screen->base ) { + // Core update screen. + return true; + } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. + // Plugins bulk update screen. + return true; + } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. + // Individual updates (ajax call). + return true; + } + + return false; + } + + /** + * Retrieve the URL to the TGMPA Install page. + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins + * + * @since 2.5.0 + * + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_url() { + static $url; + + if ( ! isset( $url ) ) { + $parent = $this->parent_slug; + if ( false === strpos( $parent, '.php' ) ) { + $parent = 'admin.php'; + } + $url = add_query_arg( + array( + 'page' => urlencode( $this->menu ), + ), + self_admin_url( $parent ) + ); + } + + return $url; + } + + /** + * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install + * + * @since 2.5.0 + * + * @param string $status Plugin status - either 'install', 'update' or 'activate'. + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_status_url( $status ) { + return add_query_arg( + array( + 'plugin_status' => urlencode( $status ), + ), + $this->get_tgmpa_url() + ); + } + + /** + * Determine whether there are open actions for plugins registered with TGMPA. + * + * @since 2.5.0 + * + * @return bool True if complete, i.e. no outstanding actions. False otherwise. + */ + public function is_tgmpa_complete() { + $complete = true; + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + $complete = false; + break; + } + } + + return $complete; + } + + /** + * Check if a plugin is installed. Does not take must-use plugins into account. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if installed, false otherwise. + */ + public function is_plugin_installed( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); + } + + /** + * Check if a plugin is active. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if active, false otherwise. + */ + public function is_plugin_active( $slug ) { + return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); + } + + /** + * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required + * available, check whether the current install meets them. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to update, false otherwise. + */ + public function can_plugin_update( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return true; + } + + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->requires ) ) { + return version_compare( $this->wp_version, $api->requires, '>=' ); + } + + // No usable info received from the plugins API, presume we can update. + return true; + } + + /** + * Check to see if the plugin is 'updatetable', i.e. installed, with an update available + * and no WP version requirements blocking it. + * + * @since 2.6.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to proceed with update, false otherwise. + */ + public function is_plugin_updatetable( $slug ) { + if ( ! $this->is_plugin_installed( $slug ) ) { + return false; + } else { + return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) ); + } + } + + /** + * Check if a plugin can be activated, i.e. is not currently active and meets the minimum + * plugin version requirements set in TGMPA (if any). + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to activate, false otherwise. + */ + public function can_plugin_activate( $slug ) { + return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); + } + + /** + * Retrieve the version number of an installed plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Version number as string or an empty string if the plugin is not installed + * or version unknown (plugins which don't comply with the plugin header standard). + */ + public function get_installed_version( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { + return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; + } + + return ''; + } + + /** + * Check whether a plugin complies with the minimum version requirements. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True when a plugin needs to be updated, otherwise false. + */ + public function does_plugin_require_update( $slug ) { + $installed_version = $this->get_installed_version( $slug ); + $minimum_version = $this->plugins[ $slug ]['version']; + + return version_compare( $minimum_version, $installed_version, '>' ); + } + + /** + * Check whether there is an update available for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return false|string Version number string of the available update or false if no update available. + */ + public function does_plugin_have_update( $slug ) { + // Presume bundled and external plugins will point to a package which meets the minimum required version. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + if ( $this->does_plugin_require_update( $slug ) ) { + return $this->plugins[ $slug ]['version']; + } + + return false; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; + } + + return false; + } + + /** + * Retrieve potential upgrade notice for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string The upgrade notice or an empty string if no message was available or provided. + */ + public function get_upgrade_notice( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return ''; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; + } + + return ''; + } + + /** + * Wrapper around the core WP get_plugins function, making sure it's actually available. + * + * @since 2.5.0 + * + * @param string $plugin_folder Optional. Relative path to single plugin folder. + * @return array Array of installed plugins with plugin information. + */ + public function get_plugins( $plugin_folder = '' ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + return get_plugins( $plugin_folder ); + } + + /** + * Delete dismissable nag option when theme is switched. + * + * This ensures that the user(s) is/are again reminded via nag of required + * and/or recommended plugins if they re-activate the theme. + * + * @since 2.1.1 + */ + public function update_dismiss() { + delete_metadata( 'user', null, 'cordero_tgmpa_dismissed_notice_' . $this->id, null, true ); + } + + /** + * Forces plugin activation if the parameter 'force_activation' is + * set to true. + * + * This allows theme authors to specify certain plugins that must be + * active at all times while using the current theme. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. Setting this parameter + * to true will not allow the specified plugin to be deactivated unless + * the user switches themes. + * + * @since 2.2.0 + */ + public function force_activation() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( true === $plugin['force_activation'] ) { + if ( ! $this->is_plugin_installed( $slug ) ) { + // Oops, plugin isn't there so iterate to next condition. + continue; + } elseif ( $this->can_plugin_activate( $slug ) ) { + // There we go, activate the plugin. + activate_plugin( $plugin['file_path'] ); + } + } + } + } + + /** + * Forces plugin deactivation if the parameter 'force_deactivation' + * is set to true and adds the plugin to the 'recently active' plugins list. + * + * This allows theme authors to specify certain plugins that must be + * deactivated upon switching from the current theme to another. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. + * + * @since 2.2.0 + */ + public function force_deactivation() { + $deactivated = array(); + + foreach ( $this->plugins as $slug => $plugin ) { + /* + * Only proceed forward if the parameter is set to true and plugin is active + * as a 'normal' (not must-use) plugin. + */ + if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { + deactivate_plugins( $plugin['file_path'] ); + $deactivated[ $plugin['file_path'] ] = time(); + } + } + + if ( ! empty( $deactivated ) ) { + update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); + } + } + + /** + * Echo the current TGMPA version number to the page. + * + * @since 2.5.0 + */ + public function show_tgmpa_version() { + echo '

', + esc_html( + sprintf( + /* translators: %s: version number */ + __( 'TGMPA v%s', 'cordero' ), + self::TGMPA_VERSION + ) + ), + '

'; + } + + /** + * Returns the singleton instance of the class. + * + * @since 2.4.0 + * + * @return \TGM_Plugin_Activation The TGM_Plugin_Activation object. + */ + public static function get_instance() { + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { + self::$instance = new self(); + } + + return self::$instance; + } + } + + if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { + /** + * Ensure only one instance of the class is ever invoked. + * + * @since 2.5.0 + */ + function load_tgm_plugin_activation() { + $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); + } + } + + if ( did_action( 'plugins_loaded' ) ) { + load_tgm_plugin_activation(); + } else { + add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); + } +} + +if ( ! function_exists( 'tgmpa' ) ) { + /** + * Helper function to register a collection of required plugins. + * + * @since 2.0.0 + * @api + * + * @param array $plugins An array of plugin arrays. + * @param array $config Optional. An array of configuration values. + */ + function tgmpa( $plugins, $config = array() ) { + $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + foreach ( $plugins as $plugin ) { + call_user_func( array( $instance, 'register' ), $plugin ); + } + + if ( ! empty( $config ) && is_array( $config ) ) { + // Send out notices for deprecated arguments passed. + if ( isset( $config['notices'] ) ) { + _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); + if ( ! isset( $config['has_notices'] ) ) { + $config['has_notices'] = $config['notices']; + } + } + + if ( isset( $config['parent_menu_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + if ( isset( $config['parent_url_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + + call_user_func( array( $instance, 'config' ), $config ); + } + } +} + +/** + * WP_List_Table isn't always available. If it isn't available, + * we load it here. + * + * @since 2.2.0 + */ +if ( ! class_exists( 'WP_List_Table' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; +} + +if ( ! class_exists( 'TGMPA_List_Table' ) ) { + + /** + * List table class for handling plugins. + * + * Extends the WP_List_Table class to provide a future-compatible + * way of listing out all required/recommended plugins. + * + * Gives users an interface similar to the Plugin Administration + * area with similar (albeit stripped down) capabilities. + * + * This class also allows for the bulk install of plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_List_Table extends WP_List_Table { + /** + * TGMPA instance. + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * The currently chosen view. + * + * @since 2.5.0 + * + * @var string One of: 'all', 'install', 'update', 'activate' + */ + public $view_context = 'all'; + + /** + * The plugin counts for the various views. + * + * @since 2.5.0 + * + * @var array + */ + protected $view_totals = array( + 'all' => 0, + 'install' => 0, + 'update' => 0, + 'activate' => 0, + ); + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + */ + public function __construct() { + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( + array( + 'singular' => 'plugin', + 'plural' => 'plugins', + 'ajax' => false, + ) + ); + + if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { + $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); + } + + add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); + } + + /** + * Get a list of CSS classes for the tag. + * + * Overruled to prevent the 'plural' argument from being added. + * + * @since 2.5.0 + * + * @return array CSS classnames. + */ + public function get_table_classes() { + return array( 'widefat', 'fixed' ); + } + + /** + * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. + * + * @since 2.2.0 + * + * @return array $table_data Information for use in table. + */ + protected function _gather_plugin_data() { + // Load thickbox for plugin links. + $this->tgmpa->admin_init(); + $this->tgmpa->thickbox(); + + // Categorize the plugins which have open actions. + $plugins = $this->categorize_plugins_to_views(); + + // Set the counts for the view links. + $this->set_view_totals( $plugins ); + + // Prep variables for use and grab list of all installed plugins. + $table_data = array(); + $i = 0; + + // Redirect to the 'all' view if no plugins were found for the selected view context. + if ( empty( $plugins[ $this->view_context ] ) ) { + $this->view_context = 'all'; + } + + foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { + $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; + $table_data[ $i ]['slug'] = $slug; + $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; + $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); + $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); + $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); + $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); + $table_data[ $i ]['minimum_version'] = $plugin['version']; + $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); + + // Prep the upgrade notice info. + $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); + if ( ! empty( $upgrade_notice ) ) { + $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; + + add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 ); + } + + $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); + + $i++; + } + + return $table_data; + } + + /** + * Categorize the plugins which have open actions into views for the TGMPA page. + * + * @since 2.5.0 + */ + protected function categorize_plugins_to_views() { + $plugins = array( + 'all' => array(), // Meaning: all plugins which still have open actions. + 'install' => array(), + 'update' => array(), + 'activate' => array(), + ); + + foreach ( $this->tgmpa->plugins as $slug => $plugin ) { + if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { + // No need to display plugins if they are installed, up-to-date and active. + continue; + } else { + $plugins['all'][ $slug ] = $plugin; + + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + $plugins['install'][ $slug ] = $plugin; + } else { + if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $plugins['update'][ $slug ] = $plugin; + } + + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins['activate'][ $slug ] = $plugin; + } + } + } + } + + return $plugins; + } + + /** + * Set the counts for the view links. + * + * @since 2.5.0 + * + * @param array $plugins Plugins order by view. + */ + protected function set_view_totals( $plugins ) { + foreach ( $plugins as $type => $list ) { + $this->view_totals[ $type ] = count( $list ); + } + } + + /** + * Get the plugin required/recommended text string. + * + * @since 2.5.0 + * + * @param string $required Plugin required setting. + * @return string + */ + protected function get_plugin_advise_type_text( $required ) { + if ( true === $required ) { + return __( 'Required', 'cordero' ); + } + + return __( 'Recommended', 'cordero' ); + } + + /** + * Get the plugin source type text string. + * + * @since 2.5.0 + * + * @param string $type Plugin type. + * @return string + */ + protected function get_plugin_source_type_text( $type ) { + $string = ''; + + switch ( $type ) { + case 'repo': + $string = __( 'WordPress Repository', 'cordero' ); + break; + case 'external': + $string = __( 'External Source', 'cordero' ); + break; + case 'bundled': + $string = __( 'Pre-Packaged', 'cordero' ); + break; + } + + return $string; + } + + /** + * Determine the plugin status message. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string + */ + protected function get_plugin_status_text( $slug ) { + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + return __( 'Not Installed', 'cordero' ); + } + + if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { + $install_status = __( 'Installed But Not Activated', 'cordero' ); + } else { + $install_status = __( 'Active', 'cordero' ); + } + + $update_status = ''; + + if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Required Update not Available', 'cordero' ); + + } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { + $update_status = __( 'Requires Update', 'cordero' ); + + } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Update recommended', 'cordero' ); + } + + if ( '' === $update_status ) { + return $install_status; + } + + return sprintf( + /* translators: 1: install status, 2: update status */ + _x( '%1$s, %2$s', 'Install/Update Status', 'cordero' ), + $install_status, + $update_status + ); + } + + /** + * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. + * + * @since 2.5.0 + * + * @param array $items Prepared table items. + * @return array Sorted table items. + */ + public function sort_table_items( $items ) { + $type = array(); + $name = array(); + + foreach ( $items as $i => $plugin ) { + $type[ $i ] = $plugin['type']; // Required / recommended. + $name[ $i ] = $plugin['sanitized_plugin']; + } + + array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); + + return $items; + } + + /** + * Get an associative array ( id => link ) of the views available on this table. + * + * @since 2.5.0 + * + * @return array + */ + public function get_views() { + $status_links = array(); + + foreach ( $this->view_totals as $type => $count ) { + if ( $count < 1 ) { + continue; + } + + switch ( $type ) { + case 'all': + /* translators: 1: number of plugins. */ + $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins', 'cordero' ); + break; + case 'install': + /* translators: 1: number of plugins. */ + $text = _n( 'To Install (%s)', 'To Install (%s)', $count, 'cordero' ); + break; + case 'update': + /* translators: 1: number of plugins. */ + $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count, 'cordero' ); + break; + case 'activate': + /* translators: 1: number of plugins. */ + $text = _n( 'To Activate (%s)', 'To Activate (%s)', $count, 'cordero' ); + break; + default: + $text = ''; + break; + } + + if ( ! empty( $text ) ) { + + $status_links[ $type ] = sprintf( + '%s', + esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), + ( $type === $this->view_context ) ? ' class="current"' : '', + sprintf( $text, number_format_i18n( $count ) ) + ); + } + } + + return $status_links; + } + + /** + * Create default columns to display important plugin information + * like type, action and status. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @param string $column_name The name of the column. + * @return string + */ + public function column_default( $item, $column_name ) { + return $item[ $column_name ]; + } + + /** + * Required for bulk installing. + * + * Adds a checkbox for each plugin. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The input checkbox with all necessary info. + */ + public function column_cb( $item ) { + return sprintf( + '', + esc_attr( $this->_args['singular'] ), + esc_attr( $item['slug'] ), + esc_attr( $item['sanitized_plugin'] ) + ); + } + + /** + * Create default title column along with the action links. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The plugin name and action links. + */ + public function column_plugin( $item ) { + return sprintf( + '%1$s %2$s', + $item['plugin'], + $this->row_actions( $this->get_row_actions( $item ), true ) + ); + } + + /** + * Create version information column. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return string HTML-formatted version information. + */ + public function column_version( $item ) { + $output = array(); + + if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'cordero' ); + + $color = ''; + if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { + $color = ' color: #ff0000; font-weight: bold;'; + } + + $output[] = sprintf( + '

%2$s' . __( 'Installed version:', 'cordero' ) . '

', + $color, + $installed + ); + } + + if ( ! empty( $item['minimum_version'] ) ) { + $output[] = sprintf( + '

%1$s' . __( 'Minimum required version:', 'cordero' ) . '

', + $item['minimum_version'] + ); + } + + if ( ! empty( $item['available_version'] ) ) { + $color = ''; + if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { + $color = ' color: #71C671; font-weight: bold;'; + } + + $output[] = sprintf( + '

%2$s' . __( 'Available version:', 'cordero' ) . '

', + $color, + $item['available_version'] + ); + } + + if ( empty( $output ) ) { + return ' '; // Let's not break the table layout. + } else { + return implode( "\n", $output ); + } + } + + /** + * Sets default message within the plugins table if no plugins + * are left for interaction. + * + * Hides the menu item to prevent the user from clicking and + * getting a permissions error. + * + * @since 2.2.0 + */ + public function no_items() { + echo esc_html__( 'No plugins to install, update or activate.', 'cordero' ) . ' ' . esc_html__( 'Return to the Dashboard', 'cordero' ) . ''; + echo ''; + } + + /** + * Output all the column information within the table. + * + * @since 2.2.0 + * + * @return array $columns The column names. + */ + public function get_columns() { + $columns = array( + 'cb' => '', + 'plugin' => __( 'Plugin', 'cordero' ), + 'source' => __( 'Source', 'cordero' ), + 'type' => __( 'Type', 'cordero' ), + ); + + if ( 'all' === $this->view_context || 'update' === $this->view_context ) { + $columns['version'] = __( 'Version', 'cordero' ); + $columns['status'] = __( 'Status', 'cordero' ); + } + + return apply_filters( 'tgmpa_table_columns', $columns ); + } + + /** + * Get name of default primary column + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string + */ + protected function get_default_primary_column_name() { + return 'plugin'; + } + + /** + * Get the name of the primary column. + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string The name of the primary column. + */ + protected function get_primary_column_name() { + if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { + return parent::get_primary_column_name(); + } else { + return $this->get_default_primary_column_name(); + } + } + + /** + * Get the actions which are relevant for a specific plugin row. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return array Array with relevant action links. + */ + protected function get_row_actions( $item ) { + $actions = array(); + $action_links = array(); + + // Display the 'Install' action link if the plugin is not yet available. + if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['install'] = __( 'Install %2$s', 'cordero' ); + } else { + // Display the 'Update' action link if an update is available and WP complies with plugin minimum. + if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['update'] = __( 'Update %2$s', 'cordero' ); + } + + // Display the 'Activate' action link, but only if the plugin meets the minimum version. + if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['activate'] = __( 'Activate %2$s', 'cordero' ); + } + } + + // Create the actual links. + foreach ( $actions as $action => $text ) { + $nonce_url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $item['slug'] ), + 'tgmpa-' . $action => $action . '-plugin', + ), + $this->tgmpa->get_tgmpa_url() + ), + 'tgmpa-' . $action, + 'tgmpa-nonce' + ); + + $action_links[ $action ] = sprintf( + '' . esc_html( $text ) . '', // $text contains the second placeholder. + esc_url( $nonce_url ), + '' . esc_html( $item['sanitized_plugin'] ) . '' + ); + } + + $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; + return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); + } + + /** + * Generates content for a single row of the table. + * + * @since 2.5.0 + * + * @param object $item The current item. + */ + public function single_row( $item ) { + parent::single_row( $item ); + + /** + * Fires after each specific row in the TGMPA Plugins list table. + * + * The dynamic portion of the hook name, `$item['slug']`, refers to the slug + * for the plugin. + * + * @since 2.5.0 + */ + do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); + } + + /** + * Show the upgrade notice below a plugin row if there is one. + * + * @since 2.5.0 + * + * @see /wp-admin/includes/update.php + * + * @param string $slug Plugin slug. + * @param array $item The information available in this table row. + * @return null Return early if upgrade notice is empty. + */ + public function wp_plugin_update_row( $slug, $item ) { + if ( empty( $item['upgrade_notice'] ) ) { + return; + } + + echo ' + + + '; + } + + /** + * Extra controls to be displayed between bulk actions and pagination. + * + * @since 2.5.0 + * + * @param string $which 'top' or 'bottom' table navigation. + */ + public function extra_tablenav( $which ) { + if ( 'bottom' === $which ) { + $this->tgmpa->show_tgmpa_version(); + } + } + + /** + * Defines the bulk actions for handling registered plugins. + * + * @since 2.2.0 + * + * @return array $actions The bulk actions for the plugin install table. + */ + public function get_bulk_actions() { + + $actions = array(); + + if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { + if ( current_user_can( 'install_plugins' ) ) { + $actions['tgmpa-bulk-install'] = __( 'Install', 'cordero' ); + } + } + + if ( 'install' !== $this->view_context ) { + if ( current_user_can( 'update_plugins' ) ) { + $actions['tgmpa-bulk-update'] = __( 'Update', 'cordero' ); + } + if ( current_user_can( 'activate_plugins' ) ) { + $actions['tgmpa-bulk-activate'] = __( 'Activate', 'cordero' ); + } + } + + return $actions; + } + + /** + * Processes bulk installation and activation actions. + * + * The bulk installation process looks for the $_POST information and passes that + * through if a user has to use WP_Filesystem to enter their credentials. + * + * @since 2.2.0 + */ + public function process_bulk_actions() { + // Bulk installation process. + if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { + + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + $install_type = 'install'; + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + $install_type = 'update'; + } + + $plugins_to_install = array(); + + // Did user actually select any plugins to install/update ? + if ( empty( $_POST['plugin'] ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins were selected to be installed. No action taken.', 'cordero' ); + } else { + $message = __( 'No plugins were selected to be updated. No action taken.', 'cordero' ); + } + + echo '

', esc_html( $message ), '

'; + + return false; + } + + if ( is_array( $_POST['plugin'] ) ) { + $plugins_to_install = (array) $_POST['plugin']; + } elseif ( is_string( $_POST['plugin'] ) ) { + // Received via Filesystem page - un-flatten array (WP bug #19643). + $plugins_to_install = explode( ',', $_POST['plugin'] ); + } + + // Sanitize the received input. + $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); + $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); + + // Validate the received input. + foreach ( $plugins_to_install as $key => $slug ) { + // Check if the plugin was registered with TGMPA and remove if not. + if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { + unset( $plugins_to_install[ $key ] ); + continue; + } + + // For install: make sure this is a plugin we *can* install and not one already installed. + if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) { + unset( $plugins_to_install[ $key ] ); + } + + // For updates: make sure this is a plugin we *can* update (update available and WP version ok). + if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) { + unset( $plugins_to_install[ $key ] ); + } + } + + // No need to proceed further if we have no plugins to handle. + if ( empty( $plugins_to_install ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins are available to be installed at this time.', 'cordero' ); + } else { + $message = __( 'No plugins are available to be updated at this time.', 'cordero' ); + } + + echo '

', esc_html( $message ), '

'; + + return false; + } + + // Pass all necessary information if WP_Filesystem is needed. + $url = wp_nonce_url( + $this->tgmpa->get_tgmpa_url(), + 'bulk-' . $this->_args['plural'] + ); + + // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. + $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { + return true; // Stop the normal page form from displaying, credential request form will be shown. + } + + // Now we have some credentials, setup WP_Filesystem. + if ( ! WP_Filesystem( $creds ) ) { + // Our credentials were no good, ask the user for them again. + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); + + return true; + } + + /* If we arrive here, we have the filesystem */ + + // Store all information in arrays since we are processing a bulk installation. + $names = array(); + $sources = array(); // Needed for installs. + $file_paths = array(); // Needed for upgrades. + $to_inject = array(); // Information to inject into the update_plugins transient. + + // Prepare the data for validated plugins for the install/upgrade. + foreach ( $plugins_to_install as $slug ) { + $name = $this->tgmpa->plugins[ $slug ]['name']; + $source = $this->tgmpa->get_download_url( $slug ); + + if ( ! empty( $name ) && ! empty( $source ) ) { + $names[] = $name; + + switch ( $install_type ) { + + case 'install': + $sources[] = $source; + break; + + case 'update': + $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; + $to_inject[ $slug ]['source'] = $source; + break; + } + } + } + unset( $slug, $name, $source ); + + // Create a new instance of TGMPA_Bulk_Installer. + $installer = new TGMPA_Bulk_Installer( + new TGMPA_Bulk_Installer_Skin( + array( + 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), + 'nonce' => 'bulk-' . $this->_args['plural'], + 'names' => $names, + 'install_type' => $install_type, + ) + ) + ); + + // Wrap the install process with the appropriate HTML. + echo '
', + '

', esc_html( get_admin_page_title() ), '

+
'; + + // Process the bulk installation submissions. + add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + // Inject our info into the update transient. + $this->tgmpa->inject_update_info( $to_inject ); + + $installer->bulk_upgrade( $file_paths ); + } else { + $installer->bulk_install( $sources ); + } + + remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 ); + + echo '
'; + + return true; + } + + // Bulk activation process. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + // Did user actually select any plugins to activate ? + if ( empty( $_POST['plugin'] ) ) { + echo '

', esc_html__( 'No plugins were selected to be activated. No action taken.', 'cordero' ), '

'; + + return false; + } + + // Grab plugin data from $_POST. + $plugins = array(); + if ( isset( $_POST['plugin'] ) ) { + $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); + $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); + } + + $plugins_to_activate = array(); + $plugin_names = array(); + + // Grab the file paths for the selected & inactive plugins from the registration array. + foreach ( $plugins as $slug ) { + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; + } + } + unset( $slug ); + + // Return early if there are no plugins to activate. + if ( empty( $plugins_to_activate ) ) { + echo '

', esc_html__( 'No plugins are available to be activated at this time.', 'cordero' ), '

'; + + return false; + } + + // Now we are good to go - let's start activating plugins. + $activate = activate_plugins( $plugins_to_activate ); + + if ( is_wp_error( $activate ) ) { + echo '

', wp_kses_post( $activate->get_error_message() ), '

'; + } else { + $count = count( $plugin_names ); // Count so we can use _n function. + $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); + $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. + $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'cordero' ) . ' ' . $last_plugin ); + + printf( // WPCS: xss ok. + '

%1$s %2$s.

', + esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'cordero' ) ), + $imploded + ); + + // Update recently activated plugins option. + $recent = (array) get_option( 'recently_activated' ); + foreach ( $plugins_to_activate as $plugin => $time ) { + if ( isset( $recent[ $plugin ] ) ) { + unset( $recent[ $plugin ] ); + } + } + update_option( 'recently_activated', $recent ); + } + + unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. + + return true; + } + + return false; + } + + /** + * Prepares all of our information to be outputted into a usable table. + * + * @since 2.2.0 + */ + public function prepare_items() { + $columns = $this->get_columns(); // Get all necessary column information. + $hidden = array(); // No columns to hide, but we must set as an array. + $sortable = array(); // No reason to make sortable columns. + $primary = $this->get_primary_column_name(); // Column which has the row actions. + $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. + + // Process our bulk activations here. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + $this->process_bulk_actions(); + } + + // Store all of our plugin data into $items array so WP_List_Table can use it. + $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Retrieve plugin data, given the plugin name. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. + * @see TGM_Plugin_Activation::_get_plugin_data_from_name() + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); + + return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); + } + } +} + + +if ( ! class_exists( 'TGM_Bulk_Installer' ) ) { + + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. + * + * @since 2.5.2 + * + * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer. + * For more information, see that class.}} + */ + class TGM_Bulk_Installer { + } +} +if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) { + + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. + * + * @since 2.5.2 + * + * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin. + * For more information, see that class.}} + */ + class TGM_Bulk_Installer_Skin { + } +} + +/** + * The WP_Upgrader file isn't always available. If it isn't available, + * we load it here. + * + * We check to make sure no action or activation keys are set so that WordPress + * does not try to re-include the class when processing upgrades or installs outside + * of the class. + * + * @since 2.2.0 + */ +add_action( 'admin_init', 'tgmpa_load_bulk_installer' ); +if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) { + /** + * Load bulk installer + */ + function tgmpa_load_bulk_installer() { + // Silently fail if 2.5+ is loaded *after* an older version. + if ( ! isset( $GLOBALS['tgmpa'] ) ) { + return; + } + + // Get TGMPA class instance. + $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { + + /** + * Installer class to handle bulk plugin installations. + * + * Extends WP_Upgrader and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}} + * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. + * This was done to prevent backward compatibility issues with v2.3.6.}} + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer extends Plugin_Upgrader { + /** + * Holds result of bulk plugin installation. + * + * @since 2.2.0 + * + * @var string + */ + public $result; + + /** + * Flag to check if bulk installation is occurring or not. + * + * @since 2.2.0 + * + * @var boolean + */ + public $bulk = false; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Whether or not the destination directory needs to be cleared ( = on update). + * + * @since 2.5.0 + * + * @var bool + */ + protected $clear_destination = false; + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + * + * @param \Bulk_Upgrader_Skin|null $skin Installer skin. + */ + public function __construct( $skin = null ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( $skin ); + + if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { + $this->clear_destination = true; + } + + if ( $this->tgmpa->is_automatic ) { + $this->activate_strings(); + } + + add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); + } + + /** + * Sets the correct activation strings for the installer skin to use. + * + * @since 2.2.0 + */ + public function activate_strings() { + $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'cordero' ); + $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'cordero' ); + } + + /** + * Performs the actual installation of each plugin. + * + * @since 2.2.0 + * + * @see WP_Upgrader::run() + * + * @param array $options The installation config options. + * @return null|array Return early if error, array of installation data on success. + */ + public function run( $options ) { + $result = parent::run( $options ); + + // Reset the strings in case we changed one during automatic activation. + if ( $this->tgmpa->is_automatic ) { + if ( 'update' === $this->skin->options['install_type'] ) { + $this->upgrade_strings(); + } else { + $this->install_strings(); + } + } + + return $result; + } + + /** + * Processes the bulk installation of plugins. + * + * @since 2.2.0 + * + * {@internal This is basically a near identical copy of the WP Core + * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with + * new installs instead of upgrades. + * For ease of future synchronizations, the adjustments are clearly commented, but no other + * comments are added. Code style has been made to comply.}} + * + * @see Plugin_Upgrader::bulk_upgrade() + * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 + * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}} + * + * @param array $plugins The plugin sources needed for installation. + * @param array $args Arbitrary passed extra arguments. + * @return array|false Install confirmation messages on success, false on failure. + */ + public function bulk_install( $plugins, $args = array() ) { + // [TGMPA + ] Hook auto-activation in. + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $defaults = array( + 'clear_update_cache' => true, + ); + $parsed_args = wp_parse_args( $args, $defaults ); + + $this->init(); + $this->bulk = true; + + $this->install_strings(); // [TGMPA + ] adjusted. + + /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ + + /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ + + $this->skin->header(); + + // Connect to the Filesystem first. + $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $res ) { + $this->skin->footer(); + return false; + } + + $this->skin->bulk_header(); + + /* + * Only start maintenance mode if: + * - running Multisite and there are one or more plugins specified, OR + * - a plugin with an update available is currently active. + * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. + */ + $maintenance = ( is_multisite() && ! empty( $plugins ) ); + + /* + [TGMPA - ] + foreach ( $plugins as $plugin ) + $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) ); + */ + if ( $maintenance ) { + $this->maintenance_mode( true ); + } + + $results = array(); + + $this->update_count = count( $plugins ); + $this->update_current = 0; + foreach ( $plugins as $plugin ) { + $this->update_current++; + + /* + [TGMPA - ] + $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); + + if ( !isset( $current->response[ $plugin ] ) ) { + $this->skin->set_result('up_to_date'); + $this->skin->before(); + $this->skin->feedback('up_to_date'); + $this->skin->after(); + $results[$plugin] = true; + continue; + } + + // Get the URL to the zip file. + $r = $current->response[ $plugin ]; + + $this->skin->plugin_active = is_plugin_active($plugin); + */ + + $result = $this->run( + array( + 'package' => $plugin, // [TGMPA + ] adjusted. + 'destination' => WP_PLUGIN_DIR, + 'clear_destination' => false, // [TGMPA + ] adjusted. + 'clear_working' => true, + 'is_multi' => true, + 'hook_extra' => array( + 'plugin' => $plugin, + ), + ) + ); + + $results[ $plugin ] = $this->result; + + // Prevent credentials auth screen from displaying multiple times. + if ( false === $result ) { + break; + } + } //end foreach $plugins + + $this->maintenance_mode( false ); + + /** + * Fires when the bulk upgrader process is complete. + * + * @since WP 3.6.0 / TGMPA 2.5.0 + * + * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might + * be a Theme_Upgrader or Core_Upgrade instance. + * @param array $data { + * Array of bulk item update data. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type array $packages Array of plugin, theme, or core packages to update. + * } + */ + do_action( 'upgrader_process_complete', $this, array( + 'action' => 'install', // [TGMPA + ] adjusted. + 'type' => 'plugin', + 'bulk' => true, + 'plugins' => $plugins, + ) ); + + $this->skin->bulk_footer(); + + $this->skin->footer(); + + // Cleanup our hooks, in case something else does a upgrade on this connection. + /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ + + // [TGMPA + ] Remove our auto-activation hook. + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + // Force refresh of plugin update information. + wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); + + return $results; + } + + /** + * Handle a bulk upgrade request. + * + * @since 2.5.0 + * + * @see Plugin_Upgrader::bulk_upgrade() + * + * @param array $plugins The local WP file_path's of the plugins which should be upgraded. + * @param array $args Arbitrary passed extra arguments. + * @return string|bool Install confirmation messages on success, false on failure. + */ + public function bulk_upgrade( $plugins, $args = array() ) { + + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $result = parent::bulk_upgrade( $plugins, $args ); + + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + return $result; + } + + /** + * Abuse a filter to auto-activate plugins after installation. + * + * Hooked into the 'upgrader_post_install' filter hook. + * + * @since 2.5.0 + * + * @param bool $bool The value we need to give back (true). + * @return bool + */ + public function auto_activate( $bool ) { + // Only process the activation of installed plugins if the automatic flag is set to true. + if ( $this->tgmpa->is_automatic ) { + // Flush plugins cache so the headers of the newly installed plugins will be read correctly. + wp_clean_plugins_cache(); + + // Get the installed plugin file. + $plugin_info = $this->plugin_info(); + + // Don't try to activate on upgrade of active plugin as WP will do this already. + if ( ! is_plugin_active( $plugin_info ) ) { + $activate = activate_plugin( $plugin_info ); + + // Adjust the success string based on the activation result. + $this->strings['process_success'] = $this->strings['process_success'] . "
\n"; + + if ( is_wp_error( $activate ) ) { + $this->skin->error( $activate ); + $this->strings['process_success'] .= $this->strings['activation_failed']; + } else { + $this->strings['process_success'] .= $this->strings['activation_success']; + } + } + } + + return $bool; + } + } + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { + + /** + * Installer skin to set strings for the bulk plugin installations.. + * + * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to + * TGMPA_Bulk_Installer_Skin. + * This was done to prevent backward compatibility issues with v2.3.6.}} + * + * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { + /** + * Holds plugin info for each individual plugin installation. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_info = array(); + + /** + * Holds names of plugins that are undergoing bulk installations. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_names = array(); + + /** + * Integer to use for iteration through each plugin installation. + * + * @since 2.2.0 + * + * @var integer + */ + public $i = 0; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Constructor. Parses default args with new ones and extracts them for use. + * + * @since 2.2.0 + * + * @param array $args Arguments to pass for use within the class. + */ + public function __construct( $args = array() ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + // Parse default and new args. + $defaults = array( + 'url' => '', + 'nonce' => '', + 'names' => array(), + 'install_type' => 'install', + ); + $args = wp_parse_args( $args, $defaults ); + + // Set plugin names to $this->plugin_names property. + $this->plugin_names = $args['names']; + + // Extract the new args. + parent::__construct( $args ); + } + + /** + * Sets install skin strings for each individual plugin. + * + * Checks to see if the automatic activation flag is set and uses the + * the proper strings accordingly. + * + * @since 2.2.0 + */ + public function add_strings() { + if ( 'update' === $this->options['install_type'] ) { + parent::add_strings(); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'cordero' ); + } else { + /* translators: 1: plugin name, 2: error message. */ + $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'cordero' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'cordero' ); + + if ( $this->tgmpa->is_automatic ) { + // Automatic activation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'cordero' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'cordero' ) . ' ' . esc_html__( 'Show Details', 'cordero' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'cordero' ); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'cordero' ); + } else { + // Default installation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'cordero' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'cordero' ) . ' ' . esc_html__( 'Show Details', 'cordero' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'cordero' ); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'cordero' ); + } + } + } + + /** + * Outputs the header strings and necessary JS before each plugin installation. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function before( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::before( $title ); + } + + /** + * Outputs the footer strings and necessary JS after each plugin installation. + * + * Checks for any errors and outputs them if they exist, else output + * success strings. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function after( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::after( $title ); + + $this->i++; + } + + /** + * Outputs links after bulk plugin installation is complete. + * + * @since 2.2.0 + */ + public function bulk_footer() { + // Serve up the string to say installations (and possibly activations) are complete. + parent::bulk_footer(); + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_clean_plugins_cache(); + + $this->tgmpa->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + $update_actions = array(); + + if ( $this->tgmpa->is_tgmpa_complete() ) { + // All plugins are active, so we display the complete string and hide the menu to protect users. + echo ''; + $update_actions['dashboard'] = sprintf( + esc_html( $this->tgmpa->strings['complete'] ), + '' . esc_html__( 'Return to the Dashboard', 'cordero' ) . '' + ); + } else { + $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; + } + + /** + * Filter the list of action links available following bulk plugin installs/updates. + * + * @since 2.5.0 + * + * @param array $update_actions Array of plugin action links. + * @param array $plugin_info Array of information for the last-handled plugin. + */ + $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); + + if ( ! empty( $update_actions ) ) { + $this->feedback( implode( ' | ', (array) $update_actions ) ); + } + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Flush header output buffer. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function before_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + } + + /** + * Flush footer output buffer and iterate $this->i to make sure the + * installation strings reference the correct plugin. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function after_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + $this->i++; + } + } + } + } + } +} + +if ( ! class_exists( 'TGMPA_Utils' ) ) { + + /** + * Generic utilities for TGMPA. + * + * All methods are static, poor-dev name-spacing class wrapper. + * + * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. + * + * @since 2.5.0 + * + * @package TGM-Plugin-Activation + * @author Juliette Reinders Folmer + */ + class TGMPA_Utils { + /** + * Whether the PHP filter extension is enabled. + * + * @see http://php.net/book.filter + * + * @since 2.5.0 + * + * @static + * + * @var bool $has_filters True is the extension is enabled. + */ + public static $has_filters; + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_em( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_strong( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Helper function: Validate a value as boolean + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Arbitrary value. + * @return bool + */ + public static function validate_bool( $value ) { + if ( ! isset( self::$has_filters ) ) { + self::$has_filters = extension_loaded( 'filter' ); + } + + if ( self::$has_filters ) { + return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); + } else { + return self::emulate_filter_bool( $value ); + } + } + + /** + * Helper function: Cast a value to bool + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Value to cast. + * @return bool + */ + protected static function emulate_filter_bool( $value ) { + // @codingStandardsIgnoreStart + static $true = array( + '1', + 'true', 'True', 'TRUE', + 'y', 'Y', + 'yes', 'Yes', 'YES', + 'on', 'On', 'ON', + ); + static $false = array( + '0', + 'false', 'False', 'FALSE', + 'n', 'N', + 'no', 'No', 'NO', + 'off', 'Off', 'OFF', + ); + // @codingStandardsIgnoreEnd + + if ( is_bool( $value ) ) { + return $value; + } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { + return (bool) $value; + } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { + return (bool) $value; + } elseif ( is_string( $value ) ) { + $value = trim( $value ); + if ( in_array( $value, $true, true ) ) { + return true; + } elseif ( in_array( $value, $false, true ) ) { + return false; + } else { + return false; + } + } + + return false; + } + } // End of class TGMPA_Utils +} // End of class_exists wrapper diff --git a/functions/css/customizer-style.css b/functions/css/customizer-style.css new file mode 100644 index 0000000..5a163d0 --- /dev/null +++ b/functions/css/customizer-style.css @@ -0,0 +1,96 @@ +.customize-control select{ + width: 98%; +} + +#customize-theme-controls .control-section.control-panel-nav_menus{ + margin-top: 25px; + border-top: 1px solid #ddd; +} + +#customize-theme-controls #accordion-section-custom_css.control-section{ + margin-top: 25px; + border-top: 1px solid #ddd; +} + +#customize-theme-controls .accordion-section-content{ + background: #FFF; +} + +h3.cordero-accordion-section-title{ + color: #fff; + font-size: 125%; + padding: 10px 10px 11px 14px; + line-height: 21px; + background: #0073aa; + margin: 0 -12px 0; +} + +h5.cordero-accordion-section-title{ + font-size: 110%; + padding: 10px 10px 11px 14px; + line-height: 21px; + background: #f2f3f5; + margin: 0 -12px 0; +} + +.cordero-accordion-section-paragraph{ + padding: 0px 10px 11px 14px; + line-height: 16px; + margin: 0 -12px 0; +} + +[id*="customize-control-fs_"].customize-control, +[id*="customize-control-ft_"].customize-control{ + width: 46%; + margin-right: 3%; +} + +[id*="customize-control-fw_"].customize-control, +[id*="customize-control-fl_"].customize-control{ + width: 46%; + margin-left: 3%; + clear: none; +} + +.cordero-img-container .cordero-radio-img-img{ + border: 2px solid #f2f3f5; + cursor: pointer; + margin: 0 4px 4px 0; +} + +.cordero-img-container .cordero-radio-img-selected{ + border: 2px solid #0085BA; + margin: 0 4px 4px 0; +} + +.cordero-img-container input[type=checkbox]:before{ + content: ''; + margin: -3px 0 0 -4px; +} + +.cordero-img-container li{ + display: inline-block; + width: 46%; + margin-right: 3%; +} + +/*Theme Info*/ +.cordero-info{ + margin-top: 10px; +} + +.cordero-info a{ + background: #0073aa; + padding: 5px 10px; + color: #FFF; + text-align: center; + display: block; + margin-top: 5px; + line-height: 1.2; + box-shadow: none; + opacity: 1; +} + +.cordero-info a:hover{ + opacity: 0.8; +} diff --git a/functions/customizer-controls.php b/functions/customizer-controls.php new file mode 100644 index 0000000..eb9e08a --- /dev/null +++ b/functions/customizer-controls.php @@ -0,0 +1,178 @@ + array( + 'type' => 'setting', + 'default' => '#d82978', + 'transport' => 'postMessage', + 'sanitize' => 'sanitize_hex_color', + 'control' => 'color', + 'label' => __( 'Accent Color', 'cordero' ), + 'description' => __( 'Links, buttons', 'cordero' ), + 'section' => 'colors', + 'priority' => '', + ), + + 'accent_color2' => array( + 'type' => 'setting', + 'default' => '#2d2354', + 'transport' => 'postMessage', + 'sanitize' => 'sanitize_hex_color', + 'control' => 'color', + 'label' => __( 'Color 2', 'cordero' ), + 'description' => __( 'Background: transparent header on scrolling, footer', 'cordero' ), + 'section' => 'colors', + 'priority' => '', + ), + + 'accent_color3' => array( + 'type' => 'setting', + 'default' => '#fbfbfb', + 'transport' => 'postMessage', + 'sanitize' => 'sanitize_hex_color', + 'control' => 'color', + 'label' => __( 'Color 3', 'cordero' ), + 'description' => __( 'Background: blog posts (not plain style), sidebar, page numbers, forms, tables', 'cordero' ), + 'section' => 'colors', + 'priority' => '', + ), + + 'layout_options' => array( + 'type' => 'section', + 'label' => __( 'Layout Options', 'cordero' ), + 'description' => '', + 'priority' => 26, + ), + + 'blog_options' => array( + 'type' => 'section', + 'label' => __( 'Blog Options', 'cordero' ), + 'description' => '', + 'priority' => 28, + ), + + 'container_width' => array( + 'type' => 'setting', + 'default' => '1240', + 'transport' => 'postMessage', + 'sanitize' => 'absint', + 'control' => 'number', + 'label' => __( 'Container Width', 'cordero' ), + 'description' => '', + 'section' => 'layout_options', + 'attrs' => array( + 'min' => 1120, + 'max' => 2560, + 'step' => 1, + ), + ), + + 'header_search_off' => array( + 'type' => 'setting', + 'default' => 0, + 'transport' => 'postMessage', + 'sanitize' => 'cordero_sanitize_checkbox', + 'control' => 'checkbox', + 'label' => __( 'Disable Search Form in Header', 'cordero' ), + 'description' => '', + 'section' => 'layout_options', + 'priority' => 23, + ), + + ); + } +} + + +/** + * Return customizer settings and controls + */ +if ( !function_exists( 'cordero_customizer_controls' ) ) { + function cordero_customizer_controls() { + + global $wp_customize; + + $controls = cordero_customizer_array(); + + foreach ( $controls as $control => $value ) { + + if ( $value['type'] == 'section' ) { + + $wp_customize->add_section( + $control, + array( + 'title' => $value['label'], + 'description'=> $value['description'], + 'priority' => $value['priority'], + ) + ); + + } elseif ( $value['type'] == 'setting' ) { + + $wp_customize->add_setting( + $control, + array( + 'default' => $value['default'], + 'transport' => $value['transport'], + 'sanitize_callback' => $value['sanitize'], + ) + ); + + if ( $value['control'] == 'color' ) { + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + $control, + array( + 'settings' => $control, + 'section' => $value['section'], + 'label' => $value['label'], + 'description'=> $value['description'], + ) + ) + ); + + } elseif ( $value['control'] == 'number' ) { + + $wp_customize->add_control( + $control, + array( + 'settings' => $control, + 'section' => $value['section'], + 'label' => $value['label'], + 'description'=> $value['description'], + 'type' => 'number', + 'input_attrs' => $value['attrs'], + ) + ); + + } elseif ( $value['control'] == 'checkbox' ) { + + $wp_customize->add_control( + $control, + array( + 'settings' => $control, + 'section' => $value['section'], + 'label' => $value['label'], + 'description'=> $value['description'], + 'type' => 'checkbox', + 'priority' => $value['priority'], + ) + ); + + } + + } + + } + + } +} diff --git a/functions/customizer.php b/functions/customizer.php new file mode 100644 index 0000000..3435a80 --- /dev/null +++ b/functions/customizer.php @@ -0,0 +1,1156 @@ +get_setting('blogname')->transport = 'postMessage'; + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; + $wp_customize->get_setting('custom_logo')->transport = 'postMessage'; + + $wp_customize->add_setting( + 'logo_transparent_header', + array( + 'default' => '', + 'sanitize_callback' => 'absint', + ) + ); + $cordero_custom_logo_args = get_theme_support( 'custom-logo' ); + $wp_customize->add_control( + new WP_Customize_Cropped_Image_Control( + $wp_customize, + 'logo_transparent_header', + array( + 'label' => esc_html__( 'Logo - Transparent Header', 'cordero' ), + 'description' => esc_html__( 'The logo on the **Transparent Header** page template. If empty, main logo is displayed.', 'cordero' ), + 'section' => 'title_tagline', + 'priority' => 9, + 'height' => isset( $cordero_custom_logo_args[0]['height'] ) ? $cordero_custom_logo_args[0]['height'] : null, + 'width' => isset( $cordero_custom_logo_args[0]['width'] ) ? $cordero_custom_logo_args[0]['width'] : null, + 'flex_height' => isset( $cordero_custom_logo_args[0]['flex-height'] ) ? $cordero_custom_logo_args[0]['flex-height'] : null, + 'flex_width' => isset( $cordero_custom_logo_args[0]['flex-width'] ) ? $cordero_custom_logo_args[0]['flex-width'] : null, + 'button_labels' => array( + 'select' => esc_html__( 'Select logo', 'cordero' ), + 'change' => esc_html__( 'Change logo', 'cordero' ), + 'remove' => esc_html__( 'Remove', 'cordero' ), + 'default' => esc_html__( 'Default', 'cordero' ), + 'placeholder' => esc_html__( 'No logo selected', 'cordero' ), + 'frame_title' => esc_html__( 'Select logo', 'cordero' ), + 'frame_button' => esc_html__( 'Choose logo', 'cordero' ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'hide_tagline', + array( + 'default' => 0, + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'hide_tagline', + array( + 'settings' => 'hide_tagline', + 'section' => 'title_tagline', + 'label' => esc_html__( 'Hide Tagline', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'site_title_style', + array( + 'default' => 'border', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'site_title_style', + array( + 'label' => esc_html__( 'Site Title Style', 'cordero' ), + 'description' => esc_html__( 'Applies to textual Site Title only, not custom logo.', 'cordero' ), + 'type' => 'select', + 'section' => 'title_tagline', + 'choices' => array( + 'border' => esc_html__( 'With Border', 'cordero' ), + 'stfls' => esc_html__( 'Highlight 1st Letter', 'cordero' ), + 'background' => esc_html__( 'With Background', 'cordero' ), + 'no-styling' => esc_html__( 'No Styling', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'heading_schema', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_schema', + array( + 'settings' => 'heading_schema', + 'section' => 'title_tagline', + 'label' => esc_html__( 'Schema Markup', 'cordero' ), + 'priority' => 100 + ) + ) + ); + + $wp_customize->add_setting( + 'schema_off', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'schema_off', + array( + 'settings' => 'schema_off', + 'section' => 'title_tagline', + 'label' => esc_html__( 'Remove Schema Tags', 'cordero' ), + 'type' => 'checkbox', + 'priority' => 101 + ) + ); + + $wp_customize->add_setting( + 'header_image_helper', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Small( + $wp_customize, + 'header_image_helper', + array( + 'settings' => 'header_image_helper', + 'section' => 'header_image', + 'label' => esc_html__( 'Note: header image is not displayed on the **Transparent Header** page template.', 'cordero' ) + ) + ) + ); + + cordero_customizer_controls(); + + // Section - Layout Options + $wp_customize->add_setting( + 'heading_header', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_header', + array( + 'settings' => 'heading_header', + 'section' => 'layout_options', + 'label' => esc_html__( 'Header', 'cordero' ), + 'priority' => 20 + ) + ) + ); + + $wp_customize->add_setting( + 'header_layout', + array( + 'default' => '', + 'sanitize_callback' => 'cordero_sanitize_radio_select' + ) + ); + $wp_customize->add_control( + new Cordero_Image_Radio_Control( + $wp_customize, + 'header_layout', + array( + 'type' => 'radio', + 'label' => esc_html__( 'Layout', 'cordero' ), + 'section' => 'layout_options', + 'settings' => 'header_layout', + 'priority' => 21, + 'choices' => array( + '' => esc_url( get_template_directory_uri() ) . '/images/header-standard.png', + 'logo-below' => esc_url( get_template_directory_uri() ) . '/images/header-logo-below.png', + 'logo-left' => esc_url( get_template_directory_uri() ) . '/images/header-logo-left.png', + 'logo-right' => esc_url( get_template_directory_uri() ) . '/images/header-logo-right.png', + 'masthead-left' => esc_url( get_template_directory_uri() ) . '/images/header-masthead-left.png', + ) + ) + ) + ); + + $wp_customize->add_setting( + 'sticky_header_off', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'sticky_header_off', + array( + 'settings' => 'sticky_header_off', + 'section' => 'layout_options', + 'label' => esc_html__( 'Disable Fixed Header', 'cordero' ), + 'type' => 'checkbox', + 'priority' => 22, + ) + ); + + $wp_customize->add_setting( + 'heading_sidebar', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_sidebar', + array( + 'settings' => 'heading_sidebar', + 'section' => 'layout_options', + 'label' => esc_html__( 'Sidebar', 'cordero' ), + 'priority' => 30, + ) + ) + ); + + $wp_customize->add_setting( + 'sidebar_position', + array( + 'default' => 'right', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'sidebar_position', + array( + 'label' => esc_html__( 'Position', 'cordero' ), + 'type' => 'select', + 'section' => 'layout_options', + 'choices' => array( + 'left' => esc_html__( 'Left', 'cordero' ), + 'right' => esc_html__( 'Right', 'cordero' ), + 'below' => esc_html__( 'Bottom (below content)', 'cordero' ), + ), + 'priority' => 31, + ) + ); + + $wp_customize->add_setting( + 'heading_footer', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_footer', + array( + 'settings' => 'heading_footer', + 'section' => 'layout_options', + 'label' => esc_html__( 'Footer', 'cordero' ), + 'priority' => 40, + ) + ) + ); + + $wp_customize->add_setting( + 'footer_layout', + array( + 'default' => '', + 'sanitize_callback' => 'cordero_sanitize_radio_select' + ) + ); + $wp_customize->add_control( + new Cordero_Image_Radio_Control( + $wp_customize, + 'footer_layout', + array( + 'type' => 'radio', + 'label' => esc_html__( 'Footer Layout', 'cordero' ), + 'section' => 'layout_options', + 'settings' => 'footer_layout', + 'choices' => array( + '' => esc_url( get_template_directory_uri() ) . '/images/footer-standard.png', + 'info-right' => esc_url( get_template_directory_uri() ) . '/images/footer-info-right.png', + 'centered' => esc_url( get_template_directory_uri() ) . '/images/footer-centered.png', + 'centered-info-below' => esc_url( get_template_directory_uri() ) . '/images/footer-centered-info-below.png', + ), + 'priority' => 41 + ) + ) + ); + + $wp_customize->add_setting( + 'sticky_footer', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'sticky_footer', + array( + 'settings' => 'sticky_footer', + 'section' => 'layout_options', + 'label' => esc_html__( 'Enable Sticky Footer', 'cordero' ), + 'description' => esc_html__( 'On pages with little or no content, the footer will appear at the bottom of the page.', 'cordero' ), + 'type' => 'checkbox', + 'priority' => 42, + ) + ); + + + // Section - Blog Options + $wp_customize->add_setting( + 'heading_blog_archive', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_blog_archive', + array( + 'settings' => 'heading_blog_archive', + 'section' => 'blog_options', + 'label' => esc_html__( 'Archives', 'cordero' ), + 'description' => esc_html__( 'Blog page, post archives, related posts', 'cordero' ), + ) + ) + ); + + $wp_customize->add_setting( + 'blog_columns', + array( + 'default' => '2', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'blog_columns', + array( + 'label' => esc_html__( 'Columns (posts per row)', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => array( + '1' => esc_html__( '1', 'cordero' ), + '2' => esc_html__( '2', 'cordero' ), + '3' => esc_html__( '3', 'cordero' ), + '4' => esc_html__( '4', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'blog_post_style', + array( + 'default' => 'plain', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'blog_post_style', + array( + 'label' => esc_html__( 'Post Style', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => array( + 'plain' => esc_html__( 'Plain', 'cordero' ), + 'border' => esc_html__( 'Bordered', 'cordero' ), + 'shadow' => esc_html__( 'Box Shadow', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'blog_post_excerpt', + array( + 'default' => 'excerpt', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'blog_post_excerpt', + array( + 'label' => esc_html__( 'Show Excerpt or Full Post', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => array( + 'excerpt' => esc_html__( 'Excerpt', 'cordero' ), + 'full' => esc_html__( 'Full Post', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'excerpt_length', + array( + 'default' => '20', + 'sanitize_callback' => 'absint' + ) + ); + $wp_customize->add_control( + 'excerpt_length', + array( + 'settings' => 'excerpt_length', + 'section' => 'blog_options', + 'label' => esc_html__( 'Excerpt Word Length', 'cordero' ), + 'type' => 'number', + 'input_attrs' => array( + 'min' => 1, + 'max' => 255, + 'step' => 1, + ), + ) + ); + + $wp_customize->add_setting( + 'post_spacing', + array( + 'default' => 'space-between', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'post_spacing', + array( + 'label' => esc_html__( 'Post Content Vertical Alignment', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => array( + 'normal' => esc_html__( 'Normal', 'cordero' ), + 'space-between' => esc_html__( 'Space Between', 'cordero' ), + 'space-around' => esc_html__( 'Space Around', 'cordero' ), + 'space-evenly' => esc_html__( 'Space Evenly', 'cordero' ), + 'center' => esc_html__( 'Centered', 'cordero' ), + 'end' => esc_html__( 'Bottom', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'disable_author', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_author', + array( + 'settings' => 'disable_author', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Author', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_date', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_date', + array( + 'settings' => 'disable_date', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Date', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_cats', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_cats', + array( + 'settings' => 'disable_cats', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Categories', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_tags', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_tags', + array( + 'settings' => 'disable_tags', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Tags', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_readmore', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_readmore', + array( + 'settings' => 'disable_readmore', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Read More Link', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_img', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_img', + array( + 'settings' => 'disable_img', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Featured Image', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'readmore_text', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + 'readmore_text', + array( + 'settings' => 'readmore_text', + 'section' => 'blog_options', + 'type' => 'text', + 'label' => esc_html__( 'Read More Text', 'cordero' ), + ) + ); + + $wp_customize->add_setting( + 'archive_img_size', + array( + 'default' => 'large', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'archive_img_size', + array( + 'label' => esc_html__( 'Featured Image Size', 'cordero' ), + 'description' => esc_html__( 'See: "Settings" > "Media" (or any active plugins that control image sizes)', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => cordero_image_size_options(), + ) + ); + + $wp_customize->add_setting( + 'featured_image', + array( + 'default' => '', + 'sanitize_callback' => 'esc_url_raw' + ) + ); + $wp_customize->add_control( + new WP_Customize_Image_Control( + $wp_customize, + 'featured_image', + array( + 'label' => esc_html__( 'Featured Image Placeholder', 'cordero' ), + 'description' => esc_html__( 'Displays where a post does not have a Featured Image', 'cordero' ), + 'section' => 'blog_options', + 'settings' => 'featured_image', + ) + ) + ); + + + $wp_customize->add_setting( + 'heading_blog_single', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + $wp_customize->add_control( + new Cordero_Customize_Heading_Large( + $wp_customize, + 'heading_blog_single', + array( + 'settings' => 'heading_blog_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Single Posts', 'cordero' ), + ) + ) + ); + + $wp_customize->add_setting( + 'disable_img_single', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_img_single', + array( + 'settings' => 'disable_img_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Featured Image', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_author_single', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_author_single', + array( + 'settings' => 'disable_author_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Author', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_date_single', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_date_single', + array( + 'settings' => 'disable_date_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Date', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_cats_single', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_cats_single', + array( + 'settings' => 'disable_cats_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Categories', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_tags_single', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_tags_single', + array( + 'settings' => 'disable_tags_single', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Tags', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_prevnext', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_prevnext', + array( + 'settings' => 'disable_prevnext', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Previous and Next Links', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'disable_related', + array( + 'default' => 0, + 'sanitize_callback' => 'cordero_sanitize_checkbox' + ) + ); + $wp_customize->add_control( + 'disable_related', + array( + 'settings' => 'disable_related', + 'section' => 'blog_options', + 'label' => esc_html__( 'Remove Related Posts', 'cordero' ), + 'type' => 'checkbox', + ) + ); + + $wp_customize->add_setting( + 'single_img_size', + array( + 'default' => 'full', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'single_img_size', + array( + 'label' => esc_html__( 'Featured Image Size', 'cordero' ), + 'description' => esc_html__( 'See: "Settings" > "Media" (or any active plugins that control image sizes)', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => cordero_image_size_options(), + ) + ); + + $wp_customize->add_setting( + 'related_posts', + array( + 'default' => '4', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'related_posts', + array( + 'label' => esc_html__( 'Number of Related Posts', 'cordero' ), + 'type' => 'select', + 'section' => 'blog_options', + 'choices' => array( + '1' => esc_html__( '1', 'cordero' ), + '2' => esc_html__( '2', 'cordero' ), + '3' => esc_html__( '3', 'cordero' ), + '4' => esc_html__( '4', 'cordero' ), + '5' => esc_html__( '5', 'cordero' ), + '6' => esc_html__( '6', 'cordero' ), + '7' => esc_html__( '7', 'cordero' ), + '8' => esc_html__( '8', 'cordero' ), + ), + ) + ); + + $wp_customize->add_setting( + 'reading_width', + array( + 'default' => '640', + 'sanitize_callback' => 'absint' + ) + ); + $wp_customize->add_control( + 'reading_width', + array( + 'settings' => 'reading_width', + 'section' => 'blog_options', + 'label' => esc_html__( 'Reading View Template Width', 'cordero' ), + 'description' => esc_html__( 'The maximum width of the content when using the **Reading View** post template. Note: will not display wider than the main container.', 'cordero' ), + 'type' => 'number', + 'input_attrs' => array( + 'min' => 100, + 'max' => 1920, + 'step' => 1, + ), + ) + ); + + + // SECTION - Typography + $wp_customize->add_section( + 'typography', + array( + 'title' => esc_html__( 'Typography & Fonts', 'cordero' ), + 'priority' => 42, + ) + ); + + // Setting - Font - Header + $wp_customize->add_setting( 'font_site_title', array( + 'default' => 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) ); + $wp_customize->add_control( 'font_site_title', array( + 'label' => esc_html__( 'Site Title', 'cordero' ), + 'type' => 'select', + 'section' => 'typography', + 'choices' => cordero_google_fonts_array(), + ) ); + + // Setting - Font - Navigation + $wp_customize->add_setting( 'font_nav', array( + 'default' => 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) ); + $wp_customize->add_control( 'font_nav', array( + 'label' => esc_html__( 'Navigation', 'cordero' ), + 'type' => 'select', + 'section' => 'typography', + 'choices' => cordero_google_fonts_array(), + ) ); + + // Setting - Font - Content + $wp_customize->add_setting( 'font_content', array( + 'default' => 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) ); + $wp_customize->add_control( 'font_content', array( + 'label' => esc_html__( 'Content', 'cordero' ), + 'type' => 'select', + 'section' => 'typography', + 'choices' => cordero_google_fonts_array(), + ) ); + + // Setting - Font - Headings + $wp_customize->add_setting( 'font_headings', array( + 'default' => 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) ); + $wp_customize->add_control( 'font_headings', array( + 'label' => esc_html__( 'Headings', 'cordero' ), + 'type' => 'select', + 'section' => 'typography', + 'choices' => cordero_google_fonts_array(), + ) ); + + $wp_customize->add_setting( + 'fs_base', + array( + 'default' => '16', + 'transport' => 'postMessage', + 'sanitize_callback' => 'absint' + ) + ); + $wp_customize->add_control( + 'fs_base', + array( + 'settings' => 'fs_base', + 'section' => 'typography', + 'label' => esc_html__( 'Base Font Size', 'cordero' ), + 'type' => 'number', + 'input_attrs' => array( + 'min' => 10, + 'max' => 40, + 'step' => 1, + ), + ) + ); + + $wp_customize->add_setting( + 'menu_uppercase', + array( + 'default' => 'uppercase', + 'transport' => 'postMessage', + 'sanitize_callback' => 'cordero_sanitize_choices', + ) + ); + $wp_customize->add_control( + 'menu_uppercase', + array( + 'label' => esc_html__( 'Menu Text Style', 'cordero' ), + 'type' => 'select', + 'section' => 'typography', + 'choices' => array( + 'uppercase' => esc_html__( 'UPPERCASE', 'cordero' ), + 'none' => esc_html__( 'Normal', 'cordero' ), + ), + ) + ); + + // Section - Go Pro + $wp_customize->add_section( 'go_pro_sec' , array( + 'title' => esc_html__( 'Go Pro', 'cordero' ), + 'priority' => 1, + 'description' => esc_html__( 'Upgrade to Cordero Pro for even more cool features and customization options.', 'cordero' ), + ) ); + $wp_customize->add_control( + new Cordero_Customize_Extra_Control( + $wp_customize, + 'go_pro', + array( + 'section' => 'go_pro_sec', + 'type' => 'pro-link', + 'label' => esc_html__( 'Go Pro', 'cordero' ), + 'url' => 'https://uxlthemes.com/theme/cordero-pro/', + 'priority' => 10 + ) + ) + ); + +} +add_action('customize_register', 'cordero_customize_register'); + + +/** + * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. + */ +function cordero_customize_preview_js() { + wp_enqueue_script('cordero-customizer-preview', get_template_directory_uri() . '/functions/js/customizer-preview.js', array('customize-preview'), '1.0', true ); +} +add_action('customize_preview_init', 'cordero_customize_preview_js'); + + +function cordero_customizer_script() { + wp_enqueue_script('cordero-customizer-script', get_template_directory_uri() .'/functions/js/customizer-script.js', array('jquery'),'', true ); + wp_enqueue_style('cordero-customizer-style', get_template_directory_uri() .'/functions/css/customizer-style.css'); +} +add_action('customize_controls_enqueue_scripts', 'cordero_customizer_script'); + + +if( class_exists('WP_Customize_Control') ): + +class Cordero_Image_Radio_Control extends WP_Customize_Control { + + public function render_content() { + + if ( empty( $this->choices ) ) + return; + + $name = '_customize-radio-' . $this->id; + + ?> + label ); ?> + description ) { + echo '' . esc_html( $this->description ) . ''; + } + ?> + + + + label ) ) : ?> +

label ); ?>

+ + description ) ) : ?> +

description ); ?>

+ + + + label ) ) : ?> +
label ); ?>
+ + description ) ) : ?> +

description ); ?>

+ + type ) { + default: + + case 'extra': + echo '

' . sprintf( + '%2$s', + esc_url( $this->url ), + esc_html__( 'More options available', 'cordero' ) + ) . '

'; + echo '

' . esc_html( $this->description ) . '

'; + break; + + case 'docs': + echo sprintf( + '%2$s', + esc_url( $this->url ), + esc_html__( 'Documentation', 'cordero' ) + ); + break; + + case 'pro-link': + echo sprintf( + '%2$s', + esc_url( $this->url ), + esc_html__( 'Go Pro', 'cordero' ) + ); + break; + + case 'line' : + echo '
'; + break; + } + } +} + + +endif; + + +/** + * Sanitization functions + */ + +function cordero_sanitize_checkbox( $input ){ + if ( $input ) { + $output = '1'; + } else { + $output = false; + } + return $output; +} + + +function cordero_sanitize_choices( $input, $setting ) { + global $wp_customize; + + $control = $wp_customize->get_control( $setting->id ); + + if ( array_key_exists( $input, $control->choices ) ) { + return $input; + } else { + return $setting->default; + } +} + + +function cordero_sanitize_radio_select( $input, $setting ) { + // Ensuring that the input is a slug. + $input = sanitize_key( $input ); + // Get the list of choices from the control associated with the setting. + $choices = $setting->manager->get_control( $setting->id )->choices; + // If the input is a valid key, return it, else, return the default. + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} + + +/** + * Get registered image sizes + */ +function cordero_get_image_sizes() { + global $_wp_additional_image_sizes; + + $sizes = array(); + + foreach ( get_intermediate_image_sizes() as $_size ) { + if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) { + $sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" ); + $sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" ); + $sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" ); + } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { + $sizes[ $_size ] = array( + 'width' => $_wp_additional_image_sizes[ $_size ]['width'], + 'height' => $_wp_additional_image_sizes[ $_size ]['height'], + 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'], + ); + } + } + + return $sizes; +} + +function cordero_image_size_options() { + $image_size_configs = cordero_get_image_sizes(); + // Hardcoded 'full' because not a registered image size + // 'full' will result in the original uploaded image size being used + $sizes = array( + 'full' => esc_html__( 'Full (original full size image)', 'cordero' ), + ); + foreach( $image_size_configs as $name => $size_config) { + if ( $size_config['crop'] == 1 ) { + $hardcrop = esc_html__( '(exact dimensions)', 'cordero' ); + } else { + $hardcrop = esc_html__( '(proportional)', 'cordero' ); + } + $sizes[$name] = ucwords(preg_replace('/[-_]/', ' ', $name)) . ' (' . $size_config['width'] . 'x' . $size_config['height'] . ') ' . $hardcrop; + } + + return $sizes; +} diff --git a/functions/extras.php b/functions/extras.php new file mode 100644 index 0000000..8ce3c2b --- /dev/null +++ b/functions/extras.php @@ -0,0 +1,682 @@ +theme_location ) { + if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { + $args->after = ''; + } else { + $args->after = ''; + } + } + return $args; + } +} +add_filter( 'nav_menu_item_args', 'cordero_primary_menu_sub_trigger', 10, 2 ); + + +if ( !function_exists( 'cordero_primary_menu_fallback' ) ) { + function cordero_primary_menu_fallback() { + echo ''; + } +} + + +if ( !function_exists( 'cordero_footer_menu_fallback' ) ) { + function cordero_footer_menu_fallback() { + if ( function_exists( 'the_privacy_policy_link' ) ) { + echo '
'; + the_privacy_policy_link( '', '' ); + echo '
'; + } + } +} + + +if ( !function_exists( 'cordero_custom_excerpt_length' ) ) { + function cordero_custom_excerpt_length( $length ) { + if ( is_admin() ) { + return $length; + } else { + return get_theme_mod( 'excerpt_length', '20' ); + } + } +} +add_filter( 'excerpt_length', 'cordero_custom_excerpt_length', 999 ); + + +if ( !function_exists( 'cordero_excerpt_more' ) ) { + function cordero_excerpt_more( $more ) { + if ( is_admin() ) { + return $more; + } else { + return '…'; + } + } +} +add_filter( 'excerpt_more', 'cordero_excerpt_more' ); + + +if ( !function_exists( 'cordero_archive_title_prefix' ) ) { + function cordero_archive_title_prefix( $title ) { + if ( is_category() ) { + $title = single_cat_title( '', false ); + } elseif ( is_tag() ) { + $title = single_tag_title( '', false ); + } elseif ( is_author() ) { + $title = '' . get_avatar( get_the_author_meta( 'ID' ), '90' ) . esc_html( get_the_author() ) . ''; + } + return $title; + } +} +add_filter( 'get_the_archive_title', 'cordero_archive_title_prefix' ); + + +if ( !function_exists( 'cordero_header_menu' ) ) { + function cordero_header_menu() { + $header_layout = get_theme_mod( 'header_layout', '' ); + ?> + + + + + + + + + + +

>>

+ +

>>

+ +
>
+ + + + + +

>>

+ +

>>

+ +
>
+ 'custom-logo', + ); + + if ( is_front_page() ) { + /* + * If on the home page, set the logo alt attribute to an empty string, + * as the image is decorative and doesn't need its purpose to be described. + */ + $custom_logo_attr['alt'] = ''; + } else { + /* + * 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. + */ + $image = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); + + if ( is_front_page() ) { + // If on the home page, don't link the logo to home. + $html = sprintf( + '%1$s', + $image + ); + } else { + $html = sprintf( + '%2$s', + esc_url( home_url( '/' ) ), + $image + ); + } + } elseif ( is_customize_preview() ) { + // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). + $html = sprintf( + '', + esc_url( home_url( '/' ) ) + ); + } + + echo $html; + } +} + + +if ( !function_exists( 'cordero_header_content_customizer' ) ) { + function cordero_header_content_customizer() { + cordero_site_branding_start(); + ?> + + +

>>

+ +

>>

+ +
>
+ + + +

>>

+ +

>>

+ +
>
+ + +
> + +
+ + +
+ + + + + + +
+ + + + + +
+ +
+
yith_wcwl_count_all_products() + ) ); + } + } +} +add_action( 'wp_ajax_yith_wcwl_update_wishlist_count', 'cordero_update_wishlist_count' ); +add_action( 'wp_ajax_nopriv_yith_wcwl_update_wishlist_count', 'cordero_update_wishlist_count' ); + + +if ( !function_exists( 'cordero_header_cart' ) ) { + function cordero_header_cart() { + if ( class_exists( 'WooCommerce' ) ) { + $cart_items = WC()->cart->get_cart_contents_count(); + if ( $cart_items > 0 ) { + $cart_class = ' items'; + } else { + $cart_class = ''; + } ?> + + cart->get_cart_contents_count(); + if ( $cart_items > 0 ) { + $cart_class = ' items'; + } else { + $cart_class = ''; + } + ob_start(); + ?> + + +
+ +
+ + | + Cordero' ); ?> +
+
+ '; + } +} + + +if ( !function_exists( 'cordero_before_shop_loop_item_title' ) ) { + function cordero_before_shop_loop_item_title() { + global $product; + $attachment_ids = $product->get_gallery_image_ids(); + if ( $attachment_ids && $product->get_image_id() ) { + echo '
' . wp_get_attachment_image( $attachment_ids[0], 'woocommerce_thumbnail' ) . '
'; + } + echo '
'; + } +} + + +if ( !function_exists( 'cordero_before_shop_loop_cat_title' ) ) { + function cordero_before_shop_loop_cat_title() { + echo '
'; + } +} + + +if ( !function_exists( 'cordero_after_shop_loop_item_title' ) ) { + function cordero_after_shop_loop_item_title() { + echo '
'; + } +} + + +if ( !function_exists( 'cordero_before_shop_loop_addtocart' ) ) { + function cordero_before_shop_loop_addtocart() { + echo '
'; + } +} + + +if ( !function_exists( 'cordero_after_shop_loop_addtocart' ) ) { + function cordero_after_shop_loop_addtocart() { + echo '
'; + } +} + + +if ( !function_exists( 'cordero_after_subcategory' ) ) { + function cordero_after_subcategory() { + echo ''; + } +} + + +if ( !function_exists( 'cordero_shop_filter_section' ) ) { + function cordero_shop_filter_section() { + if ( !is_product() ) { + get_sidebar( 'shop-filters' ); + } + } +} + + +if ( !function_exists( 'cordero_theme_wrapper_start' ) ) { + function cordero_theme_wrapper_start() { + if ( !is_active_sidebar( 'cordero-sidebar-shop' ) || is_product() || get_theme_mod( 'sidebar_position' ) === 'below' ) { + $page_full_width = ' full-width'; + } else { + $page_full_width = ''; + } + cordero_before_primary_content(); + echo '
+
'; + } +} + + +if ( !function_exists( 'cordero_theme_wrapper_end' ) ) { + function cordero_theme_wrapper_end() { + echo '
+
'; + cordero_after_primary_content(); + if ( !is_product() ) { + get_sidebar( 'shop' ); + } + } +} + + +if ( !function_exists( 'cordero_change_prev_next' ) ) { + function cordero_change_prev_next( $args ) { + $args['prev_text'] = ''; + $args['next_text'] = ''; + return $args; + } +} +add_filter( 'woocommerce_pagination_args', 'cordero_change_prev_next' ); + + +if ( !function_exists( 'cordero_woocommerce_placeholder_img_src' ) ) { + function cordero_woocommerce_placeholder_img_src() { + return esc_url( get_template_directory_uri() ) . '/images/woocommerce-placeholder.png'; + } +} +if ( !get_option( 'woocommerce_placeholder_image', 0 ) ) { + add_filter('woocommerce_placeholder_img_src', 'cordero_woocommerce_placeholder_img_src'); +} + + +if ( !function_exists( 'cordero_upsell_products_args' ) ) { + function cordero_upsell_products_args( $args ) { + $col_per_page = esc_attr( get_option( 'woocommerce_catalog_columns', 5 ) ); + $args['posts_per_page'] = $col_per_page; + $args['columns'] = $col_per_page; + return $args; + } +} +add_filter( 'woocommerce_upsell_display_args', 'cordero_upsell_products_args' ); + + +if ( !function_exists( 'cordero_related_products_args' ) ) { + function cordero_related_products_args( $args ) { + $col_per_page = esc_attr( get_option( 'woocommerce_catalog_columns', 5 ) ); + $args['posts_per_page'] = $col_per_page; + $args['columns'] = $col_per_page; + return $args; + } +} +add_filter( 'woocommerce_output_related_products_args', 'cordero_related_products_args' ); + + +if ( !function_exists( 'cordero_woocommerce_gallery_thumbnail_size' ) ) { + function cordero_woocommerce_gallery_thumbnail_size( $size ) { + return 'woocommerce_thumbnail'; + } +} +add_filter( 'woocommerce_gallery_thumbnail_size', 'cordero_woocommerce_gallery_thumbnail_size' ); + + +/* + * see: woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php +*/ +if ( !function_exists( 'cordero_wc_product_block' ) ) { + function cordero_wc_product_block( $html, $data, $product ) { + $html = '
  • + + ' . $data->image . ' + ' . cordero_wc_block_extra_img( $product ) . ' + ' . $data->title . ' + + ' . $data->badge . ' + ' . $data->price . ' + ' . $data->rating . ' + ' . $data->button . ' +
  • '; + return $html; + } +} +add_filter( 'woocommerce_blocks_product_grid_item_html', 'cordero_wc_product_block', 10, 3); + + +if ( !function_exists( 'cordero_wc_block_extra_img' ) ) { + function cordero_wc_block_extra_img( $product ) { + $attachment_ids = $product->get_gallery_image_ids(); + if ( $attachment_ids && $product->get_image_id() ) { + return '
    ' . wp_get_attachment_image( $attachment_ids[0], 'woocommerce_thumbnail' ) . '
    '; + } + } +} + + +/** + * Exclude custom logo image from Jetpack lazy load + */ +if(!function_exists( 'cordero_exclude_class_from_lazy_load' )){ + function cordero_exclude_class_from_lazy_load( $classes ) { + $classes[] = 'custom-logo'; + return $classes; + } +} +add_filter( 'jetpack_lazy_images_blocked_classes', 'cordero_exclude_class_from_lazy_load', 999, 1 ); + + +/** + * Disable image scaling + * since WP 5.3 any uploaded image larger than 2560px (height or width) is scaled to max 2560px + */ +add_filter( 'big_image_size_threshold', '__return_false' ); diff --git a/functions/fonts.php b/functions/fonts.php new file mode 100644 index 0000000..44baaee --- /dev/null +++ b/functions/fonts.php @@ -0,0 +1,65 @@ + 'Arial, Helvetica, sans-serif', + 'Impact, Charcoal, sans-serif' => 'Impact, Charcoal, sans-serif', + '"Lucida Sans Unicode", "Lucida Grande", sans-serif' => '"Lucida Sans Unicode", "Lucida Grande", sans-serif', + 'Tahoma, Geneva, sans-serif' => 'Tahoma, Geneva, sans-serif', + '"Trebuchet MS", Helvetica, sans-serif' => '"Trebuchet MS", Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif' => 'Verdana, Geneva, sans-serif', + 'Georgia, serif' => 'Georgia, serif', + '"Palatino Linotype", "Book Antiqua", Palatino, serif' => '"Palatino Linotype", "Book Antiqua", Palatino, serif', + '"Times New Roman", Times, serif' => '"Times New Roman", Times, serif', + '' => '---------------', + 'Alegreya Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Alegreya Sans', + 'Arimo:400,400i,700,700i' => 'Arimo', + 'Arvo:400,400i,700,700i' => 'Arvo', + 'Asap:400,400i,700,700i' => 'Asap', + 'Bitter:400,400i,700' => 'Bitter', + 'Bree Serif:400' => 'Bree Serif', + 'Cabin:400,400i,500,500i,600,600i,700,700i' => 'Cabin', + 'Catamaran:300,400,600,700,800' => 'Catamaran', + 'Crimson Text:400,400i,600,600i,700,700i' => 'Crimson Text', + 'Cuprum:400,400i,700,700i' => 'Cuprum', 'Dosis:200,300,400,500,600,700,800' => 'Dosis', + 'Droid Sans:400,700' => 'Droid Sans', + 'Droid Serif:400,400i,700,700i' => 'Droid Serif', + 'Exo:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Exo', + 'Exo 2:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Exo 2', + 'Hind:300,400,500,600,700' => 'Hind', + 'Lato:100,100i,300,300i,400,400i,700,700i,900,900i' => 'Lato', + 'Libre Franklin:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Libre Franklin', + 'Maven Pro:400,500,700,900' => 'Maven Pro', + 'Merriweather:300,300i,400,400i,700,700i,900,900i' => 'Merriweather', + 'Merriweather Sans:300,300i,400,400i,700,700i,800,800i' => 'Merriweather Sans', + 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Montserrat', + 'Muli:300,300i,400,400i' => 'Muli', + 'Noto Sans:400,400i,700,700i' => 'Noto Sans', + 'Noto Serif:400,400i,700,700i' => 'Noto Serif', + 'Nunito:300,400,700' => 'Nunito', + 'Open Sans:300,300i,400,400i,600,600i,700,700i,800,800i' => 'Open Sans', + 'Orbitron:400,500,700,900' => 'Orbitron', + 'Oswald:300,400,700' => 'Oswald', + 'Oxygen:300,400,700' => 'Oxygen', + 'Playfair Display:400,400i,700,700i,900,900i' => 'Playfair Display', + 'Poppins:300,400,500,600,700' => 'Poppins', + 'PT Sans:400,400i,700,700i' => 'PT Sans', + 'PT Serif:400,400i,700,700i' => 'PT Serif', + 'Rajdhani:300,400,500,600,700' => 'Rajdhani', + 'Raleway:100,200,300,400,500,600,700,800,900' => 'Raleway', + 'Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i' => 'Roboto', + 'Roboto Slab:100,300,400,700' => 'Roboto Slab', + 'Rock Salt:400' => 'Rock Salt', + 'Sanchez:400,400i' => 'Sanchez', + 'Source Sans Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i' => 'Source Sans Pro', + 'Titillium Web:200,200i,300,300i,400,400i,600,600i,700,700i,900' => 'Titillium Web', + 'Ubuntu:300,300i,400,400i,500,500i,700,700i' => 'Ubuntu', + 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' => 'Work Sans', + ); + } +} diff --git a/functions/hooks.php b/functions/hooks.php new file mode 100644 index 0000000..02a564e --- /dev/null +++ b/functions/hooks.php @@ -0,0 +1,130 @@ + .wp-block-group__inner-container > .wp-block-group,.wp-block-cover.alignfull > .wp-block-group__inner-container > .wp-block-group,.wp-block-group.alignfull > .wp-block-group__inner-container > .wp-block-group').css( {'max-width': to + 'px'} ); + } ); + } ); + + wp.customize('header_search_off', function( value ) { + value.bind( function( to ) { + if ( to == 1 ) { + $('#masthead .top-search').css( {'display': 'none'} ); + } else { + $('#masthead .top-search').css( {'display': 'inline-block'} ); + } + } ); + } ); + + wp.customize('accent_color', function( value ) { + value.bind( function( to ) { + + var styleColor = 'a,#masthead .top-account .mini-account a,#masthead.transparent #site-navigation .top-account .mini-account a:not(.button),#masthead .top-cart .mini-cart a,#masthead.transparent .top-cart .mini-cart a:not(.button),#masthead.transparent #site-navigation .top-cart .mini-cart a:not(.button),.site-footer a,#add_payment_method .cart-collaterals .cart_totals .discount td,.woocommerce-cart .cart-collaterals .cart_totals .discount td,.woocommerce-checkout .cart-collaterals .cart_totals .discount td,.woocommerce .product-addtocart-wrap a.button,.woocommerce .product-addtocart-wrap a.button:hover,.woocommerce .product-addtocart-wrap a.added_to_cart,.woocommerce .product-addtocart-wrap a.added_to_cart:hover,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart,.infinite-loader,.has-accent-color-color,.wp-block-button__link.has-accent-color-color,hr.wp-block-separator.has-accent-color-color{color:' + to + ';}'; + + var styleBackground = '.button,a.button,button,input[type="button"],input[type="reset"],input[type="submit"],#infinite-handle span button,#infinite-handle span button:hover,#infinite-handle span button:focus,#infinite-handle span button:active,.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt,.woocommerce a.added_to_cart,.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover,.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover,.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover,.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover,.woocommerce a.added_to_cart,.woocommerce a.added_to_cart:hover,#grid-loop article.sticky:before,#main .infinite-wrap article.sticky:before,#footer-menu a[href^="mailto:"]:before,.widget_nav_menu a[href^="mailto:"]:before,#footer-menu a[href^="tel:"]:before,.widget_nav_menu a[href^="tel:"]:before{background:' + to + ';}'; + + var styleBgColor = '.woocommerce span.onsale,.woocommerce ul.products li.product .onsale,.woocommerce .widget_price_filter .ui-slider .ui-slider-range,.woocommerce .widget_price_filter .ui-slider .ui-slider-handle,.wp-block-button__link,.wc-block-grid__product-onsale,.has-accent-color-background-color,.wp-block-button__link.has-accent-color-background-color,hr.wp-block-separator.has-accent-color-background-color{background-color:' + to + ';}'; + + var styleBorderColor = '.woocommerce-info,.woocommerce-message,.featured-style-1 .wp-block-columns .wp-block-column,.wp-block-columns.featured-style-1 .wp-block-column{border-color:' + to + ';}'; + + var styleRangeColor = '.wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress,.rtl .wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress{--range-color:' + to + ';}'; + + $('head').append(''); + } ); + } ); + + wp.customize('accent_color2', function( value ) { + value.bind( function( to ) { + + var featicon = cordero_hex2rgba(to, '0.45'); + + var styleColor = '.has-accent-color-2-color,.wp-block-button__link.has-accent-color-2-color,hr.wp-block-separator.has-accent-color-2-color{color:' + to + ';}'; + + var styleBgColor = '#masthead.transparent.scrolled,#colophon,.wp-block-cover,.wp-block-cover-image,.has-accent-color-2-background-color,.wp-block-button__link.has-accent-color-2-background-color,hr.wp-block-separator.has-accent-color-2-background-color,.featured-style-1 .wp-block-image figure,.wc-block-featured-product,.wc-block-featured-category{background-color:' + to + ';}'; + + var styleBoxShadow = '.featured-style-1 .wp-block-image figure{box-shadow: 0px 0px 0px 4px ' + featicon + ';}'; + + $('head').append(''); + } ); + } ); + + wp.customize('accent_color3', function( value ) { + value.bind( function( to ) { + var blog_post_style = wp.customize.value( 'blog_post_style' )(); + var blog_post_tag = ''; + if ( blog_post_style == 'border' || blog_post_style == 'shadow' ) { + blog_post_tag = ',#grid-loop article,#main .infinite-wrap article,.wp-block-latest-posts.is-grid li'; + } + + var styleColor = '.has-accent-color-3-color,.wp-block-button__link.has-accent-color-3-color,hr.wp-block-separator.has-accent-color-3-color{color:' + to + ';}'; + + var styleBackground = 'th,.woocommerce ul.products li.product,.woocommerce-page ul.products li.product,#secondary,ul.archive-sub-cats li,#shop-filters,article.comment-body,.wp-caption-text,.pagination span,.pagination .dots,.pagination a,.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span,.woocommerce div.product .woocommerce-tabs ul.tabs li,.wp-block-woocommerce-attribute-filter,.wp-block-woocommerce-price-filter,.wp-block-woocommerce-active-filters > h5,.wp-block-woocommerce-active-filters > div,.wp-block-woocommerce-active-filters > div:last-child,.wc-block-grid__product' + blog_post_tag + '{background:' + to + ';}'; + + var styleBgColor = 'input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="number"],input[type="tel"],input[type="range"],input[type="date"],input[type="month"],input[type="week"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="color"],textarea,select,input[type="text"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="password"]:focus,input[type="search"]:focus,input[type="number"]:focus,input[type="tel"]:focus,input[type="range"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="week"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="color"]:focus,textarea:focus,select:focus,.shop-filter-wrap .shop-filter-toggle,.woocommerce div.product form.cart div.quantity input[type="button"],.featured-style-1 .wp-block-columns .wp-block-column,.wp-block-columns.featured-style-1 .wp-block-column,.wp-block-columns.pricing-table .wp-block-column,.has-accent-color-3-background-color,.wp-block-button__link.has-accent-color-3-background-color,hr.wp-block-separator.has-accent-color-3-background-color{background-color:' + to + ';}'; + + var styleBorderLeftColor = '.comment-navigation .nav-next a:after{border-left-color:' + to + ';}'; + var styleBorderRightColor = '.comment-navigation .nav-previous a:after{border-right-color:' + to + ';}'; + + var styleResponsive = '@media (min-width: 1025px){.masthead-left #masthead{background:' + to + ';}}'; + + var styleResponsive2 = '@media (max-width: 1024px){.toggle-nav-open,.toggle-nav-open:hover{background:' + to + ';}}'; + + $('head').append(''); + } ); + } ); + + wp.customize('font_site_title', function( value ) { + value.bind( function( to ) { + cordero_font_bind( to, '.site-title' ); + } ); + } ); + + wp.customize('font_nav', function( value ) { + value.bind( function( to ) { + cordero_font_bind( to, '#site-navigation .site-main-menu' ); + } ); + } ); + + wp.customize('font_content', function( value ) { + value.bind( function( to ) { + var font_nav = wp.customize.value( 'font_nav' )(); + var font_site_title = wp.customize.value( 'font_site_title' )(); + cordero_font_bind( to, 'body, button, input, select, textarea' ); + if ( font_site_title === '' ) { + $('.site-title').css({ fontFamily: 'initial' }); + } else { + cordero_font_bind( font_site_title, '.site-title' ); + } + if ( font_nav === '' ) { + $('#site-navigation .site-main-menu').css({ fontFamily: 'initial' }); + } else { + cordero_font_bind( font_nav, '#site-navigation .site-main-menu' ); + } + } ); + } ); + + wp.customize('font_headings', function( value ) { + value.bind( function( to ) { + cordero_font_bind( to, 'h1:not(.site-title), h2, h3, h4, h5, h6, blockquote, .wc-block-grid__product .wc-block-grid__product-title, .wp-block-latest-posts.is-grid li > a' ); + } ); + } ); + + wp.customize('fs_base', function( value ) { + value.bind( function( to ) { + $('body,button,input,select,textarea').css( {'font-size': to + 'px'} ); + } ); + } ); + + wp.customize('menu_uppercase', function( value ) { + value.bind( function( to ) { + $('#primary-menu > li').css( {'text-transform': to} ); + } ); + } ); + +} )( jQuery ); + +function cordero_font_bind( to, style_class ) { + if ( to == '' || to == 'Arial, Helvetica, sans-serif' || to == 'Impact, Charcoal, sans-serif' || to == '"Lucida Sans Unicode", "Lucida Grande", sans-serif' || to == 'Tahoma, Geneva, sans-serif' || to == '"Trebuchet MS", Helvetica, sans-serif' || to == 'Verdana, Geneva, sans-serif' || to == 'Georgia, serif' || to == '"Palatino Linotype", "Book Antiqua", Palatino, serif' || to == '"Times New Roman", Times, serif' ) { + } else { + var googlefont = encodeURI(to.replace(" ", "+")); + jQuery('head').append(''); + to = to.substr(0, to.indexOf(':')); + to = "'" + to + "'"; + } + jQuery(style_class).css({ + fontFamily: to + }); +} + +function cordero_font_style( to, style_class ) { + if ( to == 'italic' ) { + var to_style = 'italic'; + } else { + var to_style = 'normal'; + } + jQuery(style_class).css( {'font-style': to_style } ); +} + +function cordero_hex2rgba( colour, opacity ) { + var r,g,b; + if ( colour.charAt(0) == '#') { + colour = colour.substr(1); + } + + r = colour.charAt(0) + '' + colour.charAt(1); + g = colour.charAt(2) + '' + colour.charAt(3); + b = colour.charAt(4) + '' + colour.charAt(5); + + r = parseInt( r,16 ); + g = parseInt( g,16 ); + b = parseInt( b,16); + return 'rgba(' + r + ',' + g + ',' + b + ',' + opacity + ')'; +} diff --git a/functions/js/customizer-script.js b/functions/js/customizer-script.js new file mode 100644 index 0000000..e853a95 --- /dev/null +++ b/functions/js/customizer-script.js @@ -0,0 +1,17 @@ +jQuery(document).ready(function($) { + + $('.controls#cordero-img-container-header_layout li img').click(function(){ + $('.controls#cordero-img-container-header_layout li').each(function(){ + $(this).find('img').removeClass ('cordero-radio-img-selected') ; + }); + $(this).addClass ('cordero-radio-img-selected') ; + }); + + $('.controls#cordero-img-container-footer_layout li img').click(function(){ + $('.controls#cordero-img-container-footer_layout li').each(function(){ + $(this).find('img').removeClass ('cordero-radio-img-selected') ; + }); + $(this).addClass ('cordero-radio-img-selected') ; + }); + +}); diff --git a/functions/schema.php b/functions/schema.php new file mode 100644 index 0000000..e1a8e99 --- /dev/null +++ b/functions/schema.php @@ -0,0 +1,148 @@ + array(), + ) + ); + $input = str_replace( '"', '\'', $input ); + return $input; +} + + +if ( !function_exists( 'cordero_dynamic_style' ) ) { + function cordero_dynamic_style( $css = array() ) { + + $font_content = get_theme_mod( 'font_content' ); + $font_headings = get_theme_mod( 'font_headings' ); + $font_site_title = get_theme_mod( 'font_site_title' ); + $font_nav = get_theme_mod( 'font_nav' ); + + if ( $font_content ) { + $font_site_title_on = 1; + $font_nav_on = 1; + $css[] = 'body,button,input,select,textarea{' . cordero_css_font_family( $font_content ) . ';}'; + if ( $font_site_title ) { + $css[] = '.site-title{' . cordero_css_font_family( $font_site_title ) . ';}'; + } else { + $css[] = '.site-title{font-family:\'Montserrat\';}'; + } + if ( $font_nav ) { + $css[] = '#site-navigation .site-main-menu{' . cordero_css_font_family( $font_nav ) . ';}'; + } else { + $css[] = '#site-navigation .site-main-menu{font-family:\'Work Sans\';}'; + } + } else { + $font_site_title_on = 0; + $font_nav_on = 0; + } + + if ( $font_headings ) { + $css[] = 'h1:not(.site-title),h2,h3,h4,h5,h6,blockquote,.wc-block-grid__product .wc-block-grid__product-title,.wp-block-latest-posts.is-grid li > a{' . cordero_css_font_family( $font_headings ) . ';}'; + } + + if ( $font_site_title && $font_site_title_on == 0 ) { + $css[] = '.site-title{' . cordero_css_font_family( $font_site_title ) . ';}'; + } + + if ( $font_nav && $font_nav_on == 0 ) { + $css[] = '#site-navigation .site-main-menu{' . cordero_css_font_family( $font_nav ) . ';}'; + } + + $fs_base = get_theme_mod( 'fs_base', '16' ); + if ( $fs_base && $fs_base != '16' ) { + $css[] = 'body,button,input,select,textarea{font-size:' . esc_attr($fs_base) . 'px;}'; + } + + $menu_uppercase = get_theme_mod( 'menu_uppercase', 'uppercase' ); + if ( $menu_uppercase == 'none' ) { + $css[] = '#primary-menu > li{text-transform:none;}'; + } + + if ( class_exists( 'WooCommerce' ) ) { + $woo_uncat_id = term_exists( 'uncategorized', 'product_cat' ); + if ( $woo_uncat_id != NULL ) { + $woo_uncat_id = $woo_uncat_id['term_id']; + $css[] = '#shop-filters .widget_product_categories li.cat-item-' . $woo_uncat_id . '{display:none;}'; + } + } + + $container_width = get_theme_mod( 'container_width', '1240' ); + if ( $container_width && $container_width != '1240' ) { + $css[] = '.container,.wp-block-cover-image.alignfull > .wp-block-cover-image__inner-container > .wp-block-group,.wp-block-cover.alignfull > .wp-block-cover__inner-container > .wp-block-group,.wp-block-group.alignfull > .wp-block-group__inner-container > .wp-block-group{max-width:' . esc_attr($container_width) . 'px;}'; + } + + $accent_color = get_theme_mod( 'accent_color', '#d82978' ); + if ( $accent_color && $accent_color != '#d82978' ) { + $accent_color = esc_attr($accent_color); + + $css[] = 'a,#masthead .top-account .mini-account a,#masthead.transparent #site-navigation .top-account .mini-account a:not(.button),#masthead .top-cart .mini-cart a,#masthead.transparent .top-cart .mini-cart a:not(.button),#masthead.transparent #site-navigation .top-cart .mini-cart a:not(.button),.site-footer a,#add_payment_method .cart-collaterals .cart_totals .discount td,.woocommerce-cart .cart-collaterals .cart_totals .discount td,.woocommerce-checkout .cart-collaterals .cart_totals .discount td,.woocommerce .product-addtocart-wrap a.button,.woocommerce .product-addtocart-wrap a.button:hover,.woocommerce .product-addtocart-wrap a.added_to_cart,.woocommerce .product-addtocart-wrap a.added_to_cart:hover,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart,.infinite-loader,.has-accent-color-color,.wp-block-button__link.has-accent-color-color,.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-color,hr.wp-block-separator.has-accent-color-color,.wp-block-group.testimonial:before{color:' . $accent_color . ';}'; + + $css[] = '.button,a.button,button,input[type="button"],input[type="reset"],input[type="submit"],#infinite-handle span button,#infinite-handle span button:hover,#infinite-handle span button:focus,#infinite-handle span button:active,.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit.alt,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt,.woocommerce a.added_to_cart,.woocommerce #respond input#submit.alt.disabled,.woocommerce #respond input#submit.alt.disabled:hover,.woocommerce #respond input#submit.alt:disabled,.woocommerce #respond input#submit.alt:disabled:hover,.woocommerce #respond input#submit.alt:disabled[disabled],.woocommerce #respond input#submit.alt:disabled[disabled]:hover,.woocommerce a.button.alt.disabled,.woocommerce a.button.alt.disabled:hover,.woocommerce a.button.alt:disabled,.woocommerce a.button.alt:disabled:hover,.woocommerce a.button.alt:disabled[disabled],.woocommerce a.button.alt:disabled[disabled]:hover,.woocommerce button.button.alt.disabled,.woocommerce button.button.alt.disabled:hover,.woocommerce button.button.alt:disabled,.woocommerce button.button.alt:disabled:hover,.woocommerce button.button.alt:disabled[disabled],.woocommerce button.button.alt:disabled[disabled]:hover,.woocommerce input.button.alt.disabled,.woocommerce input.button.alt.disabled:hover,.woocommerce input.button.alt:disabled,.woocommerce input.button.alt:disabled:hover,.woocommerce input.button.alt:disabled[disabled],.woocommerce input.button.alt:disabled[disabled]:hover,.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover,.woocommerce #respond input#submit:hover,.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover,.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover,.woocommerce input.button.alt:hover,.woocommerce a.added_to_cart,.woocommerce a.added_to_cart:hover,#grid-loop article.sticky:before,#main .infinite-wrap article.sticky:before,#footer-menu a[href^="mailto:"]:before,.widget_nav_menu a[href^="mailto:"]:before,#footer-menu a[href^="tel:"]:before,.widget_nav_menu a[href^="tel:"]:before{background:' . $accent_color . ';}'; + + $css[] = '.woocommerce span.onsale,.woocommerce ul.products li.product .onsale,.woocommerce .widget_price_filter .ui-slider .ui-slider-range,.woocommerce .widget_price_filter .ui-slider .ui-slider-handle,.wp-block-button__link,.wc-block-grid__product-onsale,.has-accent-color-background-color,.wp-block-button__link.has-accent-color-background-color,hr.wp-block-separator.has-accent-color-background-color{background-color:' . $accent_color . ';}'; + + $css[] = '.woocommerce-info,.woocommerce-message{border-color:' . $accent_color . ';}'; + + $css[] = '.wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress,.rtl .wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress{--range-color:' . $accent_color . ';}'; + + $css[] = '.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{background-color:' . $accent_color . ';}'; + + } + + $accent_color2 = get_theme_mod( 'accent_color2', '#2d2354' ); + if ( $accent_color2 && $accent_color2 != '#2d2354' ) { + $accent_color2 = esc_attr($accent_color2); + + $css[] = '.has-accent-color-2-color,.wp-block-button__link.has-accent-color-2-color,.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-2-color,hr.wp-block-separator.has-accent-color-2-color{color:' . $accent_color2 . ';}'; + + $css[] = '#masthead.transparent.scrolled,#colophon,.wp-block-cover,.wp-block-cover-image,.has-accent-color-2-background-color,.wp-block-button__link.has-accent-color-2-background-color,hr.wp-block-separator.has-accent-color-2-background-color,.featured-style-1 .wp-block-image figure,.wc-block-featured-product,.wc-block-featured-category{background-color:' . $accent_color2 . ';}'; + + $accent_color2_rgb = cordero_hex2RGB($accent_color2); + $css[] = '.featured-style-1 .wp-block-image figure{box-shadow: 0px 0px 0px 4px rgba( '.$accent_color2_rgb['r'].', '.$accent_color2_rgb['g'].', '.$accent_color2_rgb['b'].',0.45);}'; + + } + + $accent_color3 = get_theme_mod( 'accent_color3', '#fbfbfb' ); + if ( $accent_color3 && $accent_color3 != '#fbfbfb' ) { + $accent_color3 = esc_attr($accent_color3); + + $css[] = '.has-accent-color-3-color,.wp-block-button__link.has-accent-color-3-color,.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-3-color,hr.wp-block-separator.has-accent-color-3-color{color:' . $accent_color3 . ';}'; + + $css[] = 'th,.woocommerce ul.products li.product,.woocommerce-page ul.products li.product,#secondary,ul.archive-sub-cats li,#shop-filters,article.comment-body,.wp-caption-text,.pagination span,.pagination .dots,.pagination a,.woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span,.woocommerce div.product .woocommerce-tabs ul.tabs li,.wp-block-woocommerce-attribute-filter,.wp-block-woocommerce-price-filter,.wp-block-woocommerce-active-filters > h5,.wp-block-woocommerce-active-filters > div,.wp-block-woocommerce-active-filters > div:last-child,.wc-block-grid__product{background:' . $accent_color3 . ';}'; + + $css[] = 'input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="number"],input[type="tel"],input[type="range"],input[type="date"],input[type="month"],input[type="week"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="color"],textarea,select,input[type="text"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="password"]:focus,input[type="search"]:focus,input[type="number"]:focus,input[type="tel"]:focus,input[type="range"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="week"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="color"]:focus,textarea:focus,select:focus,.shop-filter-wrap .shop-filter-toggle,.woocommerce div.product form.cart div.quantity input[type="button"],.featured-style-1 .wp-block-columns .wp-block-column,.wp-block-columns.featured-style-1 .wp-block-column,.wp-block-columns.pricing-table .wp-block-column,.has-accent-color-3-background-color,.wp-block-button__link.has-accent-color-3-background-color,hr.wp-block-separator.has-accent-color-3-background-color{background-color:' . $accent_color3 . ';}'; + + $css[] = '.comment-navigation .nav-next a:after{border-left-color:' . $accent_color3 . ';}'; + $css[] = '.comment-navigation .nav-previous a:after{border-right-color:' . $accent_color3 . ';}'; + + $css[] = '@media (min-width: 1025px){.masthead-left #masthead{background:' . $accent_color3 . ';}}'; + + $css[] = '@media (max-width: 1024px){.toggle-nav-open,.toggle-nav-open:hover{background:' . $accent_color3 . ';}}'; + + } + + if ( get_theme_mod( 'header_search_off' ) ) { + $css[] = '#masthead .top-search{display:none;}'; + } + + $blog_post_style = get_theme_mod( 'blog_post_style', 'plain' ); + if ( $blog_post_style == 'border' ) { + if ($accent_color3 && $accent_color3 != "#fbfbfb") { + $blog_post_bg = $accent_color3; + } else { + $blog_post_bg = '#fbfbfb'; + } + $css[] = '#grid-loop article,#main .infinite-wrap article,.wp-block-latest-posts.is-grid li{background:' . esc_attr($blog_post_bg) . ';border:1px solid #f1f1f1;padding:1em;}'; + } elseif ( $blog_post_style == 'shadow' ) { + if ($accent_color3 && $accent_color3 != "#fbfbfb") { + $blog_post_bg = $accent_color3; + } else { + $blog_post_bg = '#fbfbfb'; + } + $css[] = '#grid-loop article,#main .infinite-wrap article,.wp-block-latest-posts.is-grid li{background:' . esc_attr($blog_post_bg) . ';border-radius:6px;padding:1em;box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03);}'; + } + + $post_spacing = get_theme_mod( 'post_spacing', 'space-between' ); + if ( $post_spacing && $post_spacing != 'space-between' ) { + $css[] = '#grid-loop article,#main .infinite-wrap article,.wp-block-latest-posts.is-grid li{justify-content:' . esc_attr($post_spacing) . ';}'; + } + + $reading_width = get_theme_mod( 'reading_width', '640' ); + if ( $reading_width && $reading_width != '640' ) { + $css[] = '.post-template-template-single-reading .single-entry-content,.post-template-template-single-reading-paragraph .single-entry-content p{max-width:' . esc_attr($reading_width) . 'px;}'; + } + + return implode( '', $css ); + + } +} + + +if ( !function_exists( 'cordero_editor_dynamic_style' ) ) { + function cordero_editor_dynamic_style( $mceInit, $css = array() ) { + + $font_content = get_theme_mod( 'font_content' ); + if ( $font_content ) { + $css[] = 'body.mce-content-body{' . cordero_css_font_family( $font_content ) . ';}'; + } + + $font_headings = get_theme_mod( 'font_headings' ); + if ( $font_headings ) { + $css[] = '.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{' . cordero_css_font_family( $font_headings ) . ';}'; + } + + $accent_color = get_theme_mod( 'accent_color' ); + if ( $accent_color ) { + $css[] = '.mce-content-body a:not(.button),.mce-content-body a:hover:not(.button),.mce-content-body a:focus:not(.button),.mce-content-body a:active:not(.button){color:' . esc_attr( $accent_color ) . '}'; + } + + $styles = implode( '', $css ); + + if ( isset( $mceInit['content_style'] ) ) { + $mceInit['content_style'] .= ' ' . $styles . ' '; + } else { + $mceInit['content_style'] = $styles . ' '; + } + return $mceInit; + + } +} +add_filter( 'tiny_mce_before_init', 'cordero_editor_dynamic_style' ); + + +function cordero_block_editor_dynamic_style( $css = array() ) { + + $container_width = get_theme_mod( 'container_width', '1240' ); + if ( $container_width && $container_width != '1240' ) { + $css[] = '.edit-post-visual-editor,[data-align="full"] .wp-block-cover-image > .wp-block-cover-image__inner-container > .wp-block-group,[data-align="full"] .wp-block-cover > .wp-block-cover__inner-container > .wp-block-group,[data-align="full"] .wp-block-group > .wp-block-group__inner-container > .wp-block-group{max-width:' . esc_attr ( $container_width ) . 'px;}'; + } + + $full_width = $container_width + 280; + $css[] = '@media (max-width:' . esc_attr ( $full_width ) . 'px){.edit-post-layout.is-sidebar-opened .wp-block[data-align="full"]{margin-left: 0 !important;margin-right: 0 !important;}}'; + + $background_color = get_theme_mod( 'background_color', 'ffffff' ); + if ( $background_color && $background_color != 'ffffff' ) { + $css[] = '.edit-post-layout .interface-interface-skeleton__content,.block-editor-editor-skeleton__body,.edit-post-visual-editor{background-color:#' . esc_attr( $background_color ) . '}'; + } + + $font_content = get_theme_mod( 'font_content', 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + if ($font_content && $font_content != 'Work Sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ) { + $css[] = '.editor-default-block-appender textarea.editor-default-block-appender__content,.editor-styles-wrapper div,.editor-styles-wrapper p,.editor-styles-wrapper ul,.editor-styles-wrapper li{' . cordero_css_font_family( $font_content ) . ';}'; + } + + $font_headings = get_theme_mod( 'font_headings', 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); + if ($font_headings && $font_headings != 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ) { + $css[] = '.editor-post-title__block .editor-post-title__input,.editor-styles-wrapper h1,.editor-styles-wrapper h2,.editor-styles-wrapper h3,.editor-styles-wrapper h4,.editor-styles-wrapper h5,.editor-styles-wrapper h6,.wp-block-latest-posts.is-grid li > a > div,.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title,.wc-block-grid__product .wc-block-grid__product-title{' . cordero_css_font_family( $font_headings ) . ';}'; + } + + $accent_color = get_theme_mod( 'accent_color' ); + if ($accent_color && $accent_color != "#d82978") { + $css[] = '.editor-rich-text__tinymce a,.block-editor-rich-text__editable a,.wp-block-latest-posts.is-grid li > a,.wc-block-grid__product .wc-block-grid__product-add-to-cart,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button,.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart,.wp-block-group.testimonial:before{color:'.esc_attr($accent_color).'}'; + + $css[] = '.wp-block-button__link,.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale,.wc-block-grid__product-onsale{background-color:' . esc_attr( $accent_color ) . ';}'; + + $css[] = '.wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress,.rtl .wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress{--range-color:' . esc_attr( $accent_color ) . ';}'; + + $css[] = '.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb,.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{background-color:' . esc_attr( $accent_color ) . ';}'; + } + + $accent_color2 = get_theme_mod( 'accent_color2' ); + if ($accent_color2 && $accent_color2 != "#2d2354") { + + $css[] = '.wc-block-featured-product,.wc-block-featured-category,.featured-style-1 figure.wp-block-image > div{background-color:' . esc_attr( $accent_color2 ) . ';}'; + + $accent_color2_rgb = cordero_hex2RGB($accent_color2); + $css[] = '.featured-style-1 figure.wp-block-image > div{box-shadow: 0px 0px 0px 4px rgba( '.$accent_color2_rgb['r'].', '.$accent_color2_rgb['g'].', '.$accent_color2_rgb['b'].',0.45);}'; + + } + + $accent_color3 = get_theme_mod( 'accent_color3' ); + if ($accent_color3 && $accent_color3 != "#fbfbfb") { + $css[] = '{color:'.esc_attr($accent_color3).'}'; + + $css[] = '.wc-block-grid__product{background:' . esc_attr( $accent_color3 ) . ';}'; + + $css[] = '.featured-style-1 .wp-block-columns .wp-block-column,.wp-block-columns.featured-style-1 .wp-block-column,.wp-block-columns.pricing-table .wp-block-column{background-color:' . esc_attr( $accent_color3 ) . ';}'; + + } + + $blog_post_style = get_theme_mod( 'blog_post_style', 'plain' ); + if ( $blog_post_style == 'border' ) { + if ($accent_color3 && $accent_color3 != "#fbfbfb") { + $blog_post_bg = $accent_color3; + } else { + $blog_post_bg = '#fbfbfb'; + } + $css[] = '.wp-block-latest-posts.is-grid li{background:' . esc_attr($blog_post_bg) . ';border:1px solid #f1f1f1;padding:1em;}'; + } elseif ( $blog_post_style == 'shadow' ) { + if ($accent_color3 && $accent_color3 != "#fbfbfb") { + $blog_post_bg = $accent_color3; + } else { + $blog_post_bg = '#fbfbfb'; + } + $css[] = '.wp-block-latest-posts.is-grid li{background:' . esc_attr($blog_post_bg) . ';border-radius:6px;padding:1em;box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03);}'; + } + + $post_spacing = get_theme_mod( 'post_spacing', 'space-between' ); + if ( $post_spacing && $post_spacing != 'space-between' ) { + $css[] = '.wp-block-latest-posts.is-grid li{justify-content:' . esc_attr($post_spacing) . ';}'; + } + + return implode( '', $css ); + +} + + +function cordero_hex2RGB($hex) { + $hex = str_replace("#", "", $hex); + + preg_match("/^#{0,1}([0-9a-f]{1,6})$/i",$hex,$match); + if(!isset($match[1])) + { + return false; + } + + if(strlen($match[1]) == 6) + { + list($r, $g, $b) = array($hex[0].$hex[1],$hex[2].$hex[3],$hex[4].$hex[5]); + } + elseif(strlen($match[1]) == 3) + { + list($r, $g, $b) = array($hex[0].$hex[0],$hex[1].$hex[1],$hex[2].$hex[2]); + } + else if(strlen($match[1]) == 2) + { + list($r, $g, $b) = array($hex[0].$hex[1],$hex[0].$hex[1],$hex[0].$hex[1]); + } + else if(strlen($match[1]) == 1) + { + list($r, $g, $b) = array($hex.$hex,$hex.$hex,$hex.$hex); + } + else + { + return false; + } + + $color = array(); + $color['r'] = hexdec($r); + $color['g'] = hexdec($g); + $color['b'] = hexdec($b); + + return $color; +} diff --git a/functions/template-tags.php b/functions/template-tags.php new file mode 100644 index 0000000..f6e036d --- /dev/null +++ b/functions/template-tags.php @@ -0,0 +1,369 @@ +%2$s'; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $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() ) + ); + + echo '' . $time_string . ''; + + $meta_separator = '|'; + + if ( is_single() ) { + if ( get_theme_mod( 'disable_cats_single' ) ) { + $meta_separator = ''; + } + } else { + if ( get_theme_mod( 'disable_cats' ) ) { + $meta_separator = ''; + } + } + + echo $meta_separator; + + } +endif; + +if ( ! function_exists( 'cordero_posted_on_related' ) ) : + /** + * Prints HTML with meta information for the current post-date/time. + */ + function cordero_posted_on_related( $related_id ) { + $time_string = ''; + if ( get_the_time( 'U', $related_id ) !== get_the_modified_time( 'U', $related_id ) ) { + $time_string = ''; + } + + $time_string = sprintf( $time_string, + esc_attr( get_the_date( 'c', $related_id ) ), + esc_html( get_the_date( '', $related_id ) ), + esc_attr( get_the_modified_date( 'c', $related_id ) ), + esc_html( get_the_modified_date( '', $related_id ) ) + ); + + echo '' . $time_string . ''; + + $meta_separator = '|'; + + if ( get_theme_mod( 'disable_cats' ) ) { + $meta_separator = ''; + } + + echo $meta_separator; + + } +endif; + +if ( ! function_exists( 'cordero_posted_by' ) ) : + /** + * Prints HTML with meta information for the current author. + */ + function cordero_posted_by() { + $meta_separator = '|'; + if ( is_single() ) { + if ( get_theme_mod( 'disable_date_single' ) && get_theme_mod( 'disable_cats_single' ) ) { + $meta_separator = ''; + } + echo '' . $meta_separator; + } else { + if ( get_theme_mod( 'disable_date' ) && get_theme_mod( 'disable_cats' ) ) { + $meta_separator = ''; + } + echo '' . $meta_separator; + } + + } +endif; + +if ( ! function_exists( 'cordero_posted_by_related' ) ) : + /** + * Prints HTML with meta information for the current author. + */ + function cordero_posted_by_related( $related_id ) { + + $author_id = get_post_field( 'post_author', $related_id ); + + $meta_separator = '|'; + + if ( get_theme_mod( 'disable_date' ) && get_theme_mod( 'disable_cats' ) ) { + $meta_separator = ''; + } + echo '' . $meta_separator; + + } +endif; + +if ( ! function_exists( 'cordero_entry_cats' ) ) : + /** + * Prints HTML with meta information for the categories only. + */ + function cordero_entry_cats() { + // Hide category text for pages. + if ( 'post' === get_post_type() ) { + + /* translators: used between list items, there is a space after the comma */ + $list_item_seperator = esc_html__( ', ', 'cordero' ); + + $categories_list = get_the_category_list( $list_item_seperator ); + if ( $categories_list ) { + echo '' . $categories_list . ''; + } + + } + + } +endif; + +if ( ! function_exists( 'cordero_entry_cats_related' ) ) : + /** + * Prints HTML with meta information for the categories only. + */ + function cordero_entry_cats_related( $related_id ) { + + /* translators: used between list items, there is a space after the comma */ + $list_item_seperator = esc_html__( ', ', 'cordero' ); + + $categories_list = get_the_category_list( $list_item_seperator, '', $related_id ); + if ( $categories_list ) { + echo '' . $categories_list . ''; + } + + } +endif; + +if ( ! function_exists( 'cordero_entry_tags' ) ) : + /** + * Prints HTML with meta information for the tags only. + */ + function cordero_entry_tags() { + if ( !get_theme_mod( 'disable_tags' ) ) { + // Hide tag text for pages. + if ( 'post' === get_post_type() ) { + + /* translators: used between list items, there is a space after the comma */ + $list_item_seperator = esc_html__( ', ', 'cordero' ); + + $tags_list = get_the_tag_list( '', $list_item_seperator ); + if ( $tags_list ) { + echo ' ' . $tags_list . ''; + } + + } + } + } +endif; + +if ( ! function_exists( 'cordero_entry_tags_related' ) ) : + /** + * Prints HTML with meta information for the tags only. + */ + function cordero_entry_tags_related( $related_id ) { + if ( !get_theme_mod( 'disable_tags' ) ) { + + /* translators: used between list items, there is a space after the comma */ + $list_item_seperator = esc_html__( ', ', 'cordero' ); + + $tags_list = get_the_tag_list( '', $list_item_seperator, '', $related_id ); + if ( $tags_list ) { + echo ' ' . $tags_list . ''; + } + + } + } +endif; + +if ( ! function_exists( 'cordero_entry_footer' ) ) : + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function cordero_entry_footer() { + if ( !get_theme_mod( 'disable_tags_single' ) ) { + // Hide tag text for pages. + if ( 'post' === get_post_type() ) { + + /* translators: used between list items, there is a space after the comma */ + $list_item_seperator = esc_html__( ', ', 'cordero' ); + + $tags_list = get_the_tag_list( '', $list_item_seperator ); + if ( $tags_list ) { + echo ' ' . $tags_list . ''; + } + + } + } + + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + comments_popup_link( + sprintf( + wp_kses( + /* translators: %s: post title */ + __( 'Leave a Comment on %s', 'cordero' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ) + ); + echo ''; + } + + edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Edit %s', 'cordero' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ), + '', + '' + ); + } +endif; + +if ( ! function_exists( 'cordero_post_thumbnail' ) ) : + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ + function cordero_post_thumbnail() { + + $thumbnail_on = false; + $thumbnail_exists = false; + + if ( has_post_thumbnail() ) { + $thumbnail_on = true; + $thumbnail_exists = true; + } + + $thumbnail_placeholder = get_theme_mod( 'featured_image' ); + if ( $thumbnail_placeholder != '' ) { + $thumbnail_on = true; + } + + if ( get_theme_mod( 'disable_img' ) ) { + $thumbnail_on = false; + } + + if ( post_password_required() || is_attachment() || ! $thumbnail_on ) { + return; + } + + if ( is_singular() ) : + ?> +
    + +
    + + + + + + + + + + + + get( 'Name' ) ) . ' ' . esc_html( $theme->get( 'Version' ) ), sprintf( esc_html__( '%s Options', 'cordero' ), $theme->get( 'Name' ) ), 'edit_theme_options', 'cordero', 'cordero_display_theme_help_page' + ); + +} + +// Display Theme help page. +function cordero_display_theme_help_page() { + + // Get Theme Details from style.css. + $theme = wp_get_theme(); + ?> + +
    + +

    get( 'Name' ) ) . ' ' . esc_html( $theme->get( 'Version' ) ); ?>

    + +
    get( 'Description' ) ); ?>
    + +
    + +

    get( 'Name' ) ); ?> +

    + +

    + +

    + +

    +

    + +

    +

    + +

    +

    + +

    +

    + +

    + + +

    + +

    +

    + + + +

    + +

    + +

    +

    + + + +

    + + + + +
    + +
    + +
    +

    + +

    + get( 'Name' ) ); ?> +

    +

    + + + +

    +
    + +
    +

    + +

    + get( 'Name' ) ); ?> +

    + +

    + + + +

    +
    + +
    +

    + +

    + +

    +

    + + + +

    +
    + +
    +

    + +

    + +

    +

    + + + +

    +
    + + +
    +

    + +

    + +

    +

    + + + +

    +
    + +
    + +
    + + + +
    + +
    + +
    + +
    + + + +
    + + + +> + + + + + + + + + + + +> + + + + + +
    > + + + +
    > + + + +
    +
    + +
    +
    + + + + + + +
    + +
    + + + +
    + + + +
    +
    diff --git a/header.php b/header.php new file mode 100644 index 0000000..fd6f2cd --- /dev/null +++ b/header.php @@ -0,0 +1,100 @@ + + +> + + + + + + + + + + + +> + + + + + +
    > + + + + + + + +
    +
    diff --git a/home.php b/home.php new file mode 100644 index 0000000..cfcd3ce --- /dev/null +++ b/home.php @@ -0,0 +1,53 @@ + + + + +
    +
    + + + +
    + + + + + + + + +
    + + '', + 'next_text' => '', + ) ); ?> + + + + + + + +
    +
    + + + + + + diff --git a/images/column-bg-01.jpg b/images/column-bg-01.jpg new file mode 100644 index 0000000..e5e61c6 Binary files /dev/null and b/images/column-bg-01.jpg differ diff --git a/images/column-bg-02.jpg b/images/column-bg-02.jpg new file mode 100644 index 0000000..2e9a0fc Binary files /dev/null and b/images/column-bg-02.jpg differ diff --git a/images/column-bg-03.jpg b/images/column-bg-03.jpg new file mode 100644 index 0000000..95647dc Binary files /dev/null and b/images/column-bg-03.jpg differ diff --git a/images/column-bg-04.jpg b/images/column-bg-04.jpg new file mode 100644 index 0000000..48640dc Binary files /dev/null and b/images/column-bg-04.jpg differ diff --git a/images/cover-01.jpg b/images/cover-01.jpg new file mode 100644 index 0000000..733e623 Binary files /dev/null and b/images/cover-01.jpg differ diff --git a/images/cover-02.jpg b/images/cover-02.jpg new file mode 100644 index 0000000..6b9ec85 Binary files /dev/null and b/images/cover-02.jpg differ diff --git a/images/cover-background.jpg b/images/cover-background.jpg new file mode 100644 index 0000000..83e1c3c Binary files /dev/null and b/images/cover-background.jpg differ diff --git a/images/down-arrow.svg b/images/down-arrow.svg new file mode 100644 index 0000000..7086ff5 --- /dev/null +++ b/images/down-arrow.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/food-item-01.jpg b/images/food-item-01.jpg new file mode 100644 index 0000000..9ae9fcb Binary files /dev/null and b/images/food-item-01.jpg differ diff --git a/images/food-item-02.jpg b/images/food-item-02.jpg new file mode 100644 index 0000000..70842eb Binary files /dev/null and b/images/food-item-02.jpg differ diff --git a/images/food-item-03.jpg b/images/food-item-03.jpg new file mode 100644 index 0000000..3e80006 Binary files /dev/null and b/images/food-item-03.jpg differ diff --git a/images/food-item-04.jpg b/images/food-item-04.jpg new file mode 100644 index 0000000..3a791fd Binary files /dev/null and b/images/food-item-04.jpg differ diff --git a/images/footer-centered-info-below.png b/images/footer-centered-info-below.png new file mode 100644 index 0000000..b7c4bb5 Binary files /dev/null and b/images/footer-centered-info-below.png differ diff --git a/images/footer-centered.png b/images/footer-centered.png new file mode 100644 index 0000000..8a2af4e Binary files /dev/null and b/images/footer-centered.png differ diff --git a/images/footer-info-right.png b/images/footer-info-right.png new file mode 100644 index 0000000..c62def5 Binary files /dev/null and b/images/footer-info-right.png differ diff --git a/images/footer-standard.png b/images/footer-standard.png new file mode 100644 index 0000000..a0adeb2 Binary files /dev/null and b/images/footer-standard.png differ diff --git a/images/header-logo-below.png b/images/header-logo-below.png new file mode 100644 index 0000000..d966ff2 Binary files /dev/null and b/images/header-logo-below.png differ diff --git a/images/header-logo-left.png b/images/header-logo-left.png new file mode 100644 index 0000000..733ede1 Binary files /dev/null and b/images/header-logo-left.png differ diff --git a/images/header-logo-right.png b/images/header-logo-right.png new file mode 100644 index 0000000..0267fe6 Binary files /dev/null and b/images/header-logo-right.png differ diff --git a/images/header-masthead-left.png b/images/header-masthead-left.png new file mode 100644 index 0000000..0d1a61e Binary files /dev/null and b/images/header-masthead-left.png differ diff --git a/images/header-standard.png b/images/header-standard.png new file mode 100644 index 0000000..9318034 Binary files /dev/null and b/images/header-standard.png differ diff --git a/images/help-block-pattern-inserted.jpg b/images/help-block-pattern-inserted.jpg new file mode 100644 index 0000000..86b0c6c Binary files /dev/null and b/images/help-block-pattern-inserted.jpg differ diff --git a/images/help-block-patterns.jpg b/images/help-block-patterns.jpg new file mode 100644 index 0000000..390fa78 Binary files /dev/null and b/images/help-block-patterns.jpg differ diff --git a/images/icon-camera-dark.png b/images/icon-camera-dark.png new file mode 100644 index 0000000..75d253b Binary files /dev/null and b/images/icon-camera-dark.png differ diff --git a/images/icon-camera-light.png b/images/icon-camera-light.png new file mode 100644 index 0000000..87ca293 Binary files /dev/null and b/images/icon-camera-light.png differ diff --git a/images/icon-rocket-dark.png b/images/icon-rocket-dark.png new file mode 100644 index 0000000..c40d812 Binary files /dev/null and b/images/icon-rocket-dark.png differ diff --git a/images/icon-rocket-light.png b/images/icon-rocket-light.png new file mode 100644 index 0000000..86549da Binary files /dev/null and b/images/icon-rocket-light.png differ diff --git a/images/icon-settings-dark.png b/images/icon-settings-dark.png new file mode 100644 index 0000000..7c9efc6 Binary files /dev/null and b/images/icon-settings-dark.png differ diff --git a/images/icon-settings-light.png b/images/icon-settings-light.png new file mode 100644 index 0000000..aa77f92 Binary files /dev/null and b/images/icon-settings-light.png differ diff --git a/images/media-text-image-02.jpg b/images/media-text-image-02.jpg new file mode 100644 index 0000000..81737b1 Binary files /dev/null and b/images/media-text-image-02.jpg differ diff --git a/images/media-text-image-03.jpg b/images/media-text-image-03.jpg new file mode 100644 index 0000000..ec3b482 Binary files /dev/null and b/images/media-text-image-03.jpg differ diff --git a/images/media-text-image-04.jpg b/images/media-text-image-04.jpg new file mode 100644 index 0000000..aad43a4 Binary files /dev/null and b/images/media-text-image-04.jpg differ diff --git a/images/media-text-image.jpg b/images/media-text-image.jpg new file mode 100644 index 0000000..c04a486 Binary files /dev/null and b/images/media-text-image.jpg differ diff --git a/images/square-image-01.jpg b/images/square-image-01.jpg new file mode 100644 index 0000000..a69831c Binary files /dev/null and b/images/square-image-01.jpg differ diff --git a/images/square-image-02.jpg b/images/square-image-02.jpg new file mode 100644 index 0000000..2c5e2b6 Binary files /dev/null and b/images/square-image-02.jpg differ diff --git a/images/up-arrow.svg b/images/up-arrow.svg new file mode 100644 index 0000000..7a97e79 --- /dev/null +++ b/images/up-arrow.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/woocommerce-placeholder.png b/images/woocommerce-placeholder.png new file mode 100644 index 0000000..0518166 Binary files /dev/null and b/images/woocommerce-placeholder.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..fa76a12 --- /dev/null +++ b/index.php @@ -0,0 +1,49 @@ + + + + +
    +
    + + + + + + + + + + + '', + 'next_text' => '', + ) ); ?> + + + + + + + +
    +
    + + + + + + diff --git a/js/custom.js b/js/custom.js new file mode 100644 index 0000000..ad34894 --- /dev/null +++ b/js/custom.js @@ -0,0 +1,252 @@ +/** + * Cordero Custom JS + * + * @package Cordero + * + * Distributed under the MIT license - http://opensource.org/licenses/MIT + */ +jQuery(document).ready(function($){ + // Defining a function to adjust mobile menu and search icons position if we have a large Top Bar widget area + function fullscreen(){ + + if ( $('#wpadminbar').length ) { + var adminbarheight = parseInt( $('#wpadminbar').outerHeight() ); + $('#masthead').css({'top' : adminbarheight + 'px'}); + } + + if ( $('#masthead.transparent').length ) { + var mastheadheight = parseInt( $('#masthead').height() ); + $('article > .entry-content *:not(.wp-block-group,.wp-block-group__inner-container):first').css({'padding-top' : mastheadheight + 'px'}); + } + + var footerheight = parseInt( $('#colophon').height() ); + footerheight = footerheight - 1; + $('#page.sticky-footer').css({'padding-bottom' : footerheight + 'px'}); + + if ( ! $('#primary-menu').length ) { + $('.toggle-nav').css({'display' : 'none'}); + } + + } + + fullscreen(); + + // Run the function in case of window resize + jQuery(window).resize(function() { + fullscreen(); + }); + +}); + +jQuery(function($){ + + function navScroll(){ + var mastheadheight = parseInt( $('#masthead').height() ); + var s = $("#masthead"); + var pos = s.position(); + var windowpos = $(window).scrollTop(); + if (windowpos > pos.top) { + $('#masthead').addClass('scrolled'); + if ( ! $('#masthead.transparent').length ) { + $('#page').css({'padding-top' : mastheadheight + 'px'}); + } + } else { + $('#masthead').removeClass('scrolled'); + if ( ! $('#masthead.transparent').length ) { + $('#page').css({'padding-top' : '0'}); + } + } + } + + function navScrollTs(){ + var s = $("#masthead"); + var pos = s.position(); + var windowpos = $(window).scrollTop(); + if (windowpos > pos.top) { + $('#masthead').addClass('not-fixed-scrolled'); + } else { + $('#masthead').removeClass('not-fixed-scrolled'); + } + } + + if ( ! $('body.masthead-left').length ) { + if ( ! $('#masthead.not-fixed').length ) { + $(window).scroll(function() { + navScroll(); + }); + $(document).ready(function() { + navScroll(); + }); + } else { + if ( $('#masthead.transparent').length ) { + $(window).scroll(function() { + navScrollTs(); + }); + $(document).ready(function() { + navScrollTs(); + }); + } + } + } + + // WooCommerce quantity buttons + jQuery('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').addClass('buttons_added').append('').prepend(''); + + // Target quantity inputs on product pages + jQuery('input.qty:not(.product-quantity input.qty)').each( function() { + var min = parseFloat( jQuery( this ).attr('min') ); + + if ( min && min > 0 && parseFloat( jQuery( this ).val() ) < min ) { + jQuery( this ).val( min ); + } + }); + + jQuery( document ).on('click', '.plus, .minus', function() { + + // Get values + var $qty = jQuery( this ).closest('.quantity').find('.qty'), + currentVal = parseFloat( $qty.val() ), + max = parseFloat( $qty.attr('max') ), + min = parseFloat( $qty.attr('min') ), + step = $qty.attr('step'); + + // Format values + if ( ! currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0; + if ( max === '' || max === 'NaN') max = ''; + if ( min === '' || min === 'NaN') min = 0; + if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN') step = 1; + + // Change the value + if ( jQuery( this ).is('.plus') ) { + + if ( max && ( max == currentVal || currentVal > max ) ) { + $qty.val( max ); + } else { + $qty.val( currentVal + parseFloat( step ) ); + } + + } else { + + if ( min && ( min == currentVal || currentVal < min ) ) { + $qty.val( min ); + } else if ( currentVal > 0 ) { + $qty.val( currentVal - parseFloat( step ) ); + } + + } + + // Trigger change event + $qty.trigger('change'); + }); + + if ( $('.mini-account p.username-wrap').length ) { + $('.mini-account p.username-wrap').html($('.mini-account p.username-wrap').html().replace('(','
    (')); + } + + $( '.top-search .cordero-icon-search' ).on( 'click', function(e) { + $( '.top-search' ).toggleClass( 'search-open' ); + }); + + $( '.top-search .search-close' ).on( 'click', function(e) { + $( '.top-search' ).toggleClass( 'search-open' ); + $( '.top-search .cordero-icon-search' ).focus(); + }); + + $( '.toggle-nav,.toggle-nav-open' ).click( function() { + $( '#site-navigation' ).toggleClass( 'menu-open' ); + $( 'body' ).toggleClass( 'menu-open' ); + }); + + $( '.menu-close' ).click( function() { + $( '#site-navigation' ).toggleClass( 'menu-open' ); + $( 'body' ).toggleClass( 'menu-open' ); + $( '.toggle-nav' ).focus(); + }); + + $( '.site-nav-after' ).click( function() { + $( '#site-navigation' ).toggleClass( 'menu-open' ); + $( 'body' ).toggleClass( 'menu-open' ); + $( '.toggle-nav' ).focus(); + }); + + $( '.menu-close' ).on( 'keydown', function (e) { + var isTabbed = ( e.key === 'Tab' || e.keyCode === 9 ); + if ( !isTabbed ) { + return; + } + if ( e.shiftKey ) { + return; + } else { + $( '.toggle-nav-open' ).focus(); + e.preventDefault(); + } + }); + + $( '.toggle-nav-open' ).on( 'keydown', function (e) { + var isTabbed = ( e.key === 'Tab' || e.keyCode === 9 ); + if ( !isTabbed ) { + return; + } + if ( e.shiftKey ) { + $( '#site-navigation' ).toggleClass( 'menu-open' ); + $( 'body' ).toggleClass( 'menu-open' ); + } else { + return + } + }); + + $( '#site-navigation' ).swipe( { + swipeLeft:function( event, direction ) { + $( '#site-navigation' ).toggleClass( 'menu-open' ); + $( 'body' ).toggleClass( 'menu-open' ); + }, + }); + + $( '.sub-trigger' ).click( function() { + $( this ).toggleClass( 'is-open' ); + $( this ).siblings( '.sub-menu' ).toggle(); + }); + + $( '.shop-filter-wrap .shop-filter-toggle' ).click( function() { + $( '.shop-filter-wrap #shop-filters' ).toggleClass( 'active' ); + $( this ).toggleClass( 'active' ); + }); + + $( '.top-account .mini-account input' ).focusin( function() { + $( '.top-account .mini-account' ).addClass( 'locked' ); + }).add( '.top-account .mini-account' ).focusout( function() { + if ( !$( '.top-account .mini-account' ).is( ':focus' ) ) { + $( '.top-account .mini-account' ).removeClass( 'locked' ); + } + }); + + $( '#primary-menu li.menu-item-has-children' ).focusin( function() { + $( this ).addClass( 'locked' ); + }).add( this ).focusout( function() { + if ( !$( this ).is( ':focus' ) ) { + $( this ).removeClass( 'locked' ); + } + }); + + $( '.top-account #customer_login .u-column2 h2' ).click( function() { + $( '.top-account #customer_login .u-column2' ).toggleClass( 'open' ); + }); + +}); + +jQuery( document ).ready( function( $ ){ + $(document).on( 'added_to_wishlist removed_from_wishlist', function(){ + var counter = $('.wishlist_products_counter_number'); + + $.ajax({ + url: yith_wcwl_l10n.ajax_url, + data: { + action: 'yith_wcwl_update_wishlist_count' + }, + dataType: 'json', + success: function( data ){ + counter.html( data.count ); + } + }) + } ) +}); diff --git a/js/jquery.touchSwipe.js b/js/jquery.touchSwipe.js new file mode 100644 index 0000000..6cee38f --- /dev/null +++ b/js/jquery.touchSwipe.js @@ -0,0 +1,2107 @@ +/*! + * @fileOverview TouchSwipe - jQuery Plugin + * @version 1.6.18 + * + * @author Matt Bryson http://www.github.com/mattbryson + * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin + * @see http://labs.rampinteractive.co.uk/touchSwipe/ + * @see http://plugins.jquery.com/project/touchSwipe + * @license + * Copyright (c) 2010-2015 Matt Bryson + * Dual licensed under the MIT or GPL Version 2 licenses. + * + */ + +/* + * + * Changelog + * $Date: 2010-12-12 (Wed, 12 Dec 2010) $ + * $version: 1.0.0 + * $version: 1.0.1 - removed multibyte comments + * + * $Date: 2011-21-02 (Mon, 21 Feb 2011) $ + * $version: 1.1.0 - added allowPageScroll property to allow swiping and scrolling of page + * - changed handler signatures so one handler can be used for multiple events + * $Date: 2011-23-02 (Wed, 23 Feb 2011) $ + * $version: 1.2.0 - added click handler. This is fired if the user simply clicks and does not swipe. The event object and click target are passed to handler. + * - If you use the http://code.google.com/p/jquery-ui-for-ipad-and-iphone/ plugin, you can also assign jQuery mouse events to children of a touchSwipe object. + * $version: 1.2.1 - removed console log! + * + * $version: 1.2.2 - Fixed bug where scope was not preserved in callback methods. + * + * $Date: 2011-28-04 (Thurs, 28 April 2011) $ + * $version: 1.2.4 - Changed licence terms to be MIT or GPL inline with jQuery. Added check for support of touch events to stop non compatible browsers erroring. + * + * $Date: 2011-27-09 (Tues, 27 September 2011) $ + * $version: 1.2.5 - Added support for testing swipes with mouse on desktop browser (thanks to https://github.com/joelhy) + * + * $Date: 2012-14-05 (Mon, 14 May 2012) $ + * $version: 1.2.6 - Added timeThreshold between start and end touch, so user can ignore slow swipes (thanks to Mark Chase). Default is null, all swipes are detected + * + * $Date: 2012-05-06 (Tues, 05 June 2012) $ + * $version: 1.2.7 - Changed time threshold to have null default for backwards compatibility. Added duration param passed back in events, and refactored how time is handled. + * + * $Date: 2012-05-06 (Tues, 05 June 2012) $ + * $version: 1.2.8 - Added the possibility to return a value like null or false in the trigger callback. In that way we can control when the touch start/move should take effect or not (simply by returning in some cases return null; or return false;) This effects the ontouchstart/ontouchmove event. + * + * $Date: 2012-06-06 (Wed, 06 June 2012) $ + * $version: 1.3.0 - Refactored whole plugin to allow for methods to be executed, as well as exposed defaults for user override. Added 'enable', 'disable', and 'destroy' methods + * + * $Date: 2012-05-06 (Fri, 05 June 2012) $ + * $version: 1.3.1 - Bug fixes - bind() with false as last argument is no longer supported in jQuery 1.6, also, if you just click, the duration is now returned correctly. + * + * $Date: 2012-29-07 (Sun, 29 July 2012) $ + * $version: 1.3.2 - Added fallbackToMouseEvents option to NOT capture mouse events on non touch devices. + * - Added "all" fingers value to the fingers property, so any combination of fingers triggers the swipe, allowing event handlers to check the finger count + * + * $Date: 2012-09-08 (Thurs, 9 Aug 2012) $ + * $version: 1.3.3 - Code tidy prep for minefied version + * + * $Date: 2012-04-10 (wed, 4 Oct 2012) $ + * $version: 1.4.0 - Added pinch support, pinchIn and pinchOut + * + * $Date: 2012-11-10 (Thurs, 11 Oct 2012) $ + * $version: 1.5.0 - Added excludedElements, a jquery selector that specifies child elements that do NOT trigger swipes. By default, this is .noSwipe + * + * $Date: 2012-22-10 (Mon, 22 Oct 2012) $ + * $version: 1.5.1 - Fixed bug with jQuery 1.8 and trailing comma in excludedElements + * - Fixed bug with IE and eventPreventDefault() + * $Date: 2013-01-12 (Fri, 12 Jan 2013) $ + * $version: 1.6.0 - Fixed bugs with pinching, mainly when both pinch and swipe enabled, as well as adding time threshold for multifinger gestures, so releasing one finger beofre the other doesnt trigger as single finger gesture. + * - made the demo site all static local HTML pages so they can be run locally by a developer + * - added jsDoc comments and added documentation for the plugin + * - code tidy + * - added triggerOnTouchLeave property that will end the event when the user swipes off the element. + * $Date: 2013-03-23 (Sat, 23 Mar 2013) $ + * $version: 1.6.1 - Added support for ie8 touch events + * $version: 1.6.2 - Added support for events binding with on / off / bind in jQ for all callback names. + * - Deprecated the 'click' handler in favour of tap. + * - added cancelThreshold property + * - added option method to update init options at runtime + * $version 1.6.3 - added doubletap, longtap events and longTapThreshold, doubleTapThreshold property + * + * $Date: 2013-04-04 (Thurs, 04 April 2013) $ + * $version 1.6.4 - Fixed bug with cancelThreshold introduced in 1.6.3, where swipe status no longer fired start event, and stopped once swiping back. + * + * $Date: 2013-08-24 (Sat, 24 Aug 2013) $ + * $version 1.6.5 - Merged a few pull requests fixing various bugs, added AMD support. + * + * $Date: 2014-06-04 (Wed, 04 June 2014) $ + * $version 1.6.6 - Merge of pull requests. + * - IE10 touch support + * - Only prevent default event handling on valid swipe + * - Separate license/changelog comment + * - Detect if the swipe is valid at the end of the touch event. + * - Pass fingerdata to event handlers. + * - Add 'hold' gesture + * - Be more tolerant about the tap distance + * - Typos and minor fixes + * + * $Date: 2015-22-01 (Thurs, 22 Jan 2015) $ + * $version 1.6.7 - Added patch from https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/206 to fix memory leak + * + * $Date: 2015-2-2 (Mon, 2 Feb 2015) $ + * $version 1.6.8 - Added preventDefaultEvents option to proxy events regardless. + * - Fixed issue with swipe and pinch not triggering at the same time + * + * $Date: 2015-9-6 (Tues, 9 June 2015) $ + * $version 1.6.9 - Added PR from jdalton/hybrid to fix pointer events + * - Added scrolling demo + * - Added version property to plugin + * + * $Date: 2015-1-10 (Wed, 1 October 2015) $ + * $version 1.6.10 - Added PR from beatspace to fix tap events + * $version 1.6.11 - Added PRs from indri-indri ( Doc tidyup), kkirsche ( Bower tidy up ), UziTech (preventDefaultEvents fixes ) + * - Allowed setting multiple options via .swipe("options", options_hash) and more simply .swipe(options_hash) or exisitng instances + * $version 1.6.12 - Fixed bug with multi finger releases above 2 not triggering events + * + * $Date: 2015-12-18 (Fri, 18 December 2015) $ + * $version 1.6.13 - Added PRs + * - Fixed #267 allowPageScroll not working correctly + * $version 1.6.14 - Fixed #220 / #248 doubletap not firing with swipes, #223 commonJS compatible + * $version 1.6.15 - More bug fixes + * + * $Date: 2016-04-29 (Fri, 29 April 2016) $ + * $version 1.6.16 - Swipes with 0 distance now allow default events to trigger. So tapping any form elements or A tags will allow default interaction, but swiping will trigger a swipe. + Removed the a, input, select etc from the excluded Children list as the 0 distance tap solves that issue. +* $Date: 2016-05-19 (Fri, 29 April 2016) $ +* $version 1.6.17 - Fixed context issue when calling instance methods via $("selector").swipe("method"); +* $version 1.6.18 - now honors fallbackToMouseEvents=false for MS Pointer events when a Mouse is used. + */ + +/** + * See (http://jquery.com/). + * @name $ + * @class + * See the jQuery Library (http://jquery.com/) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + */ + +/** + * See (http://jquery.com/) + * @name fn + * @class + * See the jQuery Library (http://jquery.com/) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + * @memberOf $ + */ + + +(function(factory) { + if (typeof define === 'function' && define.amd && define.amd.jQuery) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS Module + factory(require("jquery")); + } else { + // Browser globals. + factory(jQuery); + } +}(function($) { + "use strict"; + + //Constants + var VERSION = "1.6.18", + LEFT = "left", + RIGHT = "right", + UP = "up", + DOWN = "down", + IN = "in", + OUT = "out", + + NONE = "none", + AUTO = "auto", + + SWIPE = "swipe", + PINCH = "pinch", + TAP = "tap", + DOUBLE_TAP = "doubletap", + LONG_TAP = "longtap", + HOLD = "hold", + + HORIZONTAL = "horizontal", + VERTICAL = "vertical", + + ALL_FINGERS = "all", + + DOUBLE_TAP_THRESHOLD = 10, + + PHASE_START = "start", + PHASE_MOVE = "move", + PHASE_END = "end", + PHASE_CANCEL = "cancel", + + SUPPORTS_TOUCH = 'ontouchstart' in window, + + SUPPORTS_POINTER_IE10 = window.navigator.msPointerEnabled && !window.PointerEvent && !SUPPORTS_TOUCH, + + SUPPORTS_POINTER = (window.PointerEvent || window.navigator.msPointerEnabled) && !SUPPORTS_TOUCH, + + PLUGIN_NS = 'TouchSwipe'; + + + + /** + * The default configuration, and available options to configure touch swipe with. + * You can set the default values by updating any of the properties prior to instantiation. + * @name $.fn.swipe.defaults + * @namespace + * @property {int} [fingers=1] The number of fingers to detect in a swipe. Any swipes that do not meet this requirement will NOT trigger swipe handlers. + * @property {int} [threshold=75] The number of pixels that the user must move their finger by before it is considered a swipe. + * @property {int} [cancelThreshold=null] The number of pixels that the user must move their finger back from the original swipe direction to cancel the gesture. + * @property {int} [pinchThreshold=20] The number of pixels that the user must pinch their finger by before it is considered a pinch. + * @property {int} [maxTimeThreshold=null] Time, in milliseconds, between touchStart and touchEnd must NOT exceed in order to be considered a swipe. + * @property {int} [fingerReleaseThreshold=250] Time in milliseconds between releasing multiple fingers. If 2 fingers are down, and are released one after the other, if they are within this threshold, it counts as a simultaneous release. + * @property {int} [longTapThreshold=500] Time in milliseconds between tap and release for a long tap + * @property {int} [doubleTapThreshold=200] Time in milliseconds between 2 taps to count as a double tap + * @property {function} [swipe=null] A handler to catch all swipes. See {@link $.fn.swipe#event:swipe} + * @property {function} [swipeLeft=null] A handler that is triggered for "left" swipes. See {@link $.fn.swipe#event:swipeLeft} + * @property {function} [swipeRight=null] A handler that is triggered for "right" swipes. See {@link $.fn.swipe#event:swipeRight} + * @property {function} [swipeUp=null] A handler that is triggered for "up" swipes. See {@link $.fn.swipe#event:swipeUp} + * @property {function} [swipeDown=null] A handler that is triggered for "down" swipes. See {@link $.fn.swipe#event:swipeDown} + * @property {function} [swipeStatus=null] A handler triggered for every phase of the swipe. See {@link $.fn.swipe#event:swipeStatus} + * @property {function} [pinchIn=null] A handler triggered for pinch in events. See {@link $.fn.swipe#event:pinchIn} + * @property {function} [pinchOut=null] A handler triggered for pinch out events. See {@link $.fn.swipe#event:pinchOut} + * @property {function} [pinchStatus=null] A handler triggered for every phase of a pinch. See {@link $.fn.swipe#event:pinchStatus} + * @property {function} [tap=null] A handler triggered when a user just taps on the item, rather than swipes it. If they do not move, tap is triggered, if they do move, it is not. + * @property {function} [doubleTap=null] A handler triggered when a user double taps on the item. The delay between taps can be set with the doubleTapThreshold property. See {@link $.fn.swipe.defaults#doubleTapThreshold} + * @property {function} [longTap=null] A handler triggered when a user long taps on the item. The delay between start and end can be set with the longTapThreshold property. See {@link $.fn.swipe.defaults#longTapThreshold} + * @property (function) [hold=null] A handler triggered when a user reaches longTapThreshold on the item. See {@link $.fn.swipe.defaults#longTapThreshold} + * @property {boolean} [triggerOnTouchEnd=true] If true, the swipe events are triggered when the touch end event is received (user releases finger). If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically. + * @property {boolean} [triggerOnTouchLeave=false] If true, then when the user leaves the swipe object, the swipe will end and trigger appropriate handlers. + * @property {string|undefined} [allowPageScroll='auto'] How the browser handles page scrolls when the user is swiping on a touchSwipe object. See {@link $.fn.swipe.pageScroll}.

    + "auto" : all undefined swipes will cause the page to scroll in that direction.
    + "none" : the page will not scroll when user swipes.
    + "horizontal" : will force page to scroll on horizontal swipes.
    + "vertical" : will force page to scroll on vertical swipes.
    + * @property {boolean} [fallbackToMouseEvents=true] If true mouse events are used when run on a non touch device, false will stop swipes being triggered by mouse events on non touch devices. + * @property {string} [excludedElements=".noSwipe"] A jquery selector that specifies child elements that do NOT trigger swipes. By default this excludes elements with the class .noSwipe . + * @property {boolean} [preventDefaultEvents=true] by default default events are cancelled, so the page doesn't move. You can disable this so both native events fire as well as your handlers. + */ + var defaults = { + fingers: 1, + threshold: 75, + cancelThreshold: null, + pinchThreshold: 20, + maxTimeThreshold: null, + fingerReleaseThreshold: 250, + longTapThreshold: 500, + doubleTapThreshold: 200, + swipe: null, + swipeLeft: null, + swipeRight: null, + swipeUp: null, + swipeDown: null, + swipeStatus: null, + pinchIn: null, + pinchOut: null, + pinchStatus: null, + click: null, //Deprecated since 1.6.2 + tap: null, + doubleTap: null, + longTap: null, + hold: null, + triggerOnTouchEnd: true, + triggerOnTouchLeave: false, + allowPageScroll: "auto", + fallbackToMouseEvents: true, + excludedElements: ".noSwipe", + preventDefaultEvents: true + }; + + + + /** + * Applies TouchSwipe behaviour to one or more jQuery objects. + * The TouchSwipe plugin can be instantiated via this method, or methods within + * TouchSwipe can be executed via this method as per jQuery plugin architecture. + * An existing plugin can have its options changed simply by re calling .swipe(options) + * @see TouchSwipe + * @class + * @param {Mixed} method If the current DOMNode is a TouchSwipe object, and method is a TouchSwipe method, then + * the method is executed, and any following arguments are passed to the TouchSwipe method. + * If method is an object, then the TouchSwipe class is instantiated on the current DOMNode, passing the + * configuration properties defined in the object. See TouchSwipe + * + */ + $.fn.swipe = function(method) { + var $this = $(this), + plugin = $this.data(PLUGIN_NS); + + //Check if we are already instantiated and trying to execute a method + if (plugin && typeof method === 'string') { + if (plugin[method]) { + return plugin[method].apply(plugin, Array.prototype.slice.call(arguments, 1)); + } else { + $.error('Method ' + method + ' does not exist on jQuery.swipe'); + } + } + + //Else update existing plugin with new options hash + else if (plugin && typeof method === 'object') { + plugin['option'].apply(plugin, arguments); + } + + //Else not instantiated and trying to pass init object (or nothing) + else if (!plugin && (typeof method === 'object' || !method)) { + return init.apply(this, arguments); + } + + return $this; + }; + + /** + * The version of the plugin + * @readonly + */ + $.fn.swipe.version = VERSION; + + + + //Expose our defaults so a user could override the plugin defaults + $.fn.swipe.defaults = defaults; + + /** + * The phases that a touch event goes through. The phase is passed to the event handlers. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @property {string} PHASE_START Constant indicating the start phase of the touch event. Value is "start". + * @property {string} PHASE_MOVE Constant indicating the move phase of the touch event. Value is "move". + * @property {string} PHASE_END Constant indicating the end phase of the touch event. Value is "end". + * @property {string} PHASE_CANCEL Constant indicating the cancel phase of the touch event. Value is "cancel". + */ + $.fn.swipe.phases = { + PHASE_START: PHASE_START, + PHASE_MOVE: PHASE_MOVE, + PHASE_END: PHASE_END, + PHASE_CANCEL: PHASE_CANCEL + }; + + /** + * The direction constants that are passed to the event handlers. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @property {string} LEFT Constant indicating the left direction. Value is "left". + * @property {string} RIGHT Constant indicating the right direction. Value is "right". + * @property {string} UP Constant indicating the up direction. Value is "up". + * @property {string} DOWN Constant indicating the down direction. Value is "cancel". + * @property {string} IN Constant indicating the in direction. Value is "in". + * @property {string} OUT Constant indicating the out direction. Value is "out". + */ + $.fn.swipe.directions = { + LEFT: LEFT, + RIGHT: RIGHT, + UP: UP, + DOWN: DOWN, + IN: IN, + OUT: OUT + }; + + /** + * The page scroll constants that can be used to set the value of allowPageScroll option + * These properties are read only + * @namespace + * @readonly + * @see $.fn.swipe.defaults#allowPageScroll + * @property {string} NONE Constant indicating no page scrolling is allowed. Value is "none". + * @property {string} HORIZONTAL Constant indicating horizontal page scrolling is allowed. Value is "horizontal". + * @property {string} VERTICAL Constant indicating vertical page scrolling is allowed. Value is "vertical". + * @property {string} AUTO Constant indicating either horizontal or vertical will be allowed, depending on the swipe handlers registered. Value is "auto". + */ + $.fn.swipe.pageScroll = { + NONE: NONE, + HORIZONTAL: HORIZONTAL, + VERTICAL: VERTICAL, + AUTO: AUTO + }; + + /** + * Constants representing the number of fingers used in a swipe. These are used to set both the value of fingers in the + * options object, as well as the value of the fingers event property. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @see $.fn.swipe.defaults#fingers + * @property {string} ONE Constant indicating 1 finger is to be detected / was detected. Value is 1. + * @property {string} TWO Constant indicating 2 fingers are to be detected / were detected. Value is 2. + * @property {string} THREE Constant indicating 3 finger are to be detected / were detected. Value is 3. + * @property {string} FOUR Constant indicating 4 finger are to be detected / were detected. Not all devices support this. Value is 4. + * @property {string} FIVE Constant indicating 5 finger are to be detected / were detected. Not all devices support this. Value is 5. + * @property {string} ALL Constant indicating any combination of finger are to be detected. Value is "all". + */ + $.fn.swipe.fingers = { + ONE: 1, + TWO: 2, + THREE: 3, + FOUR: 4, + FIVE: 5, + ALL: ALL_FINGERS + }; + + /** + * Initialise the plugin for each DOM element matched + * This creates a new instance of the main TouchSwipe class for each DOM element, and then + * saves a reference to that instance in the elements data property. + * @internal + */ + function init(options) { + //Prep and extend the options + if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) { + options.allowPageScroll = NONE; + } + + //Check for deprecated options + //Ensure that any old click handlers are assigned to the new tap, unless we have a tap + if (options.click !== undefined && options.tap === undefined) { + options.tap = options.click; + } + + if (!options) { + options = {}; + } + + //pass empty object so we dont modify the defaults + options = $.extend({}, $.fn.swipe.defaults, options); + + //For each element instantiate the plugin + return this.each(function() { + var $this = $(this); + + //Check we havent already initialised the plugin + var plugin = $this.data(PLUGIN_NS); + + if (!plugin) { + plugin = new TouchSwipe(this, options); + $this.data(PLUGIN_NS, plugin); + } + }); + } + + /** + * Main TouchSwipe Plugin Class. + * Do not use this to construct your TouchSwipe object, use the jQuery plugin method $.fn.swipe(); {@link $.fn.swipe} + * @private + * @name TouchSwipe + * @param {DOMNode} element The HTML DOM object to apply to plugin to + * @param {Object} options The options to configure the plugin with. @link {$.fn.swipe.defaults} + * @see $.fh.swipe.defaults + * @see $.fh.swipe + * @class + */ + function TouchSwipe(element, options) { + + //take a local/instacne level copy of the options - should make it this.options really... + var options = $.extend({}, options); + + var useTouchEvents = (SUPPORTS_TOUCH || SUPPORTS_POINTER || !options.fallbackToMouseEvents), + START_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerDown' : 'pointerdown') : 'touchstart') : 'mousedown', + MOVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerMove' : 'pointermove') : 'touchmove') : 'mousemove', + END_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerUp' : 'pointerup') : 'touchend') : 'mouseup', + LEAVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? 'mouseleave' : null) : 'mouseleave', //we manually detect leave on touch devices, so null event here + CANCEL_EV = (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerCancel' : 'pointercancel') : 'touchcancel'); + + + + //touch properties + var distance = 0, + direction = null, + currentDirection = null, + duration = 0, + startTouchesDistance = 0, + endTouchesDistance = 0, + pinchZoom = 1, + pinchDistance = 0, + pinchDirection = 0, + maximumsMap = null; + + + + //jQuery wrapped element for this instance + var $element = $(element); + + //Current phase of th touch cycle + var phase = "start"; + + // the current number of fingers being used. + var fingerCount = 0; + + //track mouse points / delta + var fingerData = {}; + + //track times + var startTime = 0, + endTime = 0, + previousTouchEndTime = 0, + fingerCountAtRelease = 0, + doubleTapStartTime = 0; + + //Timeouts + var singleTapTimeout = null, + holdTimeout = null; + + // Add gestures to all swipable areas if supported + try { + $element.on(START_EV, touchStart); + $element.on(CANCEL_EV, touchCancel); + } catch (e) { + $.error('events not supported ' + START_EV + ',' + CANCEL_EV + ' on jQuery.swipe'); + } + + // + //Public methods + // + + /** + * re-enables the swipe plugin with the previous configuration + * @function + * @name $.fn.swipe#enable + * @return {DOMNode} The Dom element that was registered with TouchSwipe + * @example $("#element").swipe("enable"); + */ + this.enable = function() { + //Incase we are already enabled, clean up... + this.disable(); + $element.on(START_EV, touchStart); + $element.on(CANCEL_EV, touchCancel); + return $element; + }; + + /** + * disables the swipe plugin + * @function + * @name $.fn.swipe#disable + * @return {DOMNode} The Dom element that is now registered with TouchSwipe + * @example $("#element").swipe("disable"); + */ + this.disable = function() { + removeListeners(); + return $element; + }; + + /** + * Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin. + * @function + * @name $.fn.swipe#destroy + * @example $("#element").swipe("destroy"); + */ + this.destroy = function() { + removeListeners(); + $element.data(PLUGIN_NS, null); + $element = null; + }; + + + /** + * Allows run time updating of the swipe configuration options. + * @function + * @name $.fn.swipe#option + * @param {String} property The option property to get or set, or a has of multiple options to set + * @param {Object} [value] The value to set the property to + * @return {Object} If only a property name is passed, then that property value is returned. If nothing is passed the current options hash is returned. + * @example $("#element").swipe("option", "threshold"); // return the threshold + * @example $("#element").swipe("option", "threshold", 100); // set the threshold after init + * @example $("#element").swipe("option", {threshold:100, fingers:3} ); // set multiple properties after init + * @example $("#element").swipe({threshold:100, fingers:3} ); // set multiple properties after init - the "option" method is optional! + * @example $("#element").swipe("option"); // Return the current options hash + * @see $.fn.swipe.defaults + * + */ + this.option = function(property, value) { + + if (typeof property === 'object') { + options = $.extend(options, property); + } else if (options[property] !== undefined) { + if (value === undefined) { + return options[property]; + } else { + options[property] = value; + } + } else if (!property) { + return options; + } else { + $.error('Option ' + property + ' does not exist on jQuery.swipe.options'); + } + + return null; + } + + + + // + // Private methods + // + + // + // EVENTS + // + /** + * Event handler for a touch start event. + * Stops the default click event from triggering and stores where we touched + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchStart(jqEvent) { + + //If we already in a touch event (a finger already in use) then ignore subsequent ones.. + if (getTouchInProgress()) { + return; + } + + //Check if this element matches any in the excluded elements selectors, or its parent is excluded, if so, DON'T swipe + if ($(jqEvent.target).closest(options.excludedElements, $element).length > 0) { + return; + } + + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + + //If we have a pointer event, whoes type is 'mouse' and we have said NO mouse events, then dont do anything. + if(event.pointerType && event.pointerType=="mouse" && options.fallbackToMouseEvents==false) { + return; + }; + + var ret, + touches = event.touches, + evt = touches ? touches[0] : event; + + phase = PHASE_START; + + //If we support touches, get the finger count + if (touches) { + // get the total number of fingers touching the screen + fingerCount = touches.length; + } + //Else this is the desktop, so stop the browser from dragging content + else if (options.preventDefaultEvents !== false) { + jqEvent.preventDefault(); //call this on jq event so we are cross browser + } + + //clear vars.. + distance = 0; + direction = null; + currentDirection=null; + pinchDirection = null; + duration = 0; + startTouchesDistance = 0; + endTouchesDistance = 0; + pinchZoom = 1; + pinchDistance = 0; + maximumsMap = createMaximumsData(); + cancelMultiFingerRelease(); + + //Create the default finger data + createFingerData(0, evt); + + // check the number of fingers is what we are looking for, or we are capturing pinches + if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) { + // get the coordinates of the touch + startTime = getTimeStamp(); + + if (fingerCount == 2) { + //Keep track of the initial pinch distance, so we can calculate the diff later + //Store second finger data as start + createFingerData(1, touches[1]); + startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); + } + + if (options.swipeStatus || options.pinchStatus) { + ret = triggerHandler(event, phase); + } + } else { + //A touch with more or less than the fingers we are looking for, so cancel + ret = false; + } + + //If we have a return value from the users handler, then return and cancel + if (ret === false) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + return ret; + } else { + if (options.hold) { + holdTimeout = setTimeout($.proxy(function() { + //Trigger the event + $element.trigger('hold', [event.target]); + //Fire the callback + if (options.hold) { + ret = options.hold.call($element, event, event.target); + } + }, this), options.longTapThreshold); + } + + setTouchInProgress(true); + } + + return null; + }; + + + + /** + * Event handler for a touch move event. + * If we change fingers during move, then cancel the event + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchMove(jqEvent) { + + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + //If we are ending, cancelling, or within the threshold of 2 fingers being released, don't track anything.. + if (phase === PHASE_END || phase === PHASE_CANCEL || inMultiFingerRelease()) + return; + + var ret, + touches = event.touches, + evt = touches ? touches[0] : event; + + + //Update the finger data + var currentFinger = updateFingerData(evt); + endTime = getTimeStamp(); + + if (touches) { + fingerCount = touches.length; + } + + if (options.hold) { + clearTimeout(holdTimeout); + } + + phase = PHASE_MOVE; + + //If we have 2 fingers get Touches distance as well + if (fingerCount == 2) { + + //Keep track of the initial pinch distance, so we can calculate the diff later + //We do this here as well as the start event, in case they start with 1 finger, and the press 2 fingers + if (startTouchesDistance == 0) { + //Create second finger if this is the first time... + createFingerData(1, touches[1]); + + startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); + } else { + //Else just update the second finger + updateFingerData(touches[1]); + + endTouchesDistance = calculateTouchesDistance(fingerData[0].end, fingerData[1].end); + pinchDirection = calculatePinchDirection(fingerData[0].end, fingerData[1].end); + } + + pinchZoom = calculatePinchZoom(startTouchesDistance, endTouchesDistance); + pinchDistance = Math.abs(startTouchesDistance - endTouchesDistance); + } + + if ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !touches || hasPinches()) { + + //The overall direction of the swipe. From start to now. + direction = calculateDirection(currentFinger.start, currentFinger.end); + + //The immediate direction of the swipe, direction between the last movement and this one. + currentDirection = calculateDirection(currentFinger.last, currentFinger.end); + + //Check if we need to prevent default event (page scroll / pinch zoom) or not + validateDefaultEvent(jqEvent, currentDirection); + + //Distance and duration are all off the main finger + distance = calculateDistance(currentFinger.start, currentFinger.end); + duration = calculateDuration(); + + //Cache the maximum distance we made in this direction + setMaxDistance(direction, distance); + + //Trigger status handler + ret = triggerHandler(event, phase); + + + //If we trigger end events when threshold are met, or trigger events when touch leaves element + if (!options.triggerOnTouchEnd || options.triggerOnTouchLeave) { + + var inBounds = true; + + //If checking if we leave the element, run the bounds check (we can use touchleave as its not supported on webkit) + if (options.triggerOnTouchLeave) { + var bounds = getbounds(this); + inBounds = isInBounds(currentFinger.end, bounds); + } + + //Trigger end handles as we swipe if thresholds met or if we have left the element if the user has asked to check these.. + if (!options.triggerOnTouchEnd && inBounds) { + phase = getNextPhase(PHASE_MOVE); + } + //We end if out of bounds here, so set current phase to END, and check if its modified + else if (options.triggerOnTouchLeave && !inBounds) { + phase = getNextPhase(PHASE_END); + } + + if (phase == PHASE_CANCEL || phase == PHASE_END) { + triggerHandler(event, phase); + } + } + } else { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + + if (ret === false) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + } + + + + + /** + * Event handler for a touch end event. + * Calculate the direction and trigger events + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchEnd(jqEvent) { + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent, + touches = event.touches; + + //If we are still in a touch with the device wait a fraction and see if the other finger comes up + //if it does within the threshold, then we treat it as a multi release, not a single release and end the touch / swipe + if (touches) { + if (touches.length && !inMultiFingerRelease()) { + startMultiFingerRelease(event); + return true; + } else if (touches.length && inMultiFingerRelease()) { + return true; + } + } + + //If a previous finger has been released, check how long ago, if within the threshold, then assume it was a multifinger release. + //This is used to allow 2 fingers to release fractionally after each other, whilst maintaining the event as containing 2 fingers, not 1 + if (inMultiFingerRelease()) { + fingerCount = fingerCountAtRelease; + } + + //Set end of swipe + endTime = getTimeStamp(); + + //Get duration incase move was never fired + duration = calculateDuration(); + + //If we trigger handlers at end of swipe OR, we trigger during, but they didnt trigger and we are still in the move phase + if (didSwipeBackToCancel() || !validateSwipeDistance()) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } else if (options.triggerOnTouchEnd || (options.triggerOnTouchEnd === false && phase === PHASE_MOVE)) { + //call this on jq event so we are cross browser + if (options.preventDefaultEvents !== false && jqEvent.cancelable !== false) { + jqEvent.preventDefault(); + } + phase = PHASE_END; + triggerHandler(event, phase); + } + //Special cases - A tap should always fire on touch end regardless, + //So here we manually trigger the tap end handler by itself + //We dont run trigger handler as it will re-trigger events that may have fired already + else if (!options.triggerOnTouchEnd && hasTap()) { + //Trigger the pinch events... + phase = PHASE_END; + triggerHandlerForGesture(event, phase, TAP); + } else if (phase === PHASE_MOVE) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + + setTouchInProgress(false); + + return null; + } + + + + /** + * Event handler for a touch cancel event. + * Clears current vars + * @inner + */ + function touchCancel() { + // reset the variables back to default values + fingerCount = 0; + endTime = 0; + startTime = 0; + startTouchesDistance = 0; + endTouchesDistance = 0; + pinchZoom = 1; + + //If we were in progress of tracking a possible multi touch end, then re set it. + cancelMultiFingerRelease(); + + setTouchInProgress(false); + } + + + /** + * Event handler for a touch leave event. + * This is only triggered on desktops, in touch we work this out manually + * as the touchleave event is not supported in webkit + * @inner + */ + function touchLeave(jqEvent) { + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + //If we have the trigger on leave property set.... + if (options.triggerOnTouchLeave) { + phase = getNextPhase(PHASE_END); + triggerHandler(event, phase); + } + } + + /** + * Removes all listeners that were associated with the plugin + * @inner + */ + function removeListeners() { + $element.off(START_EV, touchStart); + $element.off(CANCEL_EV, touchCancel); + $element.off(MOVE_EV, touchMove); + $element.off(END_EV, touchEnd); + + //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.off(LEAVE_EV, touchLeave); + } + + setTouchInProgress(false); + } + + + /** + * Checks if the time and distance thresholds have been met, and if so then the appropriate handlers are fired. + */ + function getNextPhase(currentPhase) { + + var nextPhase = currentPhase; + + // Ensure we have valid swipe (under time and over distance and check if we are out of bound...) + var validTime = validateSwipeTime(); + var validDistance = validateSwipeDistance(); + var didCancel = didSwipeBackToCancel(); + + //If we have exceeded our time, then cancel + if (!validTime || didCancel) { + nextPhase = PHASE_CANCEL; + } + //Else if we are moving, and have reached distance then end + else if (validDistance && currentPhase == PHASE_MOVE && (!options.triggerOnTouchEnd || options.triggerOnTouchLeave)) { + nextPhase = PHASE_END; + } + //Else if we have ended by leaving and didn't reach distance, then cancel + else if (!validDistance && currentPhase == PHASE_END && options.triggerOnTouchLeave) { + nextPhase = PHASE_CANCEL; + } + + return nextPhase; + } + + + /** + * Trigger the relevant event handler + * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" + * @param {object} event the original event object + * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} + * @inner + */ + function triggerHandler(event, phase) { + + + + var ret, + touches = event.touches; + + // SWIPE GESTURES + if (didSwipe() || hasSwipes()) { + ret = triggerHandlerForGesture(event, phase, SWIPE); + } + + // PINCH GESTURES (if the above didn't cancel) + if ((didPinch() || hasPinches()) && ret !== false) { + ret = triggerHandlerForGesture(event, phase, PINCH); + } + + // CLICK / TAP (if the above didn't cancel) + if (didDoubleTap() && ret !== false) { + //Trigger the tap events... + ret = triggerHandlerForGesture(event, phase, DOUBLE_TAP); + } + + // CLICK / TAP (if the above didn't cancel) + else if (didLongTap() && ret !== false) { + //Trigger the tap events... + ret = triggerHandlerForGesture(event, phase, LONG_TAP); + } + + // CLICK / TAP (if the above didn't cancel) + else if (didTap() && ret !== false) { + //Trigger the tap event.. + ret = triggerHandlerForGesture(event, phase, TAP); + } + + + + // If we are cancelling the gesture, then manually trigger the reset handler + if (phase === PHASE_CANCEL) { + + touchCancel(event); + } + + + + + // If we are ending the gesture, then manually trigger the reset handler IF all fingers are off + if (phase === PHASE_END) { + //If we support touch, then check that all fingers are off before we cancel + if (touches) { + if (!touches.length) { + touchCancel(event); + } + } else { + touchCancel(event); + } + } + + return ret; + } + + + + /** + * Trigger the relevant event handler + * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" + * @param {object} event the original event object + * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} + * @param {string} gesture the gesture to trigger a handler for : PINCH or SWIPE {@link $.fn.swipe.gestures} + * @return Boolean False, to indicate that the event should stop propagation, or void. + * @inner + */ + function triggerHandlerForGesture(event, phase, gesture) { + + var ret; + + //SWIPES.... + if (gesture == SWIPE) { + //Trigger status every time.. + $element.trigger('swipeStatus', [phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection]); + + if (options.swipeStatus) { + ret = options.swipeStatus.call($element, event, phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + if (phase == PHASE_END && validateSwipe()) { + + //Cancel any taps that were in progress... + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + + $element.trigger('swipe', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipe) { + ret = options.swipe.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + //trigger direction specific event handlers + switch (direction) { + case LEFT: + $element.trigger('swipeLeft', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeLeft) { + ret = options.swipeLeft.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case RIGHT: + $element.trigger('swipeRight', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeRight) { + ret = options.swipeRight.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case UP: + $element.trigger('swipeUp', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeUp) { + ret = options.swipeUp.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case DOWN: + $element.trigger('swipeDown', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeDown) { + ret = options.swipeDown.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + } + } + } + + + //PINCHES.... + if (gesture == PINCH) { + $element.trigger('pinchStatus', [phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchStatus) { + ret = options.pinchStatus.call($element, event, phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + if (phase == PHASE_END && validatePinch()) { + + switch (pinchDirection) { + case IN: + $element.trigger('pinchIn', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchIn) { + ret = options.pinchIn.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + } + break; + + case OUT: + $element.trigger('pinchOut', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchOut) { + ret = options.pinchOut.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + } + break; + } + } + } + + if (gesture == TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + + //If we are also looking for doubelTaps, wait incase this is one... + if (hasDoubleTap() && !inDoubleTap()) { + doubleTapStartTime = getTimeStamp(); + + //Now wait for the double tap timeout, and trigger this single tap + //if its not cancelled by a double tap + singleTapTimeout = setTimeout($.proxy(function() { + doubleTapStartTime = null; + $element.trigger('tap', [event.target]); + + if (options.tap) { + ret = options.tap.call($element, event, event.target); + } + }, this), options.doubleTapThreshold); + + } else { + doubleTapStartTime = null; + $element.trigger('tap', [event.target]); + if (options.tap) { + ret = options.tap.call($element, event, event.target); + } + } + } + } else if (gesture == DOUBLE_TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + doubleTapStartTime = null; + $element.trigger('doubletap', [event.target]); + + if (options.doubleTap) { + ret = options.doubleTap.call($element, event, event.target); + } + } + } else if (gesture == LONG_TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + clearTimeout(singleTapTimeout); + doubleTapStartTime = null; + + $element.trigger('longtap', [event.target]); + if (options.longTap) { + ret = options.longTap.call($element, event, event.target); + } + } + } + + return ret; + } + + + // + // GESTURE VALIDATION + // + + /** + * Checks the user has swipe far enough + * @return Boolean if threshold has been set, return true if the threshold was met, else false. + * If no threshold was set, then we return true. + * @inner + */ + function validateSwipeDistance() { + var valid = true; + //If we made it past the min swipe distance.. + if (options.threshold !== null) { + valid = distance >= options.threshold; + } + + return valid; + } + + /** + * Checks the user has swiped back to cancel. + * @return Boolean if cancelThreshold has been set, return true if the cancelThreshold was met, else false. + * If no cancelThreshold was set, then we return true. + * @inner + */ + function didSwipeBackToCancel() { + var cancelled = false; + if (options.cancelThreshold !== null && direction !== null) { + cancelled = (getMaxDistance(direction) - distance) >= options.cancelThreshold; + } + + return cancelled; + } + + /** + * Checks the user has pinched far enough + * @return Boolean if pinchThreshold has been set, return true if the threshold was met, else false. + * If no threshold was set, then we return true. + * @inner + */ + function validatePinchDistance() { + if (options.pinchThreshold !== null) { + return pinchDistance >= options.pinchThreshold; + } + return true; + } + + /** + * Checks that the time taken to swipe meets the minimum / maximum requirements + * @return Boolean + * @inner + */ + function validateSwipeTime() { + var result; + //If no time set, then return true + if (options.maxTimeThreshold) { + if (duration >= options.maxTimeThreshold) { + result = false; + } else { + result = true; + } + } else { + result = true; + } + + return result; + } + + + /** + * Checks direction of the swipe and the value allowPageScroll to see if we should allow or prevent the default behaviour from occurring. + * This will essentially allow page scrolling or not when the user is swiping on a touchSwipe object. + * @param {object} jqEvent The normalised jQuery representation of the event object. + * @param {string} direction The direction of the event. See {@link $.fn.swipe.directions} + * @see $.fn.swipe.directions + * @inner + */ + function validateDefaultEvent(jqEvent, direction) { + + //If the option is set, allways allow the event to bubble up (let user handle weirdness) + if (options.preventDefaultEvents === false) { + return; + } + + if (options.allowPageScroll === NONE) { + jqEvent.preventDefault(); + } else { + var auto = options.allowPageScroll === AUTO; + + switch (direction) { + case LEFT: + if ((options.swipeLeft && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { + jqEvent.preventDefault(); + } + break; + + case RIGHT: + if ((options.swipeRight && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { + jqEvent.preventDefault(); + } + break; + + case UP: + if ((options.swipeUp && auto) || (!auto && options.allowPageScroll != VERTICAL)) { + jqEvent.preventDefault(); + } + break; + + case DOWN: + if ((options.swipeDown && auto) || (!auto && options.allowPageScroll != VERTICAL)) { + jqEvent.preventDefault(); + } + break; + + case NONE: + + break; + } + } + } + + + // PINCHES + /** + * Returns true of the current pinch meets the thresholds + * @return Boolean + * @inner + */ + function validatePinch() { + var hasCorrectFingerCount = validateFingers(); + var hasEndPoint = validateEndPoint(); + var hasCorrectDistance = validatePinchDistance(); + return hasCorrectFingerCount && hasEndPoint && hasCorrectDistance; + + } + + /** + * Returns true if any Pinch events have been registered + * @return Boolean + * @inner + */ + function hasPinches() { + //Enure we dont return 0 or null for false values + return !!(options.pinchStatus || options.pinchIn || options.pinchOut); + } + + /** + * Returns true if we are detecting pinches, and have one + * @return Boolean + * @inner + */ + function didPinch() { + //Enure we dont return 0 or null for false values + return !!(validatePinch() && hasPinches()); + } + + + + + // SWIPES + /** + * Returns true if the current swipe meets the thresholds + * @return Boolean + * @inner + */ + function validateSwipe() { + //Check validity of swipe + var hasValidTime = validateSwipeTime(); + var hasValidDistance = validateSwipeDistance(); + var hasCorrectFingerCount = validateFingers(); + var hasEndPoint = validateEndPoint(); + var didCancel = didSwipeBackToCancel(); + + // if the user swiped more than the minimum length, perform the appropriate action + // hasValidDistance is null when no distance is set + var valid = !didCancel && hasEndPoint && hasCorrectFingerCount && hasValidDistance && hasValidTime; + + return valid; + } + + /** + * Returns true if any Swipe events have been registered + * @return Boolean + * @inner + */ + function hasSwipes() { + //Enure we dont return 0 or null for false values + return !!(options.swipe || options.swipeStatus || options.swipeLeft || options.swipeRight || options.swipeUp || options.swipeDown); + } + + + /** + * Returns true if we are detecting swipes and have one + * @return Boolean + * @inner + */ + function didSwipe() { + //Enure we dont return 0 or null for false values + return !!(validateSwipe() && hasSwipes()); + } + + /** + * Returns true if we have matched the number of fingers we are looking for + * @return Boolean + * @inner + */ + function validateFingers() { + //The number of fingers we want were matched, or on desktop we ignore + return ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !SUPPORTS_TOUCH); + } + + /** + * Returns true if we have an end point for the swipe + * @return Boolean + * @inner + */ + function validateEndPoint() { + //We have an end value for the finger + return fingerData[0].end.x !== 0; + } + + // TAP / CLICK + /** + * Returns true if a click / tap events have been registered + * @return Boolean + * @inner + */ + function hasTap() { + //Enure we dont return 0 or null for false values + return !!(options.tap); + } + + /** + * Returns true if a double tap events have been registered + * @return Boolean + * @inner + */ + function hasDoubleTap() { + //Enure we dont return 0 or null for false values + return !!(options.doubleTap); + } + + /** + * Returns true if any long tap events have been registered + * @return Boolean + * @inner + */ + function hasLongTap() { + //Enure we dont return 0 or null for false values + return !!(options.longTap); + } + + /** + * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. + * @return Boolean + * @inner + */ + function validateDoubleTap() { + if (doubleTapStartTime == null) { + return false; + } + var now = getTimeStamp(); + return (hasDoubleTap() && ((now - doubleTapStartTime) <= options.doubleTapThreshold)); + } + + /** + * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. + * @return Boolean + * @inner + */ + function inDoubleTap() { + return validateDoubleTap(); + } + + + /** + * Returns true if we have a valid tap + * @return Boolean + * @inner + */ + function validateTap() { + return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold)); + } + + /** + * Returns true if we have a valid long tap + * @return Boolean + * @inner + */ + function validateLongTap() { + //slight threshold on moving finger + return ((duration > options.longTapThreshold) && (distance < DOUBLE_TAP_THRESHOLD)); + } + + /** + * Returns true if we are detecting taps and have one + * @return Boolean + * @inner + */ + function didTap() { + //Enure we dont return 0 or null for false values + return !!(validateTap() && hasTap()); + } + + + /** + * Returns true if we are detecting double taps and have one + * @return Boolean + * @inner + */ + function didDoubleTap() { + //Enure we dont return 0 or null for false values + return !!(validateDoubleTap() && hasDoubleTap()); + } + + /** + * Returns true if we are detecting long taps and have one + * @return Boolean + * @inner + */ + function didLongTap() { + //Enure we dont return 0 or null for false values + return !!(validateLongTap() && hasLongTap()); + } + + + + + // MULTI FINGER TOUCH + /** + * Starts tracking the time between 2 finger releases, and keeps track of how many fingers we initially had up + * @inner + */ + function startMultiFingerRelease(event) { + previousTouchEndTime = getTimeStamp(); + fingerCountAtRelease = event.touches.length + 1; + } + + /** + * Cancels the tracking of time between 2 finger releases, and resets counters + * @inner + */ + function cancelMultiFingerRelease() { + previousTouchEndTime = 0; + fingerCountAtRelease = 0; + } + + /** + * Checks if we are in the threshold between 2 fingers being released + * @return Boolean + * @inner + */ + function inMultiFingerRelease() { + + var withinThreshold = false; + + if (previousTouchEndTime) { + var diff = getTimeStamp() - previousTouchEndTime + if (diff <= options.fingerReleaseThreshold) { + withinThreshold = true; + } + } + + return withinThreshold; + } + + + /** + * gets a data flag to indicate that a touch is in progress + * @return Boolean + * @inner + */ + function getTouchInProgress() { + //strict equality to ensure only true and false are returned + return !!($element.data(PLUGIN_NS + '_intouch') === true); + } + + /** + * Sets a data flag to indicate that a touch is in progress + * @param {boolean} val The value to set the property to + * @inner + */ + function setTouchInProgress(val) { + + //If destroy is called in an event handler, we have no el, and we have already cleaned up, so return. + if(!$element) { return; } + + //Add or remove event listeners depending on touch status + if (val === true) { + $element.on(MOVE_EV, touchMove); + $element.on(END_EV, touchEnd); + + //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.on(LEAVE_EV, touchLeave); + } + } else { + + $element.off(MOVE_EV, touchMove, false); + $element.off(END_EV, touchEnd, false); + + //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.off(LEAVE_EV, touchLeave, false); + } + } + + + //strict equality to ensure only true and false can update the value + $element.data(PLUGIN_NS + '_intouch', val === true); + } + + + /** + * Creates the finger data for the touch/finger in the event object. + * @param {int} id The id to store the finger data under (usually the order the fingers were pressed) + * @param {object} evt The event object containing finger data + * @return finger data object + * @inner + */ + function createFingerData(id, evt) { + var f = { + start: { + x: 0, + y: 0 + }, + last: { + x: 0, + y: 0 + }, + end: { + x: 0, + y: 0 + } + }; + f.start.x = f.last.x = f.end.x = evt.pageX || evt.clientX; + f.start.y = f.last.y = f.end.y = evt.pageY || evt.clientY; + fingerData[id] = f; + return f; + } + + /** + * Updates the finger data for a particular event object + * @param {object} evt The event object containing the touch/finger data to upadte + * @return a finger data object. + * @inner + */ + function updateFingerData(evt) { + var id = evt.identifier !== undefined ? evt.identifier : 0; + var f = getFingerData(id); + + if (f === null) { + f = createFingerData(id, evt); + } + + f.last.x = f.end.x; + f.last.y = f.end.y; + + f.end.x = evt.pageX || evt.clientX; + f.end.y = evt.pageY || evt.clientY; + + return f; + } + + /** + * Returns a finger data object by its event ID. + * Each touch event has an identifier property, which is used + * to track repeat touches + * @param {int} id The unique id of the finger in the sequence of touch events. + * @return a finger data object. + * @inner + */ + function getFingerData(id) { + return fingerData[id] || null; + } + + + /** + * Sets the maximum distance swiped in the given direction. + * If the new value is lower than the current value, the max value is not changed. + * @param {string} direction The direction of the swipe + * @param {int} distance The distance of the swipe + * @inner + */ + function setMaxDistance(direction, distance) { + if(direction==NONE) return; + distance = Math.max(distance, getMaxDistance(direction)); + maximumsMap[direction].distance = distance; + } + + /** + * gets the maximum distance swiped in the given direction. + * @param {string} direction The direction of the swipe + * @return int The distance of the swipe + * @inner + */ + function getMaxDistance(direction) { + if (maximumsMap[direction]) return maximumsMap[direction].distance; + return undefined; + } + + /** + * Creats a map of directions to maximum swiped values. + * @return Object A dictionary of maximum values, indexed by direction. + * @inner + */ + function createMaximumsData() { + var maxData = {}; + maxData[LEFT] = createMaximumVO(LEFT); + maxData[RIGHT] = createMaximumVO(RIGHT); + maxData[UP] = createMaximumVO(UP); + maxData[DOWN] = createMaximumVO(DOWN); + + return maxData; + } + + /** + * Creates a map maximum swiped values for a given swipe direction + * @param {string} The direction that these values will be associated with + * @return Object Maximum values + * @inner + */ + function createMaximumVO(dir) { + return { + direction: dir, + distance: 0 + } + } + + + // + // MATHS / UTILS + // + + /** + * Calculate the duration of the swipe + * @return int + * @inner + */ + function calculateDuration() { + return endTime - startTime; + } + + /** + * Calculate the distance between 2 touches (pinch) + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int; + * @inner + */ + function calculateTouchesDistance(startPoint, endPoint) { + var diffX = Math.abs(startPoint.x - endPoint.x); + var diffY = Math.abs(startPoint.y - endPoint.y); + + return Math.round(Math.sqrt(diffX * diffX + diffY * diffY)); + } + + /** + * Calculate the zoom factor between the start and end distances + * @param {int} startDistance Distance (between 2 fingers) the user started pinching at + * @param {int} endDistance Distance (between 2 fingers) the user ended pinching at + * @return float The zoom value from 0 to 1. + * @inner + */ + function calculatePinchZoom(startDistance, endDistance) { + var percent = (endDistance / startDistance) * 1; + return percent.toFixed(2); + } + + + /** + * Returns the pinch direction, either IN or OUT for the given points + * @return string Either {@link $.fn.swipe.directions.IN} or {@link $.fn.swipe.directions.OUT} + * @see $.fn.swipe.directions + * @inner + */ + function calculatePinchDirection() { + if (pinchZoom < 1) { + return OUT; + } else { + return IN; + } + } + + + /** + * Calculate the length / distance of the swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int + * @inner + */ + function calculateDistance(startPoint, endPoint) { + return Math.round(Math.sqrt(Math.pow(endPoint.x - startPoint.x, 2) + Math.pow(endPoint.y - startPoint.y, 2))); + } + + /** + * Calculate the angle of the swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int + * @inner + */ + function calculateAngle(startPoint, endPoint) { + var x = startPoint.x - endPoint.x; + var y = endPoint.y - startPoint.y; + var r = Math.atan2(y, x); //radians + var angle = Math.round(r * 180 / Math.PI); //degrees + + //ensure value is positive + if (angle < 0) { + angle = 360 - Math.abs(angle); + } + + return angle; + } + + /** + * Calculate the direction of the swipe + * This will also call calculateAngle to get the latest angle of swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return string Either {@link $.fn.swipe.directions.LEFT} / {@link $.fn.swipe.directions.RIGHT} / {@link $.fn.swipe.directions.DOWN} / {@link $.fn.swipe.directions.UP} + * @see $.fn.swipe.directions + * @inner + */ + function calculateDirection(startPoint, endPoint) { + + if( comparePoints(startPoint, endPoint) ) { + return NONE; + } + + var angle = calculateAngle(startPoint, endPoint); + + if ((angle <= 45) && (angle >= 0)) { + return LEFT; + } else if ((angle <= 360) && (angle >= 315)) { + return LEFT; + } else if ((angle >= 135) && (angle <= 225)) { + return RIGHT; + } else if ((angle > 45) && (angle < 135)) { + return DOWN; + } else { + return UP; + } + } + + + /** + * Returns a MS time stamp of the current time + * @return int + * @inner + */ + function getTimeStamp() { + var now = new Date(); + return now.getTime(); + } + + + + /** + * Returns a bounds object with left, right, top and bottom properties for the element specified. + * @param {DomNode} The DOM node to get the bounds for. + */ + function getbounds(el) { + el = $(el); + var offset = el.offset(); + + var bounds = { + left: offset.left, + right: offset.left + el.outerWidth(), + top: offset.top, + bottom: offset.top + el.outerHeight() + } + + return bounds; + } + + + /** + * Checks if the point object is in the bounds object. + * @param {object} point A point object. + * @param {int} point.x The x value of the point. + * @param {int} point.y The x value of the point. + * @param {object} bounds The bounds object to test + * @param {int} bounds.left The leftmost value + * @param {int} bounds.right The righttmost value + * @param {int} bounds.top The topmost value + * @param {int} bounds.bottom The bottommost value + */ + function isInBounds(point, bounds) { + return (point.x > bounds.left && point.x < bounds.right && point.y > bounds.top && point.y < bounds.bottom); + }; + + /** + * Checks if the two points are equal + * @param {object} point A point object. + * @param {object} point B point object. + * @return true of the points match + */ + function comparePoints(pointA, pointB) { + return (pointA.x == pointB.x && pointA.y == pointB.y); + } + + + } + + + + + /** + * A catch all handler that is triggered for all swipe directions. + * @name $.fn.swipe#swipe + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + + + + /** + * A handler that is triggered for "left" swipes. + * @name $.fn.swipe#swipeLeft + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "right" swipes. + * @name $.fn.swipe#swipeRight + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "up" swipes. + * @name $.fn.swipe#swipeUp + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "down" swipes. + * @name $.fn.swipe#swipeDown + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler triggered for every phase of the swipe. This handler is constantly fired for the duration of the pinch. + * This is triggered regardless of swipe thresholds. + * @name $.fn.swipe#swipeStatus + * @event + * @default null + * @param {EventObject} event The original event object + * @param {string} phase The phase of the swipe event. See {@link $.fn.swipe.phases} + * @param {string} direction The direction the user swiped in. This is null if the user has yet to move. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped. This is 0 if the user has yet to move. + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler triggered for pinch in events. + * @name $.fn.swipe#pinchIn + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A handler triggered for pinch out events. + * @name $.fn.swipe#pinchOut + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A handler triggered for all pinch events. This handler is constantly fired for the duration of the pinch. This is triggered regardless of thresholds. + * @name $.fn.swipe#pinchStatus + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A click handler triggered when a user simply clicks, rather than swipes on an element. + * This is deprecated since version 1.6.2, any assignment to click will be assigned to the tap handler. + * You cannot use on to bind to this event as the default jQ click event will be triggered. + * Use the tap event instead. + * @name $.fn.swipe#click + * @event + * @deprecated since version 1.6.2, please use {@link $.fn.swipe#tap} instead + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A click / tap handler triggered when a user simply clicks or taps, rather than swipes on an element. + * @name $.fn.swipe#tap + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A double tap handler triggered when a user double clicks or taps on an element. + * You can set the time delay for a double tap with the {@link $.fn.swipe.defaults#doubleTapThreshold} property. + * Note: If you set both doubleTap and tap handlers, the tap event will be delayed by the doubleTapThreshold + * as the script needs to check if its a double tap. + * @name $.fn.swipe#doubleTap + * @see $.fn.swipe.defaults#doubleTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A long tap handler triggered once a tap has been release if the tap was longer than the longTapThreshold. + * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. + * @name $.fn.swipe#longTap + * @see $.fn.swipe.defaults#longTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A hold tap handler triggered as soon as the longTapThreshold is reached + * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. + * @name $.fn.swipe#hold + * @see $.fn.swipe.defaults#longTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + +})); \ No newline at end of file diff --git a/js/jquery.touchSwipe.min.js b/js/jquery.touchSwipe.min.js new file mode 100644 index 0000000..19db70f --- /dev/null +++ b/js/jquery.touchSwipe.min.js @@ -0,0 +1,15 @@ +/*! + * @fileOverview TouchSwipe - jQuery Plugin + * @version 1.6.18 + * + * @author Matt Bryson http://www.github.com/mattbryson + * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin + * @see http://labs.rampinteractive.co.uk/touchSwipe/ + * @see http://plugins.jquery.com/project/touchSwipe + * @license + * Copyright (c) 2010-2015 Matt Bryson + * Dual licensed under the MIT or GPL Version 2 licenses. + * + */ + +!function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null===options.pinchThreshold||pinchDistance>=options.pinchThreshold}function validateSwipeTime(){var result;return result=!options.maxTimeThreshold||!(duration>=options.maxTimeThreshold)}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distanceoptions.longTapThreshold&&distance=0?LEFT:angle<=360&&angle>=315?LEFT:angle>=135&&angle<=225?RIGHT:angle>45&&angle<135?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.xbounds.top&&point.yGet started here." +msgstr "" + +#: content-none.php:21 +msgid "" +"Sorry, but nothing matched your search terms. Please try again with some " +"different keywords." +msgstr "" + +#: content-none.php:26 +msgid "" +"It seems we can’t find what you’re looking for. Perhaps " +"searching can help." +msgstr "" + +#: content-related.php:20 +msgid "Related" +msgstr "" + +#: content-related.php:58 content-search.php:42 content.php:42 +msgid "No Title" +msgstr "" + +#: content-related.php:91 functions/template-tags.php:359 +msgid "Read More" +msgstr "" + +#: functions.php:41 +msgid "Featured Service" +msgstr "" + +#: functions.php:47 +msgid "Primary Menu" +msgstr "" + +#: functions.php:48 +msgid "Footer Menu" +msgstr "" + +#: functions.php:137 +msgid "Blog Sidebar" +msgstr "" + +#: functions.php:146 +msgid "Page Sidebar" +msgstr "" + +#: functions.php:155 +msgid "Shop Sidebar" +msgstr "" + +#: functions.php:157 +msgid "Requires WooCommerce plugin." +msgstr "" + +#: functions.php:165 +msgid "Shop Filters" +msgstr "" + +#: functions.php:167 +msgid "" +"Horizontal widget area for product archives. Requires WooCommerce plugin." +msgstr "" + +#: functions.php:175 +msgid "Top Bar" +msgstr "" + +#: functions.php:177 +msgid "Add your own content above the header." +msgstr "" + +#: functions.php:185 +msgid "Top Footer" +msgstr "" + +#: functions.php:186 +msgid "Full width area above the footer columns." +msgstr "" + +#: functions.php:196 +msgid "Footer Column 1" +msgstr "" + +#: functions.php:206 +msgid "Footer Column 2" +msgstr "" + +#: functions.php:216 +msgid "Footer Column 3" +msgstr "" + +#: functions.php:242 functions.php:311 +msgctxt "Google fonts: on or off" +msgid "on" +msgstr "" + +#: functions.php:273 functions.php:342 +msgctxt "Add new subset (greek, cyrillic, devanagari, vietnamese)" +msgid "no-subset" +msgstr "" + +#: functions.php:400 +msgid "Cordero - Accent color" +msgstr "" + +#: functions.php:405 +msgid "Cordero - Color 2" +msgstr "" + +#: functions.php:410 +msgid "Cordero - Color 3" +msgstr "" + +#: functions.php:415 +msgid "Black" +msgstr "" + +#: functions.php:420 +msgid "White" +msgstr "" + +#: functions.php:425 +msgid "Pale pink" +msgstr "" + +#: functions.php:430 +msgid "Vivid red" +msgstr "" + +#: functions.php:435 +msgid "Luminous vivid orange" +msgstr "" + +#: functions.php:440 +msgid "Luminous vivid amber" +msgstr "" + +#: functions.php:445 +msgid "Light green cyan" +msgstr "" + +#: functions.php:450 +msgid "Vivid green cyan" +msgstr "" + +#: functions.php:455 +msgid "Pale cyan blue" +msgstr "" + +#: functions.php:460 +msgid "Vivid cyan blue" +msgstr "" + +#: functions.php:465 +msgid "Vivid purple" +msgstr "" + +#: functions.php:470 +msgid "Very light gray" +msgstr "" + +#: functions.php:475 +msgid "Cyan bluish gray" +msgstr "" + +#: functions.php:480 +msgid "Very dark gray" +msgstr "" + +#: functions.php:495 +msgid "Tiny" +msgstr "" + +#: functions.php:500 functions/block-styles.php:364 +msgid "Small" +msgstr "" + +#: functions.php:505 functions/customizer.php:447 functions/customizer.php:921 +msgid "Normal" +msgstr "" + +#: functions.php:510 functions/block-styles.php:373 +msgid "Medium" +msgstr "" + +#: functions.php:515 functions/block-styles.php:382 +msgid "Large" +msgstr "" + +#: functions.php:520 functions/block-styles.php:400 +msgid "Huge" +msgstr "" + +#: functions.php:525 +msgid "Gigantic" +msgstr "" + +#: functions.php:530 +msgid "Massive" +msgstr "" + +#: functions.php:591 +msgid "Starter Sites" +msgstr "" + +#. Theme Name of the plugin/theme +#: functions/block-patterns.php:14 +msgid "Cordero" +msgstr "" + +#: functions/block-patterns.php:20 +msgid "Cordero - Products" +msgstr "" + +#: functions/block-patterns.php:28 +msgid "Cover and Products" +msgstr "" + +#: functions/block-patterns.php:29 +msgctxt "Block pattern description" +msgid "" +"Two columns with a cover image to the left, and latest products on the right." +msgstr "" + +#: functions/block-patterns.php:35 functions/block-patterns.php:204 +#: functions/block-patterns.php:226 functions/block-patterns.php:274 +#: functions/block-patterns.php:296 functions/block-patterns.php:328 +#: functions/block-patterns.php:338 functions/block-patterns.php:472 +#: functions/block-patterns.php:510 functions/block-patterns.php:663 +#: functions/block-patterns.php:971 functions/block-patterns.php:1040 +#: functions/block-patterns.php:1131 functions/block-patterns.php:1326 +msgctxt "Theme starter content" +msgid "Example Heading" +msgstr "" + +#: functions/block-patterns.php:39 functions/block-patterns.php:667 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur adipiscing elit suscipit, auctor " +"etiam eu scelerisque nunc sociosqu mus felis, non eleifend porta imperdiet " +"fermentum nullam elementum." +msgstr "" + +#: functions/block-patterns.php:44 functions/block-patterns.php:184 +#: functions/block-patterns.php:672 functions/block-patterns.php:1244 +#: functions/block-patterns.php:1272 functions/block-patterns.php:1300 +#: functions/block-patterns.php:1360 functions/block-patterns.php:1388 +#: functions/block-patterns.php:1416 +msgctxt "Theme starter content" +msgid "Click Here" +msgstr "" + +#: functions/block-patterns.php:66 +msgid "Call to action hero cover" +msgstr "" + +#: functions/block-patterns.php:67 +msgctxt "Block pattern description" +msgid "" +"A full width cover image with inner group containing heading, paragraph and " +"button." +msgstr "" + +#: functions/block-patterns.php:76 +msgctxt "Theme starter content" +msgid "Works well with Transparent Header page template" +msgstr "" + +#: functions/block-patterns.php:80 +msgctxt "Theme starter content" +msgid "(Document > Page Attributes > Template: Transparent Header)" +msgstr "" + +#: functions/block-patterns.php:85 +msgctxt "Theme starter content" +msgid "CLICK ME" +msgstr "" + +#: functions/block-patterns.php:101 +msgid "Full-width group with inner container" +msgstr "" + +#: functions/block-patterns.php:102 +msgctxt "Block pattern description" +msgid "" +"A full width group containing an inner group with the default container " +"width." +msgstr "" + +#: functions/block-patterns.php:107 +msgctxt "Theme starter content" +msgid "" +"This pattern contains a paragraph inside an inner group within a full-width " +"group." +msgstr "" + +#: functions/block-patterns.php:121 +msgid "Gigantic heading with separator" +msgstr "" + +#: functions/block-patterns.php:122 +msgctxt "Block pattern description" +msgid "A gigantic centered bold heading with separator and three colors" +msgstr "" + +#: functions/block-patterns.php:138 +msgid "Quote group with mulitple paragraphs" +msgstr "" + +#: functions/block-patterns.php:139 +msgctxt "Block pattern description" +msgid "" +"A group containing multiple paragraphs, with quote styling on the first and " +"last paragraphs." +msgstr "" + +#: functions/block-patterns.php:143 +msgctxt "Theme starter content" +msgid "Do you see over yonder," +msgstr "" + +#: functions/block-patterns.php:147 +msgctxt "Theme starter content" +msgid "friend Sancho," +msgstr "" + +#: functions/block-patterns.php:151 +msgctxt "Theme starter content" +msgid "thirty or forty hulking giants?" +msgstr "" + +#: functions/block-patterns.php:155 +msgctxt "Theme starter content" +msgid "I intend to do battle with them and slay them." +msgstr "" + +#: functions/block-patterns.php:169 +msgid "Cover with Translucent Content" +msgstr "" + +#: functions/block-patterns.php:170 +msgctxt "Block pattern description" +msgid "A cover block with a background image and translucent inner group." +msgstr "" + +#: functions/block-patterns.php:175 +msgctxt "Theme starter content" +msgid "Example Heading" +msgstr "" + +#: functions/block-patterns.php:179 +msgctxt "Theme starter content" +msgid "Lorem ipsum dolor sit amet consectetur adipiscing elit" +msgstr "" + +#: functions/block-patterns.php:199 +msgid "Ribbon Heading and Content" +msgstr "" + +#: functions/block-patterns.php:200 +msgctxt "Block pattern description" +msgid "A ribbon style heading and content." +msgstr "" + +#: functions/block-patterns.php:208 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur adipiscing elit, feugiat pellentesque " +"himenaeos rutrum dui libero, tristique fames eu venenatis dictumst tortor, " +"posuere fusce pulvinar a mi magna quis euismod." +msgstr "" + +#: functions/block-patterns.php:221 +msgid "Media and text with angled separator" +msgstr "" + +#: functions/block-patterns.php:222 +msgctxt "Block pattern description" +msgid "" +"An image and text with an angled horizontal line between image and content." +msgstr "" + +#: functions/block-patterns.php:230 functions/block-patterns.php:256 +#: functions/block-patterns.php:278 functions/block-patterns.php:300 +#: functions/block-patterns.php:322 functions/block-patterns.php:332 +#: functions/block-patterns.php:342 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur adipiscing elit, fringilla congue " +"primis ultrices iaculis donec ullamcorper porta, quam nam netus senectus " +"litora per." +msgstr "" + +#: functions/block-patterns.php:243 +msgid "Media and text with overlapping heading" +msgstr "" + +#: functions/block-patterns.php:244 +msgctxt "Block pattern description" +msgid "An image and text with a wide overlapping heading." +msgstr "" + +#: functions/block-patterns.php:248 +msgctxt "Theme starter content" +msgid "An Example of a Wide Heading" +msgstr "" + +#: functions/block-patterns.php:252 +msgctxt "Theme starter content" +msgid "" +"Please note, the resizing handle has been disabled in this block pattern. " +"The width needs to be 50/50 for the wide heading to work correctly." +msgstr "" + +#: functions/block-patterns.php:269 functions/block-patterns.php:291 +msgid "Media and text overlapped" +msgstr "" + +#: functions/block-patterns.php:270 +msgctxt "Block pattern description" +msgid "An image and text with the text area overlapping the image." +msgstr "" + +#: functions/block-patterns.php:292 +msgctxt "Block pattern description" +msgid "" +"An image on the right and text with the text area overlapping the image." +msgstr "" + +#: functions/block-patterns.php:313 +msgid "Stacked media and text overlap" +msgstr "" + +#: functions/block-patterns.php:314 +msgctxt "Block pattern description" +msgid "Three overlapping media and text patterns, stacked." +msgstr "" + +#: functions/block-patterns.php:318 +msgctxt "Theme starter content" +msgid "Welcome to the Cordero theme" +msgstr "" + +#: functions/block-patterns.php:355 +msgid "About Me Profile" +msgstr "" + +#: functions/block-patterns.php:356 +msgctxt "Block pattern description" +msgid "An easy to edit author profile with image." +msgstr "" + +#: functions/block-patterns.php:361 functions/block-patterns.php:415 +#: functions/block-patterns.php:942 functions/block-patterns.php:986 +#: functions/block-patterns.php:1006 +msgctxt "Theme starter content" +msgid "Example Name" +msgstr "" + +#: functions/block-patterns.php:369 functions/block-patterns.php:423 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur adipiscing elit a tellus iaculis, " +"enim est viverra cubilia nulla nunc congue nostra semper velit." +msgstr "" + +#: functions/block-patterns.php:373 functions/block-patterns.php:427 +msgctxt "Theme starter content" +msgid "" +"Montes tempor quis curae dignissim egestas lacus gravida interdum auctor " +"orci ornare odio tempor curae eu curabitur aliquet, parturient eleifend id " +"condimentum enim est." +msgstr "" + +#: functions/block-patterns.php:406 +msgid "About Me Profile with Cover" +msgstr "" + +#: functions/block-patterns.php:407 +msgctxt "Block pattern description" +msgid "An easy to edit full-width cover with author profile and image." +msgstr "" + +#: functions/block-patterns.php:463 +msgid "Hero with Two Buttons" +msgstr "" + +#: functions/block-patterns.php:464 +msgctxt "Block pattern description" +msgid "A large full width hero cover with a title, sub-title, and two buttons." +msgstr "" + +#: functions/block-patterns.php:476 functions/block-patterns.php:600 +#: functions/block-patterns.php:612 functions/block-patterns.php:624 +#: functions/block-patterns.php:636 functions/block-patterns.php:1058 +#: functions/block-patterns.php:1078 functions/block-patterns.php:1098 +#: functions/block-patterns.php:1135 functions/block-patterns.php:1154 +#: functions/block-patterns.php:1174 functions/block-patterns.php:1194 +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1330 +#: functions/block-patterns.php:1351 functions/block-patterns.php:1379 +#: functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Lorem ipsum dolor sit amet consectetur" +msgstr "" + +#: functions/block-patterns.php:485 functions/block-patterns.php:1063 +#: functions/block-patterns.php:1083 functions/block-patterns.php:1103 +#: functions/block-patterns.php:1159 functions/block-patterns.php:1179 +#: functions/block-patterns.php:1199 +msgctxt "Theme starter content" +msgid "Read More" +msgstr "" + +#: functions/block-patterns.php:489 +msgctxt "Theme starter content" +msgid "Get In Touch" +msgstr "" + +#: functions/block-patterns.php:503 +msgid "Image and Features" +msgstr "" + +#: functions/block-patterns.php:504 +msgctxt "Block pattern description" +msgid "Three features with an image." +msgstr "" + +#: functions/block-patterns.php:531 functions/block-patterns.php:1054 +#: functions/block-patterns.php:1150 +msgctxt "Theme starter content" +msgid "Feature One" +msgstr "" + +#: functions/block-patterns.php:535 functions/block-patterns.php:553 +#: functions/block-patterns.php:571 functions/block-patterns.php:725 +#: functions/block-patterns.php:747 functions/block-patterns.php:771 +#: functions/block-patterns.php:793 functions/block-patterns.php:845 +#: functions/block-patterns.php:869 functions/block-patterns.php:893 +#: functions/block-patterns.php:917 functions/block-patterns.php:975 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur. Dictum tellus eleifend varius eros." +msgstr "" + +#: functions/block-patterns.php:549 functions/block-patterns.php:1074 +#: functions/block-patterns.php:1170 +msgctxt "Theme starter content" +msgid "Feature Two" +msgstr "" + +#: functions/block-patterns.php:567 functions/block-patterns.php:1094 +#: functions/block-patterns.php:1190 +msgctxt "Theme starter content" +msgid "Feature Three" +msgstr "" + +#: functions/block-patterns.php:589 +msgid "Offset Feature Columns" +msgstr "" + +#: functions/block-patterns.php:590 +msgctxt "Block pattern description" +msgid "Four offset columns with overlay background images." +msgstr "" + +#: functions/block-patterns.php:596 +msgctxt "Theme starter content" +msgid "One" +msgstr "" + +#: functions/block-patterns.php:608 +msgctxt "Theme starter content" +msgid "Two" +msgstr "" + +#: functions/block-patterns.php:620 +msgctxt "Theme starter content" +msgid "Three" +msgstr "" + +#: functions/block-patterns.php:632 +msgctxt "Theme starter content" +msgid "Four" +msgstr "" + +#: functions/block-patterns.php:651 +msgid "Call-to-action with images" +msgstr "" + +#: functions/block-patterns.php:652 +msgctxt "Block pattern description" +msgid "A call-to-action with two images." +msgstr "" + +#: functions/block-patterns.php:693 +msgid "Food menu with background images" +msgstr "" + +#: functions/block-patterns.php:694 +msgctxt "Block pattern description" +msgid "A food menu with background image for each item." +msgstr "" + +#: functions/block-patterns.php:700 functions/block-patterns.php:818 +msgctxt "Theme starter content" +msgid "Menu Heading" +msgstr "" + +#: functions/block-patterns.php:713 functions/block-patterns.php:829 +msgctxt "Theme starter content" +msgid "Item One" +msgstr "" + +#: functions/block-patterns.php:719 functions/block-patterns.php:741 +#: functions/block-patterns.php:765 functions/block-patterns.php:787 +#: functions/block-patterns.php:835 functions/block-patterns.php:859 +#: functions/block-patterns.php:883 functions/block-patterns.php:907 +msgctxt "Theme starter content" +msgid "$34" +msgstr "" + +#: functions/block-patterns.php:735 functions/block-patterns.php:853 +msgctxt "Theme starter content" +msgid "Item Two" +msgstr "" + +#: functions/block-patterns.php:759 functions/block-patterns.php:877 +msgctxt "Theme starter content" +msgid "Item Three" +msgstr "" + +#: functions/block-patterns.php:781 functions/block-patterns.php:901 +msgctxt "Theme starter content" +msgid "Item Four" +msgstr "" + +#: functions/block-patterns.php:811 +msgid "Food menu with images" +msgstr "" + +#: functions/block-patterns.php:812 +msgctxt "Block pattern description" +msgid "A food menu with an image for each item." +msgstr "" + +#: functions/block-patterns.php:933 +msgid "Client testimonial quote" +msgstr "" + +#: functions/block-patterns.php:934 +msgctxt "Block pattern description" +msgid "An easy to edit client testimonial quote." +msgstr "" + +#: functions/block-patterns.php:938 functions/block-patterns.php:982 +#: functions/block-patterns.php:1002 +msgctxt "Theme starter content" +msgid "" +"Lorem ipsum dolor sit amet consectetur adipiscing elit ornare mollis ac " +"ultrices, tempus per mus fusce aliquet id nec non erat penatibus. Quam " +"sapien lectus laoreet ac lobortis tellus convallis phasellus massa iaculis " +"ridiculus, taciti ultrices erat pretium feugiat faucibus aptent tortor class." +msgstr "" + +#: functions/block-patterns.php:950 functions/block-patterns.php:994 +#: functions/block-patterns.php:1014 +msgctxt "Theme starter content" +msgid "Example extra information" +msgstr "" + +#: functions/block-patterns.php:964 +msgid "Client testimonial quotes" +msgstr "" + +#: functions/block-patterns.php:965 +msgctxt "Block pattern description" +msgid "An easy to edit client testimonial quotes block." +msgstr "" + +#: functions/block-patterns.php:1033 +msgid "Featured Services" +msgstr "" + +#: functions/block-patterns.php:1034 +msgctxt "Block pattern description" +msgid "Three featured services." +msgstr "" + +#: functions/block-patterns.php:1121 +msgid "Cover and Overlapped Featured Services" +msgstr "" + +#: functions/block-patterns.php:1122 +msgctxt "Block pattern description" +msgid "A full width cover block and three overlapped featured services." +msgstr "" + +#: functions/block-patterns.php:1217 +msgid "Pricing Table" +msgstr "" + +#: functions/block-patterns.php:1218 +msgctxt "Block pattern description" +msgid "A three column pricing table." +msgstr "" + +#: functions/block-patterns.php:1223 functions/block-patterns.php:1339 +msgctxt "Theme starter content" +msgid "ITEM ONE" +msgstr "" + +#: functions/block-patterns.php:1227 functions/block-patterns.php:1255 +#: functions/block-patterns.php:1283 functions/block-patterns.php:1343 +#: functions/block-patterns.php:1371 functions/block-patterns.php:1399 +msgctxt "Theme starter content" +msgid "$" +msgstr "" + +#: functions/block-patterns.php:1227 functions/block-patterns.php:1343 +msgctxt "Theme starter content" +msgid "49" +msgstr "" + +#: functions/block-patterns.php:1227 functions/block-patterns.php:1255 +#: functions/block-patterns.php:1283 functions/block-patterns.php:1343 +#: functions/block-patterns.php:1371 functions/block-patterns.php:1399 +msgctxt "Theme starter content" +msgid "/year" +msgstr "" + +#: functions/block-patterns.php:1231 functions/block-patterns.php:1347 +msgctxt "Theme starter content" +msgid "1 User Account" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Dictum tellus eleifend varius eros" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Cubilia rutrum consequat libero, potenti" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Vivamus dictum scelerisque porta" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Vestibulum fermentum mollis duis enim" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Primis tristique convallis sociosqu diam" +msgstr "" + +#: functions/block-patterns.php:1235 functions/block-patterns.php:1263 +#: functions/block-patterns.php:1291 functions/block-patterns.php:1351 +#: functions/block-patterns.php:1379 functions/block-patterns.php:1407 +msgctxt "Theme starter content" +msgid "Commodo tempus accumsan justo" +msgstr "" + +#: functions/block-patterns.php:1251 functions/block-patterns.php:1367 +msgctxt "Theme starter content" +msgid "ITEM TWO" +msgstr "" + +#: functions/block-patterns.php:1255 functions/block-patterns.php:1371 +msgctxt "Theme starter content" +msgid "99" +msgstr "" + +#: functions/block-patterns.php:1259 functions/block-patterns.php:1375 +msgctxt "Theme starter content" +msgid "5 User Accounts" +msgstr "" + +#: functions/block-patterns.php:1279 functions/block-patterns.php:1395 +msgctxt "Theme starter content" +msgid "ITEM THREE" +msgstr "" + +#: functions/block-patterns.php:1283 functions/block-patterns.php:1399 +msgctxt "Theme starter content" +msgid "179" +msgstr "" + +#: functions/block-patterns.php:1287 functions/block-patterns.php:1403 +msgctxt "Theme starter content" +msgid "50 User Accounts" +msgstr "" + +#: functions/block-patterns.php:1316 +msgid "Cover and Overlapped Pricing Table" +msgstr "" + +#: functions/block-patterns.php:1317 +msgctxt "Block pattern description" +msgid "A full width cover block and three column overlapped pricing table." +msgstr "" + +#: functions/block-styles.php:16 +msgid "Translucent" +msgstr "" + +#: functions/block-styles.php:25 functions/block-styles.php:61 +#: functions/block-styles.php:116 functions/block-styles.php:207 +#: functions/block-styles.php:253 functions/block-styles.php:336 +#: functions/customizer.php:386 +msgid "Box Shadow" +msgstr "" + +#: functions/block-styles.php:34 +msgid "Quote" +msgstr "" + +#: functions/block-styles.php:43 functions/block-styles.php:189 +#: functions/block-styles.php:299 +msgid "Point - down" +msgstr "" + +#: functions/block-styles.php:51 functions/block-styles.php:198 +#: functions/block-styles.php:308 +msgid "Point - up" +msgstr "" + +#: functions/block-styles.php:70 functions/block-styles.php:125 +msgid "With Separator (style 1)" +msgstr "" + +#: functions/block-styles.php:79 functions/block-styles.php:134 +msgid "With Separator (style 2)" +msgstr "" + +#: functions/block-styles.php:88 functions/block-styles.php:143 +msgid "Without Bottom Margin" +msgstr "" + +#: functions/block-styles.php:97 functions/block-styles.php:152 +msgid "Content Width" +msgstr "" + +#: functions/block-styles.php:106 functions/block-styles.php:161 +msgid "Rounded Corners" +msgstr "" + +#: functions/block-styles.php:171 +msgid "Chevron - left" +msgstr "" + +#: functions/block-styles.php:180 +msgid "Chevron - right" +msgstr "" + +#: functions/block-styles.php:217 functions/block-styles.php:244 +msgid "No Spacing" +msgstr "" + +#: functions/block-styles.php:226 +msgid "Not Stacked on Mobile" +msgstr "" + +#: functions/block-styles.php:235 +msgid "No Spacing + Not Stacked on Mobile" +msgstr "" + +#: functions/block-styles.php:262 functions/customizer.php:385 +msgid "Bordered" +msgstr "" + +#: functions/block-styles.php:271 +msgid "Framed" +msgstr "" + +#: functions/block-styles.php:280 functions/block-styles.php:317 +#: functions/block-styles.php:410 +msgid "Inset Frame" +msgstr "" + +#: functions/block-styles.php:290 +msgid "No Padding" +msgstr "" + +#: functions/block-styles.php:327 +msgid "Offset" +msgstr "" + +#: functions/block-styles.php:345 +msgid "Offset and Box Shadow" +msgstr "" + +#: functions/block-styles.php:355 +msgid "Extra Small" +msgstr "" + +#: functions/block-styles.php:391 +msgid "Extra Large" +msgstr "" + +#: functions/block-styles.php:419 +msgid "Angled Divider" +msgstr "" + +#: functions/block-styles.php:428 +msgid "Overlapping Content (requires image fill)" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:327 +#: functions/class-tgm-plugin-activation.php:328 +msgid "Recommended Plugin" +msgstr "" + +#. translators: %s: plugin name. +#: functions/class-tgm-plugin-activation.php:330 +#, php-format +msgid "Installing Plugin: %s" +msgstr "" + +#. translators: %s: plugin name. +#: functions/class-tgm-plugin-activation.php:332 +#, php-format +msgid "Updating Plugin: %s" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:333 +msgid "Something went wrong with the plugin API." +msgstr "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:336 +#, php-format +msgid "This theme requires the following plugin: %1$s." +msgid_plural "This theme requires the following plugins: %1$s." +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:342 +#, php-format +msgid "Setup your new website quickly with %1$s." +msgid_plural "This theme recommends the following plugins: %1$s." +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:348 +#, php-format +msgid "" +"The following plugin needs to be updated to its latest version to ensure " +"maximum compatibility with this theme: %1$s." +msgid_plural "" +"The following plugins need to be updated to their latest version to ensure " +"maximum compatibility with this theme: %1$s." +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:354 +#, php-format +msgid "There is an update available for: %1$s." +msgid_plural "There are updates available for the following plugins: %1$s." +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:360 +#, php-format +msgid "The following required plugin is currently inactive: %1$s." +msgid_plural "The following required plugins are currently inactive: %1$s." +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name(s). +#: functions/class-tgm-plugin-activation.php:367 +#, php-format +msgid "" +"Did you know you can import demo content and set up your new website quickly " +"and easily with %1$s?" +msgid_plural "The following recommended plugins are currently inactive: %1$s." +msgstr[0] "" +msgstr[1] "" + +#: functions/class-tgm-plugin-activation.php:373 +msgid "Install plugin" +msgid_plural "Install plugins" +msgstr[0] "" +msgstr[1] "" + +#: functions/class-tgm-plugin-activation.php:378 +msgid "Update plugin" +msgid_plural "Update plugins" +msgstr[0] "" +msgstr[1] "" + +#: functions/class-tgm-plugin-activation.php:383 +msgid "Activate plugin" +msgid_plural "Activate plugins" +msgstr[0] "" +msgstr[1] "" + +#: functions/class-tgm-plugin-activation.php:387 +msgid "Return to Required Plugins Installer" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:388 +#: functions/class-tgm-plugin-activation.php:829 +#: functions/class-tgm-plugin-activation.php:2536 +#: functions/class-tgm-plugin-activation.php:3583 +msgid "Return to the Dashboard" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:389 +#: functions/class-tgm-plugin-activation.php:3162 +msgid "Plugin activated successfully." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:390 +#: functions/class-tgm-plugin-activation.php:2955 +msgid "The following plugin was activated successfully:" +msgid_plural "The following plugins were activated successfully:" +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: plugin name. +#: functions/class-tgm-plugin-activation.php:392 +#, php-format +msgid "No action taken. Plugin %1$s was already active." +msgstr "" + +#. translators: 1: plugin name. +#: functions/class-tgm-plugin-activation.php:394 +#, php-format +msgid "" +"Plugin not activated. A higher version of %s is needed for this theme. " +"Please update the plugin." +msgstr "" + +#. translators: 1: dashboard link. +#: functions/class-tgm-plugin-activation.php:396 +#, php-format +msgid "All plugins installed and activated successfully. %1$s" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:397 +msgid "Dismiss this notice" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:398 +msgid "" +"There are one or more required or recommended plugins to install, update or " +"activate." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:399 +msgid "Please contact the administrator of this site for help." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:524 +msgid "This plugin needs to be updated to be compatible with your theme." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:525 +msgid "Update Required" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:936 +msgid "" +"The remote plugin package does not contain a folder with the desired slug " +"and renaming did not work." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:936 +#: functions/class-tgm-plugin-activation.php:939 +msgid "" +"Please contact the plugin provider and ask them to package their plugin " +"according to the WordPress guidelines." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:939 +msgid "" +"The remote plugin package consists of more than one file, but the files are " +"not packaged in a folder." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:1094 +msgid "Thank you for using the Cordero theme." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:1123 +#: functions/class-tgm-plugin-activation.php:2951 +msgctxt "plugin A *and* plugin B" +msgid "and" +msgstr "" + +#. translators: %s: version number +#: functions/class-tgm-plugin-activation.php:1985 +#, php-format +msgid "TGMPA v%s" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2276 +msgid "Required" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2279 +msgid "Recommended" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2295 +msgid "WordPress Repository" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2298 +msgid "External Source" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2301 +msgid "Pre-Packaged" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2318 +msgid "Not Installed" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2322 +msgid "Installed But Not Activated" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2324 +msgid "Active" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2330 +msgid "Required Update not Available" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2333 +msgid "Requires Update" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2336 +msgid "Update recommended" +msgstr "" + +#. translators: 1: install status, 2: update status +#: functions/class-tgm-plugin-activation.php:2345 +#, php-format +msgctxt "Install/Update Status" +msgid "%1$s, %2$s" +msgstr "" + +#. translators: 1: number of plugins. +#: functions/class-tgm-plugin-activation.php:2391 +#, php-format +msgctxt "plugins" +msgid "All (%s)" +msgid_plural "All (%s)" +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: number of plugins. +#: functions/class-tgm-plugin-activation.php:2395 +#, php-format +msgid "To Install (%s)" +msgid_plural "To Install (%s)" +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: number of plugins. +#: functions/class-tgm-plugin-activation.php:2399 +#, php-format +msgid "Update Available (%s)" +msgid_plural "Update Available (%s)" +msgstr[0] "" +msgstr[1] "" + +#. translators: 1: number of plugins. +#: functions/class-tgm-plugin-activation.php:2403 +#, php-format +msgid "To Activate (%s)" +msgid_plural "To Activate (%s)" +msgstr[0] "" +msgstr[1] "" + +#: functions/class-tgm-plugin-activation.php:2485 +msgctxt "as in: \"version nr unknown\"" +msgid "unknown" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2493 +msgid "Installed version:" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2501 +msgid "Minimum required version:" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2513 +msgid "Available version:" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2536 +msgid "No plugins to install, update or activate." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2550 +msgid "Plugin" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2551 +msgid "Source" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2552 +msgid "Type" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2556 +msgid "Version" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2557 +msgid "Status" +msgstr "" + +#. translators: %2$s: plugin name in screen reader markup +#: functions/class-tgm-plugin-activation.php:2606 +#, php-format +msgid "Install %2$s" +msgstr "" + +#. translators: %2$s: plugin name in screen reader markup +#: functions/class-tgm-plugin-activation.php:2611 +#, php-format +msgid "Update %2$s" +msgstr "" + +#. translators: %2$s: plugin name in screen reader markup +#: functions/class-tgm-plugin-activation.php:2617 +#, php-format +msgid "Activate %2$s" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2687 +msgid "Upgrade message from the plugin author:" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2720 +msgid "Install" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2726 +msgid "Update" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2729 +msgid "Activate" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2760 +msgid "No plugins were selected to be installed. No action taken." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2762 +msgid "No plugins were selected to be updated. No action taken." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2803 +msgid "No plugins are available to be installed at this time." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2805 +msgid "No plugins are available to be updated at this time." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2911 +msgid "No plugins were selected to be activated. No action taken." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:2937 +msgid "No plugins are available to be activated at this time." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3161 +msgid "Plugin activation failed." +msgstr "" + +#. translators: 1: plugin name, 2: action number 3: total number of actions. +#: functions/class-tgm-plugin-activation.php:3501 +#, php-format +msgid "Updating Plugin %1$s (%2$d/%3$d)" +msgstr "" + +#. translators: 1: plugin name, 2: error message. +#: functions/class-tgm-plugin-activation.php:3504 +#, php-format +msgid "An error occurred while installing %1$s: %2$s." +msgstr "" + +#. translators: 1: plugin name. +#: functions/class-tgm-plugin-activation.php:3506 +#, php-format +msgid "The installation of %1$s failed." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3510 +msgid "" +"The installation and activation process is starting. This process may take a " +"while on some hosts, so please be patient." +msgstr "" + +#. translators: 1: plugin name. +#: functions/class-tgm-plugin-activation.php:3512 +#, php-format +msgid "%1$s installed and activated successfully." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3512 +#: functions/class-tgm-plugin-activation.php:3520 +msgid "Show Details" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3512 +#: functions/class-tgm-plugin-activation.php:3520 +msgid "Hide Details" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3513 +msgid "All installations and activations have been completed." +msgstr "" + +#. translators: 1: plugin name, 2: action number 3: total number of actions. +#: functions/class-tgm-plugin-activation.php:3515 +#, php-format +msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)" +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3518 +msgid "" +"The installation process is starting. This process may take a while on some " +"hosts, so please be patient." +msgstr "" + +#. translators: 1: plugin name. +#: functions/class-tgm-plugin-activation.php:3520 +#, php-format +msgid "%1$s installed successfully." +msgstr "" + +#: functions/class-tgm-plugin-activation.php:3521 +msgid "All installations have been completed." +msgstr "" + +#. translators: 1: plugin name, 2: action number 3: total number of actions. +#: functions/class-tgm-plugin-activation.php:3523 +#, php-format +msgid "Installing Plugin %1$s (%2$d/%3$d)" +msgstr "" + +#: functions/customizer-controls.php:17 +msgid "Accent Color" +msgstr "" + +#: functions/customizer-controls.php:18 +msgid "Links, buttons" +msgstr "" + +#: functions/customizer-controls.php:29 +msgid "Color 2" +msgstr "" + +#: functions/customizer-controls.php:30 +msgid "Background: transparent header on scrolling, footer" +msgstr "" + +#: functions/customizer-controls.php:41 +msgid "Color 3" +msgstr "" + +#: functions/customizer-controls.php:42 +msgid "" +"Background: blog posts (not plain style), sidebar, page numbers, forms, " +"tables" +msgstr "" + +#: functions/customizer-controls.php:49 +msgid "Layout Options" +msgstr "" + +#: functions/customizer-controls.php:56 +msgid "Blog Options" +msgstr "" + +#: functions/customizer-controls.php:67 +msgid "Container Width" +msgstr "" + +#: functions/customizer-controls.php:83 +msgid "Disable Search Form in Header" +msgstr "" + +#: functions/customizer.php:29 +msgid "Logo - Transparent Header" +msgstr "" + +#: functions/customizer.php:30 +msgid "" +"The logo on the **Transparent Header** page template. If empty, main logo is " +"displayed." +msgstr "" + +#: functions/customizer.php:38 functions/customizer.php:43 +msgid "Select logo" +msgstr "" + +#: functions/customizer.php:39 +msgid "Change logo" +msgstr "" + +#: functions/customizer.php:40 +msgid "Remove" +msgstr "" + +#: functions/customizer.php:41 +msgid "Default" +msgstr "" + +#: functions/customizer.php:42 +msgid "No logo selected" +msgstr "" + +#: functions/customizer.php:44 +msgid "Choose logo" +msgstr "" + +#: functions/customizer.php:63 +msgid "Hide Tagline" +msgstr "" + +#: functions/customizer.php:79 +msgid "Site Title Style" +msgstr "" + +#: functions/customizer.php:80 +msgid "Applies to textual Site Title only, not custom logo." +msgstr "" + +#: functions/customizer.php:84 +msgid "With Border" +msgstr "" + +#: functions/customizer.php:85 +msgid "Highlight 1st Letter" +msgstr "" + +#: functions/customizer.php:86 +msgid "With Background" +msgstr "" + +#: functions/customizer.php:87 +msgid "No Styling" +msgstr "" + +#: functions/customizer.php:106 +msgid "Schema Markup" +msgstr "" + +#: functions/customizer.php:124 +msgid "Remove Schema Tags" +msgstr "" + +#: functions/customizer.php:144 +msgid "" +"Note: header image is not displayed on the **Transparent Header** page " +"template." +msgstr "" + +#: functions/customizer.php:166 +msgid "Header" +msgstr "" + +#: functions/customizer.php:185 +msgid "Layout" +msgstr "" + +#: functions/customizer.php:212 +msgid "Disable Fixed Header" +msgstr "" + +#: functions/customizer.php:232 +msgid "Sidebar" +msgstr "" + +#: functions/customizer.php:248 +msgid "Position" +msgstr "" + +#: functions/customizer.php:252 +msgid "Left" +msgstr "" + +#: functions/customizer.php:253 +msgid "Right" +msgstr "" + +#: functions/customizer.php:254 +msgid "Bottom (below content)" +msgstr "" + +#: functions/customizer.php:274 +msgid "Footer" +msgstr "" + +#: functions/customizer.php:293 +msgid "Footer Layout" +msgstr "" + +#: functions/customizer.php:319 +msgid "Enable Sticky Footer" +msgstr "" + +#: functions/customizer.php:320 +msgid "" +"On pages with little or no content, the footer will appear at the bottom of " +"the page." +msgstr "" + +#: functions/customizer.php:342 +msgid "Archives" +msgstr "" + +#: functions/customizer.php:343 +msgid "Blog page, post archives, related posts" +msgstr "" + +#: functions/customizer.php:358 +msgid "Columns (posts per row)" +msgstr "" + +#: functions/customizer.php:362 functions/customizer.php:785 +msgid "1" +msgstr "" + +#: functions/customizer.php:363 functions/customizer.php:786 +msgid "2" +msgstr "" + +#: functions/customizer.php:364 functions/customizer.php:787 +msgid "3" +msgstr "" + +#: functions/customizer.php:365 functions/customizer.php:788 +msgid "4" +msgstr "" + +#: functions/customizer.php:380 +msgid "Post Style" +msgstr "" + +#: functions/customizer.php:384 +msgid "Plain" +msgstr "" + +#: functions/customizer.php:401 +msgid "Show Excerpt or Full Post" +msgstr "" + +#: functions/customizer.php:405 +msgid "Excerpt" +msgstr "" + +#: functions/customizer.php:406 +msgid "Full Post" +msgstr "" + +#: functions/customizer.php:423 +msgid "Excerpt Word Length" +msgstr "" + +#: functions/customizer.php:443 +msgid "Post Content Vertical Alignment" +msgstr "" + +#: functions/customizer.php:448 +msgid "Space Between" +msgstr "" + +#: functions/customizer.php:449 +msgid "Space Around" +msgstr "" + +#: functions/customizer.php:450 +msgid "Space Evenly" +msgstr "" + +#: functions/customizer.php:451 +msgid "Centered" +msgstr "" + +#: functions/customizer.php:452 +msgid "Bottom" +msgstr "" + +#: functions/customizer.php:469 functions/customizer.php:663 +msgid "Remove Author" +msgstr "" + +#: functions/customizer.php:486 functions/customizer.php:680 +msgid "Remove Date" +msgstr "" + +#: functions/customizer.php:503 functions/customizer.php:697 +msgid "Remove Categories" +msgstr "" + +#: functions/customizer.php:520 functions/customizer.php:714 +msgid "Remove Tags" +msgstr "" + +#: functions/customizer.php:537 +msgid "Remove Read More Link" +msgstr "" + +#: functions/customizer.php:554 functions/customizer.php:646 +msgid "Remove Featured Image" +msgstr "" + +#: functions/customizer.php:572 +msgid "Read More Text" +msgstr "" + +#: functions/customizer.php:586 functions/customizer.php:763 +msgid "Featured Image Size" +msgstr "" + +#: functions/customizer.php:587 functions/customizer.php:764 +msgid "" +"See: \"Settings\" > \"Media\" (or any active plugins that control image " +"sizes)" +msgstr "" + +#: functions/customizer.php:606 +msgid "Featured Image Placeholder" +msgstr "" + +#: functions/customizer.php:607 +msgid "Displays where a post does not have a Featured Image" +msgstr "" + +#: functions/customizer.php:629 +msgid "Single Posts" +msgstr "" + +#: functions/customizer.php:731 +msgid "Remove Previous and Next Links" +msgstr "" + +#: functions/customizer.php:748 +msgid "Remove Related Posts" +msgstr "" + +#: functions/customizer.php:781 +msgid "Number of Related Posts" +msgstr "" + +#: functions/customizer.php:789 +msgid "5" +msgstr "" + +#: functions/customizer.php:790 +msgid "6" +msgstr "" + +#: functions/customizer.php:791 +msgid "7" +msgstr "" + +#: functions/customizer.php:792 +msgid "8" +msgstr "" + +#: functions/customizer.php:809 +msgid "Reading View Template Width" +msgstr "" + +#: functions/customizer.php:810 +msgid "" +"The maximum width of the content when using the **Reading View** post " +"template. Note: will not display wider than the main container." +msgstr "" + +#: functions/customizer.php:825 +msgid "Typography & Fonts" +msgstr "" + +#: functions/customizer.php:837 +msgid "Site Title" +msgstr "" + +#: functions/customizer.php:850 +msgid "Navigation" +msgstr "" + +#: functions/customizer.php:863 +msgid "Content" +msgstr "" + +#: functions/customizer.php:876 +msgid "Headings" +msgstr "" + +#: functions/customizer.php:895 +msgid "Base Font Size" +msgstr "" + +#: functions/customizer.php:916 +msgid "Menu Text Style" +msgstr "" + +#: functions/customizer.php:920 +msgid "UPPERCASE" +msgstr "" + +#: functions/customizer.php:928 functions/customizer.php:939 +#: functions/customizer.php:1062 +msgid "Go Pro" +msgstr "" + +#: functions/customizer.php:930 functions/theme-help.php:163 +msgid "" +"Upgrade to Cordero Pro for even more cool features and customization options." +msgstr "" + +#: functions/customizer.php:1045 +msgid "More options available" +msgstr "" + +#: functions/customizer.php:1054 functions/theme-help.php:133 +msgid "Documentation" +msgstr "" + +#: functions/customizer.php:1144 +msgid "Full (original full size image)" +msgstr "" + +#: functions/customizer.php:1148 +msgid "(exact dimensions)" +msgstr "" + +#: functions/customizer.php:1150 +msgid "(proportional)" +msgstr "" + +#: functions/extras.php:68 +msgid "Create your Primary Menu here" +msgstr "" + +#: functions/extras.php:156 +msgid "Close Menu" +msgstr "" + +#: functions/extras.php:379 +msgid "Close Search" +msgstr "" + +#: functions/extras.php:462 +msgid "https://wordpress.org/" +msgstr "" + +#: functions/extras.php:462 +#, php-format +msgid "Powered by %s" +msgstr "" + +#. translators: %2$s link to theme page, %1$s theme author +#: functions/extras.php:465 +#, php-format +msgid "Theme: %2$s by %1$s" +msgstr "" + +#. translators: used between list items, there is a space after the comma +#: functions/template-tags.php:124 functions/template-tags.php:143 +#: functions/template-tags.php:163 functions/template-tags.php:183 +#: functions/template-tags.php:204 +msgid ", " +msgstr "" + +#. translators: %s: post title +#: functions/template-tags.php:220 +#, php-format +msgid "Leave a Comment on %s" +msgstr "" + +#. translators: %s: Name of current post. Only visible to screen readers +#: functions/template-tags.php:237 +#, php-format +msgid "Edit %s" +msgstr "" + +#: functions/theme-help.php:20 +#, php-format +msgid "%s Options" +msgstr "" + +#. translators: %s: theme name. +#: functions/theme-help.php:42 +#, php-format +msgid "Getting Started with %s" +msgstr "" + +#: functions/theme-help.php:45 +msgid "NEW! - Block Patterns" +msgstr "" + +#: functions/theme-help.php:48 +msgid "" +"With WordPress 5.5 there is a new Block Patterns feature. This allows you to " +"easily insert block designs into your pages or posts." +msgstr "" + +#: functions/theme-help.php:51 +msgid "" +"Cordero has a variety of patterns to help you get started, including a full " +"width hero, featured services and pricing table." +msgstr "" + +#: functions/theme-help.php:54 +msgid "" +"To begin, add or edit a page, click the \"Add Block\" button and then the " +"\"Patterns\" tab." +msgstr "" + +#: functions/theme-help.php:57 +msgid "Find a pattern you like, and click it to add the pattern to your page." +msgstr "" + +#: functions/theme-help.php:60 +msgid "" +"Thats it! You can now edit the text or images of the pattern to really make " +"it your own!" +msgstr "" + +#: functions/theme-help.php:67 +msgid "" +"You appear to be using an old version of WordPress. Block patterns require " +"at least version 5.5 of WordPress." +msgstr "" + +#: functions/theme-help.php:71 +msgid "Update WordPress" +msgstr "" + +#: functions/theme-help.php:77 +msgid "Add or edit a page now to try it out." +msgstr "" + +#: functions/theme-help.php:81 +msgid "Add New Page" +msgstr "" + +#: functions/theme-help.php:94 +msgid "Options" +msgstr "" + +#. translators: %s: theme name. +#: functions/theme-help.php:99 +#, php-format +msgid "%s makes use of the Customizer for the theme settings." +msgstr "" + +#: functions/theme-help.php:103 +msgid "Customize" +msgstr "" + +#: functions/theme-help.php:109 +msgid "Demo Content" +msgstr "" + +#. translators: %s: theme name. +#: functions/theme-help.php:114 +#, php-format +msgid "Import %s demo content and Starter Sites." +msgstr "" + +#: functions/theme-help.php:119 +msgid "View Demo Content" +msgstr "" + +#: functions/theme-help.php:122 +msgid "Get Starter Sites Plugin" +msgstr "" + +#: functions/theme-help.php:136 +msgid "" +"Do you need help to setup and customize this theme? Check out the theme " +"documentation." +msgstr "" + +#: functions/theme-help.php:140 +msgid "View Documentation" +msgstr "" + +#: functions/theme-help.php:146 +msgid "Support" +msgstr "" + +#: functions/theme-help.php:149 +msgid "Any questions?" +msgstr "" + +#: functions/theme-help.php:153 +msgid "Get Support" +msgstr "" + +#: functions/theme-help.php:160 +msgid "Upgrade" +msgstr "" + +#: functions/theme-help.php:167 +msgid "GO PRO" +msgstr "" + +#: functions/theme-help.php:181 +msgid "Theme Details" +msgstr "" + +#. translators: %1$s: theme name, %2$s: theme author, %3$s: link to theme review page. +#: functions/theme-help.php:197 +#, php-format +msgid "%1$s is proudly brought to you by %2$s. If you like this theme, %3$s :)" +msgstr "" + +#: functions/theme-help.php:197 +msgid "rate it" +msgstr "" + +#: header-transparent.php:24 header.php:24 +msgid "Skip to content" +msgstr "" + +#. translators: %s: search query. +#: search.php:28 +#, php-format +msgid "Search Results for: %s" +msgstr "" + +#: sidebar-shop-filters.php:20 +msgid "Product Filters" +msgstr "" + +#. Theme URI of the plugin/theme +msgid "https://uxlthemes.com/theme/cordero/" +msgstr "" + +#. Description of the plugin/theme +msgid "" +"Cordero is a WordPress theme with customizable accent color, header layout " +"options including side header, support for the Gutenberg visual block editor " +"and WooCommerce, block patterns including full width hero, featured " +"services, and pricing table. Cordero also has three page templates including " +"transparent header, a narrower Reading View post template, and schema.org " +"SEO markup." +msgstr "" + +#. Author of the plugin/theme +msgid "UXL Themes" +msgstr "" + +#. Author URI of the plugin/theme +msgid "https://uxlthemes.com" +msgstr "" + +#. Template Name of the plugin/theme +msgid "No Page Title" +msgstr "" + +#. Template Name of the plugin/theme +msgid "Reading View (Paragraphs Only)" +msgstr "" + +#. Template Name of the plugin/theme +msgid "Reading View" +msgstr "" + +#. Template Name of the plugin/theme +msgid "Transparent Header" +msgstr "" diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..f4685f8 --- /dev/null +++ b/license.txt @@ -0,0 +1,281 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/page.php b/page.php new file mode 100644 index 0000000..06a33a5 --- /dev/null +++ b/page.php @@ -0,0 +1,42 @@ + + + + +
    +
    + + + + + + + + + +
    +
    + + + + + + diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..3a0749f --- /dev/null +++ b/readme.txt @@ -0,0 +1,200 @@ +== Cordero == +Cordero WordPress Theme, Copyright UXL Themes 2020 +Cordero is distributed under the terms of the GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html) +Contributors: uxl +Stable tag: 1.2.6 +Requires at least: 5 +Tested up to: 5.8 +Requires PHP: 5.6 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +== Installation == +1. In your WordPress Dashboard, nagivate to **Appearance > Themes** and click the **Add New** button. +2. Type **Cordero** in the search form and press the **Enter** key on your keyboard. +3. Click the **Activate** button to begin using Cordero on your website. + +== Customization == +1. Navigate to **Appearance > Customize**. +2. Customize the style of your website by adding a logo, changing the fonts and selecting a custom accent color. + +== Screenshot Content == +1. Navigate to **Pages > Add New**. +2. Click the **Add Block** button, select the **Patterns** tab, click the **Cover and Overlapped Featured Services** preview to add the block pattern to the page. +3. Edit the pattern's text/images/colors to really make it your own. +4. In **Document > Page Attributes**, select **Transparent Header** template. +5. Click **Publish** and then **View Page**. + +== Changelog == +1.2.6 - Dec 07, 2021 +Fixed font compatibility with Classic Editor + +1.2.5 - Nov 25, 2021 +CSS updates + +1.2.4 - Nov 04, 2021 +Updated accent color customization output + +1.2.3 - Jun 29, 2021 +Fix for cart quantity input +Add excerpt or full post option for blog archives + +1.2.2 - Nov 12, 2020 +Added **Call to action hero cover** block pattern +Fixed **Media and text with overlapping heading** block pattern for all heading levels +Fixed tablet and mobile preview in block editor + +1.2 - Oct 19, 2020 +Added primary menu text style options +Added left side header layout option +Added **Not Stacked on Mobile** block style for columns +Added box shadow, bordered and framed styles for gallery block +Added **Inset Frame** style for media and text, gallery and cover blocks +Added left and right chevron block styles for images +Added point up and down block styles for images, covers and groups +Added heading with separator block styles +Added paragraph with separator block styles +Added **Gigantic heading with separator** block pattern +Added **Media and text with overlapping heading** block pattern +Added **Full-width group with inner container** block pattern +Updated container width of group block within full width group block +Fixed **Translucent** group block style +Minor CSS updates + +1.1.6 - Oct 01, 2020 +Added six sizing styles for Separator block +Fix **Media and text overlapped** block patterns to work with gradient background + +1.1.5 - Sep 23, 2020 +Added **Box Shadow** blog style option +Added new **Cover with Translucent Content** block pattern +Added new **Ribbon Heading** block pattern +Added **Translucent** style for group block +Added **No Spacing** styles for column and gallery blocks +Added **Box Shadow** styles for group, column, heading, paragraph and image blocks +Improved wishlist compatibility + +1.1.4 - Aug 31, 2020 +Added new block patterns + +1.1.3 - Aug 21, 2020 +Added new block patterns +Improved fixed header scrolling + +1.1.2 - Aug 15, 2020 +Added blog columns (posts per row) option +Added featured image size selection settings +Fix post layout/styling with Jetpack infinite scrolling + +1.1.1 - Aug 13, 2020 +Fix Transparent Header post template when post has featured image + +1.1 - Aug 12, 2020 +Added additional custom color options +Added block patterns using register_block_pattern functionality +Added post template: Reading View +Added blog style options +Added blog meta info display options +Updated transparent header logo to WP 5.5 standard +Minor CSS updates + +1.0.5 - Jul 16, 2020 +Fix for header menu layout option 2 displaying incorrectly +Added TGMPA to recommend Starter Sites plugin + +1.0.4 - Jul 13, 2020 +Fixes for theme review requirements +Updated keyboard navigation for mobile menu + +1.0.3 - Jul 06, 2020 +Fix for accent color CSS +Fix for mobile menu swipe conflict with search input + +1.0.2 - Jul 05, 2020 +Added header and footer layout options +Added option to disable fixed header +Added various action hooks +Added Schema markup with option to disable +Updated mobile menu + +1.0.1 - Jun 27, 2020 +Added Site Title styling options +Added extra product image to WooCommerce products blocks +Minor CSS updates + +1.0 - Jun 10, 2020 +Initial release + +== Credits == +* Underscores - (C) 2012-2019 Automattic, Inc. - http://underscores.me +License: GPLv2 or later - https://www.gnu.org/licenses/gpl-2.0.html + +* normalize.css - (C) 2012-2015 Nicolas Gallagher and Jonathan Neal - http://necolas.github.io/normalize.css/ +License: MIT - http://opensource.org/licenses/MIT + +* Customizer Radio Image Control and sanitization - (C) WordPress Themes Team - https://github.com/WPTT/code-examples/ +License: GPL-2.0 - https://github.com/WPTT/code-examples/blob/master/LICENSE + +* TouchSwipe - jQuery Plugin - (C) 2010-2016 Matt Bryson - https://github.com/mattbryson/TouchSwipe-Jquery-Plugin +License: GPLv2 or later - https://www.gnu.org/licenses/gpl-2.0.html + +== Images == + +Images used in screenshot and block patterns + +https://stocksnap.io/photo/train-station-6FHSE43K4R +Copyright: Matthew Henry - https://stocksnap.io/author/200 +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/pretty-woman-DN2O01D5X7 +Copyright: Bruce Mars - https://stocksnap.io/author/brucemars +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/abstract-background-C7E4WYWEHZ +Copyright: Bob Richards - https://stocksnap.io/author/bobrichards +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/women-working-Y61SKQCFE8 and https://stocksnap.io/photo/sandwich-plate-M9SLUDGRNT +Copyright: Kristin Hardwick - https://stocksnap.io/author/kristinhardwick +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/wireless-headphones-EXCBJA3FFQ +Copyright: Burst - https://stocksnap.io/author/burstshopify +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/sea-ocean-MTWZM3YK68 +Copyright: Khachik Simonian - https://stocksnap.io/author/52498 +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/mountains-road-0BJXEHZBXK +Copyright: Andrew James Kovalsky - https://stocksnap.io/author/drewjamesphoto +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/paris-landmark-NDGTKGCAZB +Copyright: Matt Moloney - https://stocksnap.io/author/mattmoloney +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/nature-landscape-PIX0SSJ72A +Copyright: Carl Cerstrand - https://stocksnap.io/author/26742 +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/steak-asparagus-JMJZKYXUWD +Copyright: Snapwire - https://stocksnap.io/author/snapwire +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/food-asiancuisine-RZUWVKLQAR +Copyright: Yevgeniy Rozenblat - https://stocksnap.io/author/yevgeniyrozenblat +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +https://stocksnap.io/photo/corn-salad-407JYVPIPO +Copyright: Foodie Girl - https://stocksnap.io/author/foodiegirl +License: CC0 Creative Commons - https://stocksnap.io/license - https://creativecommons.org/publicdomain/zero/1.0/ + +Setting Screwdriver Icon - https://aiconica.net/detail/setting-418 +License: CC0 Creative Commons - http://creativecommons.org/publicdomain/zero/1.0/ + +Photo Camera Modern Icon - https://aiconica.net/detail/camera-18 +License: CC0 Creative Commons - http://creativecommons.org/publicdomain/zero/1.0/ + +Rocket Icon - https://aiconica.net/detail/rocket-845 +License: CC0 Creative Commons - http://creativecommons.org/publicdomain/zero/1.0/ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..1c90a5e Binary files /dev/null and b/screenshot.png differ diff --git a/search.php b/search.php new file mode 100644 index 0000000..a8cf2aa --- /dev/null +++ b/search.php @@ -0,0 +1,62 @@ + + + + +
    +
    + + + + + +
    + + + + + + + + +
    + + '', + 'next_text' => '', + ) ); ?> + + + + + + + +
    +
    + + + + + + diff --git a/sidebar-page.php b/sidebar-page.php new file mode 100644 index 0000000..356b088 --- /dev/null +++ b/sidebar-page.php @@ -0,0 +1,15 @@ + + +
    > + +
    diff --git a/sidebar-shop-filters.php b/sidebar-shop-filters.php new file mode 100644 index 0000000..108819d --- /dev/null +++ b/sidebar-shop-filters.php @@ -0,0 +1,24 @@ + + +
    + +
    +
    + +
    +
    diff --git a/sidebar-shop.php b/sidebar-shop.php new file mode 100644 index 0000000..8119aaf --- /dev/null +++ b/sidebar-shop.php @@ -0,0 +1,15 @@ + + +
    > + +
    diff --git a/sidebar.php b/sidebar.php new file mode 100644 index 0000000..788619a --- /dev/null +++ b/sidebar.php @@ -0,0 +1,15 @@ + + +
    > + +
    diff --git a/single.php b/single.php new file mode 100644 index 0000000..6bba03b --- /dev/null +++ b/single.php @@ -0,0 +1,53 @@ + + + + +
    +
    + + + + + + '%title', + 'next_text' => '%title', + ) ); + } + + if ( !get_theme_mod( 'disable_related' ) ) { + get_template_part( 'content', 'related' ); + } + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) : + comments_template(); + endif; + ?> + + + +
    +
    + + + + + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..d8577eb --- /dev/null +++ b/style.css @@ -0,0 +1,5886 @@ +/* +Theme Name: Cordero +Theme URI: https://uxlthemes.com/theme/cordero/ +Author: UXL Themes +Author URI: https://uxlthemes.com +Description: Cordero is a WordPress theme with customizable accent color, header layout options including side header, support for the Gutenberg visual block editor and WooCommerce, block patterns including full width hero, featured services, and pricing table. Cordero also has three page templates including transparent header, a narrower Reading View post template, and schema.org SEO markup. +Version: 1.2.6 +Requires at least: 5 +Tested up to: 5.8 +Requires PHP: 5.6 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Text Domain: cordero +Tags: one-column, two-columns, left-sidebar, right-sidebar, grid-layout, block-patterns, block-styles, wide-blocks, custom-background, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready, footer-widgets, microformats, blog, news, e-commerce + +This theme, like WordPress, is licensed under the GPL. +*/ + +/*-------------------------------------------------------------- +# Normalize +--------------------------------------------------------------*/ +html{ + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +body{ + margin: 0; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary{ + display: block; + margin: 0; +} + +audio, +canvas, +progress, +video{ + display: inline-block; + vertical-align: baseline; +} + +audio:not([controls]){ + display: none; + height: 0; +} + +[hidden], +template{ + display: none; +} + +a{ + background-color: transparent; +} + +abbr[title]{ + border-bottom: 1px dotted; +} + +b, +strong{ + font-weight: bold; +} + +dfn{ + font-style: italic; +} + +mark{ + background: #ff0; + color: #313131; +} + +small{ + font-size: 80%; +} + +sub, +sup{ + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup{ + top: -0.5em; +} + +sub{ + bottom: -0.25em; +} + +img{ + border: 0; +} + +svg:not(:root){ + overflow: hidden; +} + +figure{ + margin: 0; +} + +hr{ + box-sizing: content-box; + height: 0; +} + +pre{ + overflow: auto; +} + +code, +kbd, +pre, +samp{ + font-family: monospace, monospace; + font-size: 1em; +} + +button, +input, +optgroup, +select, +textarea{ + color: inherit; + font: inherit; + margin: 0; +} + +button{ + overflow: visible; +} + +button, +select{ + text-transform: none; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"]{ + -webkit-appearance: button; + cursor: pointer; +} + +button[disabled], +html input[disabled]{ + cursor: default; +} + +button::-moz-focus-inner, +input::-moz-focus-inner{ + border: 0; + padding: 0; +} + +input{ + line-height: normal; +} + +input[type="checkbox"], +input[type="radio"]{ + box-sizing: border-box; + padding: 0; + margin-right: 10px; +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button{ + height: auto; +} + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration{ + -webkit-appearance: none; +} + +fieldset{ + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +legend{ + border: 0; + padding: 0; +} + +textarea{ + overflow: auto; +} + +optgroup{ + font-weight: bold; +} + +table{ + border-collapse: collapse; + border-spacing: 0; +} + +th{ + padding: 0.3em; + border: 1px solid #f1f1f1; + background: #fbfbfb; + font-weight: 500; + text-align: inherit; +} +td{ + padding: 0.3em; + border: 1px solid #f1f1f1; +} + +/*-------------------------------------------------------------- +# Typography +--------------------------------------------------------------*/ +body, +button, +input, +select, +textarea{ + color: #313131; + font-family: 'Work Sans', sans-serif; + font-size: 16px; + font-weight: 300; + line-height: 1.6; + transition: color .3s ease; +} + +h1, +h2, +h3, +h4, +h5, +h6{ + color: #313131; + font-family: 'Montserrat', sans-serif; + font-weight: normal; + line-height: 1.2; + margin: 0 0 .5em; + transition: color .3s ease; +} + +h1{ + font-size: 1.875em; +} + +h2{ + font-size: 1.75em; +} + +h3{ + font-size: 1.625em; +} + +h4{ + font-size: 1.5em; +} + +h5{ + font-size: 1.375em; +} + +h6{ + font-size: 1.125em; +} + +p{ + margin: 0 0 1em; +} + +dfn, +cite, +em, +i{ + font-style: italic; +} + +blockquote{ + border-left: 4px solid #313131; + padding-left: 1em; + margin: 0 0 1em; +} + +address{ + margin: 0 0 1em; +} + +pre{ + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 0.9375em; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} + +code{ + background-color: #f2f2f2; + padding: 0.125em 0.25em; +} + +code, +kbd, +tt, +var{ + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 0.9375em; +} + +abbr, +acronym{ + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins{ + background: #fff9c0; + text-decoration: none; +} + +big{ + font-size: 1.25em; +} + +/*-------------------------------------------------------------- +# Elements +--------------------------------------------------------------*/ +html{ + box-sizing: border-box; +} + +*, +*:before, +*:after{ /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ + box-sizing: inherit; +} + +body{ + background: #ffffff; /* Fallback for when there is no custom background color defined. */ +} + +blockquote{ + quotes: "" ""; + position: relative; +} + +q{ + quotes: "" ""; + position: relative; + padding: 0 0.75rem; +} + +hr{ + background-color: rgba(0,0,0,0.2); + border: 0; + height: 1px; + margin-bottom: 1em; +} + +ul, +ol{ + margin: 0 0 1em 1.25em; + padding: 0; +} + +ul{ + list-style: disc; +} + +ol{ + list-style: decimal; +} + +li > ul, +li > ol{ + margin-bottom: 0; + margin-left: 1em; +} + +li > ul{ + list-style: circle; +} + +dt{ + font-weight: bold; +} + +dd{ + margin: 0 1em 1em; +} + +img{ + height: auto; /* Make sure images are scaled correctly. */ + max-width: 100%; /* Adhere to container width. */ + vertical-align: middle; +} + +table{ + margin: 0 0 1em; + width: 100%; + border: 1px solid #f1f1f1; +} + +/*-------------------------------------------------------------- +# Forms +--------------------------------------------------------------*/ +.button, +a.button, +button, +input[type="button"], +input[type="reset"], +input[type="submit"], +#infinite-handle span button, +#infinite-handle span button:hover, +#infinite-handle span button:focus, +#infinite-handle span button:active, +.woocommerce #respond input#submit, +.woocommerce a.button, +.woocommerce button.button, +.woocommerce input.button, +.woocommerce #respond input#submit.alt, +.woocommerce a.button.alt, +.woocommerce button.button.alt, +.woocommerce input.button.alt, +.woocommerce a.added_to_cart, +.woocommerce #respond input#submit.alt.disabled, +.woocommerce #respond input#submit.alt.disabled:hover, +.woocommerce #respond input#submit.alt:disabled, +.woocommerce #respond input#submit.alt:disabled:hover, +.woocommerce #respond input#submit.alt:disabled[disabled], +.woocommerce #respond input#submit.alt:disabled[disabled]:hover, +.woocommerce a.button.alt.disabled, +.woocommerce a.button.alt.disabled:hover, +.woocommerce a.button.alt:disabled, +.woocommerce a.button.alt:disabled:hover, +.woocommerce a.button.alt:disabled[disabled], +.woocommerce a.button.alt:disabled[disabled]:hover, +.woocommerce button.button.alt.disabled, +.woocommerce button.button.alt.disabled:hover, +.woocommerce button.button.alt:disabled, +.woocommerce button.button.alt:disabled:hover, +.woocommerce button.button.alt:disabled[disabled], +.woocommerce button.button.alt:disabled[disabled]:hover, +.woocommerce input.button.alt.disabled, +.woocommerce input.button.alt.disabled:hover, +.woocommerce input.button.alt:disabled, +.woocommerce input.button.alt:disabled:hover, +.woocommerce input.button.alt:disabled[disabled], +.woocommerce input.button.alt:disabled[disabled]:hover, +.woocommerce #respond input#submit:hover, +.woocommerce a.button:hover, +.woocommerce button.button:hover, +.woocommerce input.button:hover{ + font-weight: initial; + background: #d82978; + padding: .5em 1em; + color: #fff; + border: 0; + border-radius: 0; + line-height: 1.6; + height: auto; +} + +/* NEED RULES FOR WOOCOMMERCE BUTTONS ON HOVER. DON'T WANT DEFAULT WC BACKGROUND COLOR!!! */ +.woocommerce #respond input#submit:hover, +.woocommerce a.button:hover, +.woocommerce button.button:hover, +.woocommerce input.button:hover, +.woocommerce #respond input#submit.alt:hover, +.woocommerce a.button.alt:hover, +.woocommerce button.button.alt:hover, +.woocommerce input.button.alt:hover, +.woocommerce a.added_to_cart, +.woocommerce a.added_to_cart:hover{ + background: #d82978; +} + +.quantity input[type="button"]{ + width: 2.5em; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea{ + color: #313131; + background-color: #fbfbfb; + border: 1px solid #f1f1f1; + border-radius: 0; + transition:all 0.3s ease-in-out; + -moz-transition:all 0.3s ease-in-out; + -webkit-transition:all 0.3s ease-in-out; + height: auto; + width: 100%; +} + +select{ + border: 1px solid #f1f1f1; + padding: .5em 40px .5em .75em; + background-color: #fbfbfb; + background-image: url("images/down-arrow.svg"); + background-position: right center; + background-position: calc(100% - .75em) center; + background-repeat: no-repeat; + background-size: 1em; + position: relative; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + border-radius: 0; +} +select::-ms-expand { + display: none; +} +select:focus{ + background-image: url("images/up-arrow.svg"); +} + +input[type="button"]:focus, +input[type="reset"]:focus, +input[type="submit"]:focus{ + outline: 1px dotted #313131; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus, +select:focus{ + border: 1px solid #313131; + background-color: #fbfbfb; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"]{ + padding: .5em 1em; +} + +textarea{ + padding: .5em 1em; + width: 100%; + min-height: 100px; +} + +input[type="search"]{ + width: auto; + max-width: 100%; +} + +/*-------------------------------------------------------------- +## Links +--------------------------------------------------------------*/ +a{ + color: #d82978; + text-decoration: none; +} + +a:visited{ + opacity: 0.8; +} + +a.button, +.single-entry-content a.button{ + color: #fff; + display: inline-block; + text-decoration: none; +} + +a.button:focus{ + outline: 1px dotted #313131; +} + +a.read-more{ + font-size: 0.875em; +} + +a.more-tag{ + display: block; + font-size: 0.875em; + position: relative; +} + +.tag-read-more a.more-tag{ + display: inline-block; + margin-bottom: 10px; +} + +/*-------------------------------------------------------------- +# Accessibility +--------------------------------------------------------------*/ +/* Text meant only for screen readers. */ +.screen-reader-text{ + clip: rect(1px, 1px, 1px, 1px); + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; +} + +.screen-reader-text:focus{ + background-color: #f1f1f1; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0,0,0,0.6); + clip: auto !important; + color: #21759b; + display: block; + font-size: 14px; + font-size: 0.875em; + font-weight: bold; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; /* Above WP toolbar. */ +} + +/*-------------------------------------------------------------- +# Alignments +--------------------------------------------------------------*/ +.alignleft{ + display: inline; + float: left; + margin-right: 1.5em; +} + +.alignright{ + display: inline; + float: right; + margin-left: 1.5em; +} + +.aligncenter{ + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} + +/*-------------------------------------------------------------- +# Clearings +--------------------------------------------------------------*/ +.clearfix:before, +.clearfix:after, +.entry-content:before, +.entry-content:after, +.comment-content:before, +.comment-content:after, +.site-header:before, +.site-header:after, +.site-content:before, +.site-content:after, +.site-footer:before, +.site-footer:after, +.nav-links:before, +.nav-links:after{ + content: ""; + display: table; +} + +.clearfix:after, +.entry-content:after, +.comment-content:after, +.site-header:after, +.site-content:after, +.site-footer:after, +.nav-links:after{ + clear: both; +} + +/*-------------------------------------------------------------- +# Widgets +--------------------------------------------------------------*/ +.widget{ + margin: 0 0 30px; +} + +.widget ul{ + list-style: none; + margin: 0; + padding: 0; +} + +.widget ul ul{ + margin-left: 10px; +} + +.widget .post-date{ + font-size: 80%; + color: #bbb; + padding-right: 50%; + white-space: nowrap; +} + +#colophon .widget{ + margin: 0; +} + +/* Make sure select elements fit in widgets. */ +.widget select{ + max-width: 100%; +} + +/* Search widget. */ +.widget_search .search-submit{ + display: none; +} + +/*-------------------------------------------------------------- +## Posts and pages +--------------------------------------------------------------*/ +#grid-loop, +#main .infinite-wrap{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 3%; + grid-row-gap: 1em; +} + + + +#main.post-columns-1 #grid-loop, +.related-posts.post-columns-1 #grid-loop, +#main.post-columns-1 .infinite-wrap{ + grid-template-columns: 100%; +} + +#main.post-columns-2 #grid-loop, +.related-posts.post-columns-2 #grid-loop, +#main.post-columns-2 .infinite-wrap{ + grid-template-columns: repeat(2,48.5%); +} + +#main.post-columns-3 #grid-loop, +.related-posts.post-columns-3 #grid-loop, +#main.post-columns-3 .infinite-wrap{ + grid-template-columns: repeat(3,31.333%); +} + +#main.post-columns-4 #grid-loop, +.related-posts.post-columns-4 #grid-loop, +#main.post-columns-4 .infinite-wrap{ + grid-template-columns: repeat(4,22.75%); +} + + + + +.woocommerce ul.products, +.woocommerce-page ul.products{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 1%; + grid-row-gap: 1em; +} + +.woocommerce ul.products.columns-1, +.woocommerce-page ul.products.columns-1{ + grid-template-columns: 100%; +} + +.woocommerce ul.products.columns-2, +.woocommerce-page ul.products.columns-2{ + grid-template-columns: 49.5% 49.5%; +} + +.woocommerce ul.products.columns-3, +.woocommerce-page ul.products.columns-3{ + grid-template-columns: repeat(3,32.666666%); +} + +.woocommerce ul.products.columns-4, +.woocommerce-page ul.products.columns-4{ + grid-template-columns: repeat(4,24.25%); +} + +.woocommerce ul.products.columns-5, +.woocommerce-page ul.products.columns-5{ + grid-template-columns: repeat(5,19.2%); +} + +.woocommerce ul.products.columns-6, +.woocommerce-page ul.products.columns-6{ + grid-template-columns: repeat(6,15.833333%); +} + +.woocommerce ul.products.columns-7, +.woocommerce-page ul.products.columns-7{ + grid-template-columns: repeat(7,13.428571%); +} + +.woocommerce ul.products.columns-8, +.woocommerce-page ul.products.columns-8{ + grid-template-columns: repeat(8,11.625%); +} + +.hentry{ + margin: 0 0 1.5em; +} + +#grid-loop article, +#main .infinite-wrap article, +.woocommerce ul.products li.product, +.woocommerce-page ul.products li.product{ + margin: 0; + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1 1 auto; +} + +#grid-loop article, +#main .infinite-wrap article{ + margin: 0 0 1.5em; +} + +#grid-loop article .post-thumbnail img, +#main .infinite-wrap article .post-thumbnail img{ + width: 100%; +} + +.woocommerce ul.products li.product, +.woocommerce-page ul.products li.product{ + text-align: center; + background: #fbfbfb; + border: 1px solid #f1f1f1; +} + +.product-wrap{ + position: relative; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1 1 auto; +} + +#grid-loop article .entry-title, +#main .infinite-wrap article .entry-title{ + font-size: 1.25em; +} + +#grid-loop article.sticky:before, +#main .infinite-wrap article.sticky:before{ + content: ""; + display: block; + width: 3px; + height: 100%; + position: absolute; + left: -8px; + top: 0; + background: #d82978; +} + +.updated:not(.published){ + display: none; +} + +.page-links{ + clear: both; + margin: 0 0 1em; +} + +#primary{ + width: 72.5%; + float: left; +} + +.sidebar-left #primary{ + float: right; +} + +#secondary{ + width: 25%; + float: right; + margin-bottom: 2em; + background: #fbfbfb; +} + +#secondary th{ + background: rgba(0,0,0,.007); +} + +#secondary input, +#secondary td{ + background: #fff; +} + +.sidebar-left #secondary{ + float: left; +} + +#primary.full-width, +.sidebar-below #primary, +.sidebar-below #secondary, +.post-template-template-single-reading #secondary, +.post-template-template-single-reading-paragraph #secondary{ + width: auto; + float: none; +} + +.sidebar-below #secondary, +.post-template-template-single-reading #secondary, +.post-template-template-single-reading-paragraph #secondary{ + display: grid; + grid-column-gap: 2%; + grid-row-gap: 1em; + grid-template-columns: repeat(3,32%); +} + +article{ + position: relative; + margin-bottom: 1.25em; +} + +#primary > #main > article{ + margin-bottom: 0; +} + +.container.entry-header{ + padding: 0; +} + +.entry-header{ + text-align: left; + margin-bottom: 5px; + overflow: hidden; +} + +.single .entry-header, +.page-header, +.archive-header{ + padding-bottom: 1em; +} + +.entry-header .entry-title, +.archive-header .archive-title{ + -ms-word-wrap: break-word; + word-wrap: break-word; +} + +.title-meta-wrapper{ + position: relative; +} + +.entry-excerpt, +.taxonomy-description{ + text-align: center; +} + +.post-thumbnail{ + margin-bottom: 1em; +} + +.entry-content p{ + -ms-word-wrap: break-word; + word-wrap: break-word; +} + +.single-excerpt, +.archive-description, +.entry-meta{ + margin: 1em 0; +} + +.entry-meta, +.entry-footer{ + font-size: 0.875em; + font-style: normal; +} + +.entry-footer .tags-links, +.entry-footer .edit-link{ + display: block; + clear: both; +} + +.entry-footer span.tags-links{ + margin-top: 0.625em; +} + +.entry-meta .author img, +.entry-footer .author img{ + border-radius: 50%; + margin-right: 2rem; +} + +.archive-title .author img{ + border-radius: 50%; + display: block; + margin: 0 auto 1rem; + border: 2px solid rgba(255,255,255,.5); +} + +.archive.author .archive-description{ + margin: 0 0 1em; +} + +.single .entry-footer{ + margin: 1em 0; + padding: .5em 0; + border-top: 1px solid; + border-bottom: 1px solid; + border-color: rgba(0,0,0,.05); +} + +.single .related-posts .entry-footer{ + margin: 0; + padding: 0; + border: none; +} + +ul.archive-sub-cats{ + list-style: none; + margin-left: 0; +} + +ul.archive-sub-cats li{ + display: inline-block; + margin-right: 1em; + margin-bottom: .75em; + padding: .5em 1em; + background: #fbfbfb; + border: 1px solid #f1f1f1; +} + +.meta-separator{ + padding: 0 .5em; +} + +.post-template-template-single-reading .entry-header.single, +.post-template-template-single-reading-paragraph .entry-header.single{ + text-align: center; +} + +.post-template-template-single-reading .single-entry-content{ + max-width: 640px; + margin-left: auto; + margin-right: auto; +} + +.post-template-template-single-reading-paragraph .single-entry-content p{ + max-width: 640px; + margin-left: auto; + margin-right: auto; +} + +/*-------------------------------------------------------------- +## Asides +--------------------------------------------------------------*/ +aside{ + color: #313131; +} + +aside input, +aside button{ + margin-top: 2px; +} + +.shop-filter-wrap{ + margin: 0 0 20px; + clear: both; +} + +.shop-filter-wrap .shop-filter-toggle{ + display: inline-block; + cursor: pointer; + position: relative; + border: 1px solid #f1f1f1; + padding: .5em 2.5em .5em 1em; + background-color: #fbfbfb; +} + +.shop-filter-wrap .shop-filter-toggle.active{ + margin-bottom: 10px; +} + +.shop-filter-wrap .shop-filter-toggle .toggle-icon{ + position: relative; +} + +#shop-filters{ + display: none; + background: #fbfbfb; + padding: 1em; + width: 100%; + table-layout: fixed; +} + +.shop-filter-wrap #shop-filters.active{ + display: table; +} + +#shop-filters aside{ + background: transparent; + display: table-cell; + width: 100%; + position: relative; + border-right: 1px solid #fff; +} + +#shop-filters aside:last-child{ + border-right: none; +} + +#shop-filters aside a{ + color: #313131; +} + +#shop-filters .widget{ + margin: 0; + padding: 10px; +} + +.shop-filters-widget-title{ + position: relative; + font-size: 1em; + margin-bottom: 10px; +} + +#shop-filters li{ + width: 32.333333%; + min-width: 120px; + margin-right: 1%; + float: left; +} + +#shop-filters form{ + max-width: 240px; +} + +#shop-filters button{ + padding: 0 1em; + line-height: 1.75em; + height: 1.75em; + font-size: 1em; +} + + +#shop-filters .customize-partial-edit-shortcut button, +#shop-filters .widget .customize-partial-edit-shortcut button{ + height: 30px; + font-size: 18px; + padding: 3px; +} + +#shop-filters input[type="text"]{ + height: 1.5em; +} + +.sidebar-widget-title, +.page-sidebar-widget-title, +.shop-sidebar-widget-title{ + position: relative; + padding-bottom: .625em; + margin-bottom: .3125em; + font-size: 1.25em; + text-align: left; +} + +.widget-area ul{ + list-style: none; + padding: 0; + margin: 0; +} + +.widget-area ul ul{ + margin-top: .3125em; +} + +.widget-area ul ul li{ + padding-left: .625em; +} + +.widget-area ul ul li:last-child{ + border-bottom: 0; + padding-bottom: 0; +} + +.widget-area li{ + margin: 0 0 7px 0; +} + +.widget-area .widget{ + padding: 2em; + margin-bottom: 1px; +} + +.widget-area .widget.widget_image{ + padding: .33em; + margin-bottom: 1.5em; +} + +.widget-area form{ + margin-top: 1.25em; +} + +/*-------------------------------------------------------------- +## Comments +--------------------------------------------------------------*/ +article.comment-body{ + background: #fbfbfb; + padding: 1.5em; +} + +.comment-content a{ + -ms-word-wrap: break-word; + word-wrap: break-word; +} + +.bypostauthor{ + display: block; +} + +.author-email-url{ + margin-left: -2%; +} + +.comment-form-author{ + float: left; + width: 32%; +} +.comment-form-email, +.comment-form-url{ + float: left; + margin-left: 2% !important; + width: 32%; +} + +.author-email-url input{ + width: 100%; +} + +.comment-form .form-submit{ + clear: both; +} + +#comments{ + margin-bottom: 25px; +} + +.logged-in-as, +.comment-notes{ + font-size: .875em; +} + +#comments ul{ + list-style: none; + margin: 0; + padding: 0; +} + +#comments li.comment{ + margin: 0 0 20px; +} + +#comments li.comment .children{ + display: block; + margin: 20px 0 0 30px; + padding: 0px; + list-style: none; +} + +.comment-list .comment-respond{ + margin-top: 20px; + border: 1px solid #EEE; + padding: 20px; +} + +.comment-list .vcard img{ + border-radius: 50%; + margin-right: 10px; +} + +.comment-list .vcard .fn{ + font-weight: normal; + font-size: 1em; +} + +.comment-list .edit-link{ + position: absolute; + top: 0; + left: auto; +} + +.comment-list .edit-link a{ + font-size: .875em; + display: inline-block; + padding: 10px; +} + +.comment-list .comment-meta{ + margin-bottom: 15px; +} + +.comment-list .comment-author{ + display: inline-block; + margin-right: 1em; +} + +.comment-list .comment-author .says{ + display: none; +} + +.comment-list .comment-metadata{ + display: inline-block; + padding-top: 10px; + font-size: .875em; +} + +.comment-list .comment-metadata a{ + text-decoration: none; +} + +.comment-list .reply{ + display: inline-block; +} + +.comment-list .reply a{ + text-decoration: none; +} + +#cancel-comment-reply-link{ + float: right; +} + +.comment-navigation .nav-previous a, +.comment-navigation .nav-next a{ + display: inline-block; + padding: 0 10px; + font-size: .875em; + line-height: 22px; + position: relative; +} + +.comment-navigation .nav-next a{ + margin-right: 13px; +} + +.comment-navigation .nav-next a:after{ + content: ""; + position: absolute; + border-left: 11px solid #fbfbfb; + border-top: 11px solid transparent; + border-bottom: 11px solid transparent; + top: 0; + right: -11px; +} + +.comment-navigation .nav-previous a{ + margin-left: 11px; +} + +.comment-navigation .nav-previous a:after{ + content: ""; + position: absolute; + border-right: 11px solid #fbfbfb; + border-top: 11px solid transparent; + border-bottom: 11px solid transparent; + top: 0; + left: -11px; +} + +/*-------------------------------------------------------------- +# Related Posts +--------------------------------------------------------------*/ + +.related-posts{ + margin: 0 0 30px 0; +} + +.related-posts #grid-loop article .entry-content{ + padding-bottom: 10px; +} + +/*-------------------------------------------------------------- +# Media +--------------------------------------------------------------*/ +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley{ + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +/* Make sure embeds and iframes fit their containers. */ +embed, +iframe, +object{ + max-width: 100%; +} + +.entry-video{ + position: relative; + padding-bottom: 56.25%; + height: 0; +} + +#grid-loop article .entry-video, +#main .infinite-wrap article .entry-video{ + overflow: hidden; + margin-bottom: 1em; +} + +.entry-video embed, +.entry-video iframe, +.entry-video object, +.entry-video video{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/*-------------------------------------------------------------- +## Captions +--------------------------------------------------------------*/ +.wp-caption{ + margin-bottom: 15px; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"]{ + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption .wp-caption-text{ + margin: 0.8075em 0; +} + +.wp-caption-text{ + background: #fbfbfb; + border: 1px solid #f1f1f1; + text-align: center; + font-size: 1em; +} + +/*-------------------------------------------------------------- +## Galleries +--------------------------------------------------------------*/ +.gallery{ + margin-bottom: 1em; +} + +.gallery-item{ + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item{ + max-width: 50%; +} + +.gallery-columns-3 .gallery-item{ + max-width: 33.33%; +} + +.gallery-columns-4 .gallery-item{ + max-width: 25%; +} + +.gallery-columns-5 .gallery-item{ + max-width: 20%; +} + +.gallery-columns-6 .gallery-item{ + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item{ + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item{ + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item{ + max-width: 11.11%; +} + +.gallery-caption{ + display: block; + margin: 0 10px 10px 10px; +} + +/*-------------------------------------------------------------- +## General +--------------------------------------------------------------*/ +.container{ + width: 96%; + max-width: 1240px; + margin: 0 auto; +} + +.site-content{ + position: relative; + margin-top: 2em; +} + +.post-template-template-single-transparent-header .site-content, +.post-template-template-no-title .site-content, +.page-template-template-transparent-header .site-content, +.page-template-template-no-title .site-content, +.home.page-template-default .site-content{ + margin-top: 0; +} + +/*-------------------------------------------------------------- +## Header +--------------------------------------------------------------*/ +#masthead{ + background-color: #fff; + background-repeat: no-repeat; + background-position: top center; + background-size: cover; + color: #2d2354; + margin: 0 auto; + padding: 0; + width: 100%; + transition: all .7s ease; +} + +#masthead.transparent{ + background-color: transparent; + color: #fff; + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 999; +} + +#masthead.scrolled{ + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06); + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 999; + transition: all .7s ease; +} + +#masthead.not-fixed.not-fixed-scrolled{ + position: absolute; +} + +#masthead.transparent.scrolled{ + background-color: #2d2354; +} + +.logged-in.admin-bar #masthead.scrolled{ + top: 32px; +} + +#masthead #masthead-inner{ + display: grid; + align-items: center; + padding: 1.25rem 0; + transition: padding .5s; +} + +#masthead.scrolled #masthead-inner{ + padding: .625rem 0 0.3125rem 0; + transition: padding 1s; +} + +#masthead #masthead-inner.logo-left{ + grid-template-columns: minmax(auto,25%) auto auto; +} + +#masthead #masthead-inner.logo-right{ + grid-template-columns: auto auto minmax(auto,25%); +} + +#site-branding{ + grid-column: 1/4; + text-align: center; +} + +.logo-left #site-branding{ + grid-column: 1/2; + text-align: left; +} + +.logo-right #site-branding{ + grid-column: 3/4; + text-align: right; +} + +.toggle-nav{ + grid-column: 1/4; + justify-self: center; + display: none; +} + +.toggle-nav-open{ + display: none; +} + +#site-navigation{ + grid-column: 1/4; + justify-self: center; + font-weight: normal; + color: #2d2354; + display: flex; +} + +#site-nav-after{ + display: none; + background-color: #000; + opacity: 0.4; +} + +.logo-left #site-navigation{ + grid-column: 2/4; + justify-self: end; +} + +.logo-right #site-navigation{ + grid-column: 1/3; + justify-self: start; +} + +#masthead.transparent #site-navigation{ + color: #fff; +} + +#site-navigation a{ + color: #2d2354; + text-decoration: none; +} + +#masthead.transparent #site-navigation a{ + color: #fff; +} + +#top-bar{ + display: block; + margin: 0; + padding: 10px 0; + border-bottom: 1px solid rgba(0,0,0,.05); + font-size: .75em; + line-height: 1.6; + transition: padding .5s; +} + +#masthead.transparent #top-bar{ + border-color: rgba(255,255,255,.05); +} + +#top-bar aside, +#top-bar h1, +#top-bar h2, +#top-bar h3, +#top-bar h4, +#top-bar h5, +#top-bar h6{ + color: #2d2354; +} + +#masthead.transparent #top-bar aside, +#masthead.transparent #top-bar h1, +#masthead.transparent #top-bar h2, +#masthead.transparent #top-bar h3, +#masthead.transparent #top-bar h4, +#masthead.transparent #top-bar h5, +#masthead.transparent #top-bar h6{ + color: #fff; +} + +#masthead.scrolled #top-bar{ + padding: 5px 0; + transition: padding 1s; +} + +.top-bar-widget-title{ + margin: 0; + font-size: 1.2em; +} + +#top-bar a.button, #top-bar a.button:hover, +#top-bar button, #top-bar input[type="button"], #top-bar input[type="reset"], #top-bar input[type="submit"], +#top-bar input[type="text"], #top-bar input[type="email"], #top-bar input[type="url"], #top-bar input[type="password"], #top-bar input[type="search"], #top-bar input[type="number"], #top-bar input[type="tel"], #top-bar input[type="range"], #top-bar input[type="date"], #top-bar input[type="month"], #top-bar input[type="week"], #top-bar input[type="time"], #top-bar input[type="datetime"], #top-bar input[type="datetime-local"], #top-bar input[type="color"], #top-bar textarea{ + height: auto; + padding: .125em .3125em; + font-size: .75em; + line-height: .75em; + margin: 2px 0; + max-width: 160px; +} + +#top-bar p, +#top-bar .widget, +#top-bar .widget p{ + margin: 0; + padding: 0; + background: transparent; +} + +#top-bar .widget{ + display: inline-block; + width: 48%; + vertical-align: top; +} + +#top-bar .widget:nth-child(odd){ + text-align: left; + margin-right: 1%; +} +#top-bar .widget:nth-child(even){ + text-align: right; + margin-left: 1%; +} + +#top-bar ul{ + position: relative; + list-style: none; +} + +#top-bar li{ + display: inline-block; + margin-left: 12px; +} + +#top-bar li:first-child{ + margin-left: 0; +} + +#top-bar ul > li > ul{ + display: none; + border: 1px; + border-style: solid; + border-color: rgba(255,255,255,0.1); + border-top: 0; + margin-top: 2px; +} + +#top-bar ul > li.menu-item-has-children:hover > ul{ + position: absolute; + display: block; + margin-left: 0; + text-align: left; + z-index: 101; +} +#top-bar ul > li.menu-item-has-children:hover > ul > li{ + display: block; + margin-left: 0; + padding: 5px; +} + +#top-bar ul > li.menu-item-has-children > ul > li.menu-item-has-children > ul, +#top-bar ul > li.menu-item-has-children > ul > li.menu-item-has-children > ul:hover{ + display: none; +} + +#masthead .extra-wrap{ + display: flex; + justify-content: center; +} + +#masthead .top-search{ + position: relative; + margin: 0; + padding: .625rem; +} + +#masthead .logo-right .top-search{ + margin-left: -1em; +} + +.top-search .cordero-icon-search{ + color: #2d2354; + background: transparent; + padding: 0; +} + +#masthead.transparent .top-search .cordero-icon-search{ + color: #fff; +} + +#masthead .top-search .icons.search-close{ + font-family: inherit; + font-size: 1em; + line-height: 1; + display: block; + text-align: center; + height: 0; + width: 0; + color: transparent; + background: transparent; + padding: 0; + margin-left: 1em; + padding-left: 2em; +} + +#site-navigation .menu-close{ + display: none; +} + +.top-search .search-close:before{ + position: absolute; + top: .25em; + left: 0; + font-family: dashicons; + font-size: 1.4em; + content: "\f158"; +} + +.top-search .cordero-icon-search:focus, +.top-search .search-close:focus, +#site-navigation .menu-close:focus{ + outline: 1px dotted; +} + +#masthead .top-search .icons.search-close:focus{ + height: auto; + width: auto; + color: #2d2354; + margin-top: 1em; + padding-top: .5em; + opacity: 1; +} + +.top-search .mini-search{ + position: absolute; + top: auto; + right: 0; + visibility: hidden; + opacity: 0; + padding: 10px; + background: #fff; + box-shadow: 0 3px 8px 1px rgba(0, 0, 0, 0.1); + z-index: 99999; + transform: translateY(30px); + transition: all .3s ease; +} + +.logo-right .top-search .mini-search{ + right: auto; + left: 0; +} + +.top-search.search-open .mini-search{ + visibility: visible; + opacity: 1; + transform: translateY(0); + transition: all .3s ease; +} + +#masthead .search-form, +#masthead .woocommerce-product-search{ + width: 320px; + max-width: 100%; +} + +#masthead .search-form input[type="submit"], +#masthead .woocommerce-product-search button[type="submit"]{ + position: relative; + display: inline-block; + border: 0; + box-shadow: none; + transition: none; +} + +#masthead .search-form input[type="submit"]:focus, +#masthead .woocommerce-product-search button[type="submit"]:focus{ + outline: 1px dotted #000; +} + +#masthead .search-form input[type="search"], +#masthead .woocommerce-product-search input[type="search"]{ + display: inline-block; + width: 220px; + border: none; + background: transparent; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +#masthead .search-form input[type="search"]::placeholder, +#masthead .woocommerce-product-search input[type="search"]::placeholder{ + opacity: .6; +} + +#masthead .top-account{ + position: relative; + margin: 0; + padding: .625rem; +} + +#masthead .top-account .mini-account{ + position: absolute; + top: auto; + right: 0; + text-align: left; + font-size: 90%; + padding: 10px; + min-width: 240px; + max-height: 480px; + overflow: auto; + visibility: hidden; + opacity: 0; + z-index: 99999; + transform: translateY(40px); + background: #fff; + box-shadow: 0 3px 8px 1px rgba(0, 0, 0, 0.1); + color: #313131; + transition: all 0.3s ease; +} + +#masthead .logo-right .top-account .mini-account{ + right: auto; + left: 0; +} + +#masthead .top-account .mini-account a, +#masthead.transparent #site-navigation .top-account .mini-account a{ + color: #d82978; +} + +.woocommerce .top-account .col2-set .col-1, +.woocommerce-page .top-account .col2-set .col-1, +.woocommerce .top-account .col2-set .col-2, +.woocommerce-page .top-account .col2-set .col-2{ + float: none; + width: 100%; +} + +.top-account #customer_login .u-column2{ + margin-top: .8em; + border-top: 1px solid rgba(255,255,255,.3); +} + +.top-account h2{ + position: relative; + font-size: 1.15em; + text-transform: none; + margin: 0 0 .8em; +} + +.top-account #customer_login .u-column2 h2{ + margin-top: .8em; + cursor: pointer; +} + +.top-account #customer_login .u-column2 h2:after{ + font-family: dashicons; + content: "\f347"; + font-size: 1em; + text-shadow: none; + position: absolute; + top: 0; + right: 0; +} + +.top-account #customer_login .u-column2.open h2:after{ + content: "\f343"; +} + +.top-account #customer_login .u-column2 form{ + display: none; +} + +.top-account #customer_login .u-column2.open form{ + display: block; +} + +.top-account p{ + margin: 0 0 7px; +} + +.top-account input{ + padding: .25em .5em; +} + +.top-account .woocommerce-MyAccount-navigation{ + width: 100%; +} + +.top-account form .form-row .required{ + color: red; +} + +.woocommerce .top-account form .form-row .required{ + visibility: hidden; + transition: all .7s; + transition-delay: 1s; +} +.woocommerce .top-account:hover .mini-account form .form-row .required{ + visibility: visible; + transition-delay: 0s; +} + +div.mini-account form.login{ + border: none; + padding: 0; + margin: 0; +} + +div.mini-account .form-row, +div.mini-account .form-row-first, +span.mini-account .form-row-last{ + width: 100%; + float: left; +} + +.top-account .woocommerce-form__label-for-checkbox{ + padding: 20px 0 10px 0; + margin-left: 0; + display: block; +} + +.top-account .woocommerce-form__label-for-checkbox span{ + font-size: 90%; +} + +.top-account input#rememberme.woocommerce-form__input.woocommerce-form__input-checkbox{ + height: 10px; + margin-right: 0; +} + +#masthead .top-wishlist{ + position: relative; + margin: 0; + padding: .625rem; +} + +#masthead .top-cart{ + position: relative; + margin: 0; + padding: .625rem; +} + +#masthead .top-cart .mini-cart{ + position: absolute; + top: auto; + right: 0; + text-align: left; + font-size: 90%; + padding: 10px; + min-width: 240px; + max-height: 480px; + overflow: auto; + visibility: hidden; + opacity: 0; + z-index: 99999; + transform: translateY(40px); + background: #fff; + box-shadow: 0 3px 8px 1px rgba(0, 0, 0, 0.1); + color: #313131; + transition: all 0.3s ease; +} + +#masthead .logo-right .top-cart .mini-cart{ + right: auto; + left: 0; +} + +#masthead .top-cart .mini-cart a, +#masthead.transparent .top-cart .mini-cart a:not(.button), +#masthead.transparent #site-navigation .top-cart .mini-cart a:not(.button){ + color: #d82978; +} + +#masthead .top-cart .mini-cart a.button{ + color: #fff; +} + +#masthead .top-cart .mini-cart p{ + margin: 0; +} + +#masthead .top-cart .mini-cart .woocommerce-mini-cart__buttons .button{ + display: block; + text-align: center; + margin-top: 10px; +} + +#masthead .top-account:hover .mini-account, +#masthead .top-account .mini-account.locked, +#masthead .top-cart:hover .mini-cart, +#masthead .top-account a:focus ~ .mini-account, +#masthead .top-cart a:focus ~ .mini-cart{ + top: auto; + visibility: visible; + opacity: 1; + transform: translateY(0); + transition: all .3s ease; +} + +#masthead .top-cart .mini-cart ul.cart_list{ + list-style: none; + padding: 0; + margin: 0; +} + +#masthead .top-cart .mini-cart ul.cart_list li:after, #masthead .top-cart .mini-cart ul.cart_list li:before, #masthead .top-cart .mini-cart ul.product_list_widget li:after, #masthead .top-cart .mini-cart ul.product_list_widget li:before{ + content: ' '; + display: table; +} + +#masthead .top-cart .mini-cart ul.cart_list li:after{ + clear: both; +} + +#masthead .top-cart .mini-cart ul.cart_list li{ + padding: 4px 0; + margin: 0; + list-style: none; +} + +#masthead .top-cart .mini-cart ul.cart_list li a{ + display: block; +} + +#masthead .top-cart .mini-cart a.remove{ + display: block; + font-size: 2em; + height: 1em; + width: 1em; + text-align: center; + line-height: 1; + border-radius: 100%; + color: red !important; + text-decoration: none; + border: 0; + float: right; + opacity: 0.7; +} + +#masthead .top-cart .mini-cart a.remove:hover{ + color: #fff !important; + background: red; + opacity: 1; +} + +#masthead .top-cart .mini-cart ul.cart_list li img{ + float: right; + margin-left: 4px; + width: 42px; + height: auto; + box-shadow: none; +} + +#masthead .top-cart .mini-cart li.empty{ + list-style: none; + text-align: center; +} + +#masthead .top-cart .mini-cart dt{ + font-weight: normal; +} + +#masthead .top-cart .mini-cart dd{ + margin: 0 0 0 10px; +} + +#masthead a.cordero-cart{ + position: relative; + margin-right: 10px; +} + +#masthead a.cordero-wishlist{ + position: relative; + margin-right: 10px; +} + +#masthead a.cordero-cart .item-count, +#masthead a.cordero-wishlist .wishlist_products_counter_number, +#masthead a.wishlist_products_counter .wishlist_products_counter_number{ + position: absolute; + top: -0.75em; + left: auto; + line-height: 1; +} + +#site-branding h1, +#site-branding p, +#site-branding .custom-logo{ + margin: 0 0 .4em; + padding: 0; + line-height: 1.2; + transition: all .7s ease; +} + +#masthead.scrolled #site-branding h1, +#masthead.scrolled #site-branding p, +#masthead.scrolled #site-branding .custom-logo{ + margin-bottom: .2em; + transition: all .7s ease; +} + +.site-title{ + font-family: 'Montserrat'; + font-size: 2.4em; + font-weight: normal; + text-align: center; +} + +#masthead-inner.logo-left .site-title{ + text-align: left; +} + +#masthead-inner.logo-right .site-title{ + text-align: right; +} + +.site-title a, +.site-title a:hover, +.site-title a:active, +.site-title a:focus{ + text-decoration: none; + color: #2d2354; + padding: 0 .25em; +} + +#masthead.transparent .site-title a, +#masthead.transparent .site-title a:hover, +#masthead.transparent .site-title a:active, +#masthead.transparent .site-title a:focus{ + color: #fff; +} + +#site-branding.stfls .site-title:first-letter, +#site-branding.stfls .site-title::first-letter{ + background: #2d2354; + color: #fff; + border-radius: .1em; + padding: 0 .2em; + margin: 0 .04em 0 0; + letter-spacing: 0; +} + +#masthead.transparent #site-branding.stfls .site-title:first-letter, +#masthead.transparent #site-branding.stfls .site-title::first-letter{ + background: #fff; + color: #2d2354; +} + +#site-branding.border .site-title a{ + border: 3px solid; +} + +#site-branding.border .site-title a:focus{ + outline: 1px dotted; +} + +#site-branding.stfls .site-title a, +#site-branding.no-styling .site-title a{ + border: none; + padding: 0; +} + +#site-branding.background .site-title a{ + border: none; + border-radius: .1em; + background: #2d2354; + color: #fff; +} + +#masthead.transparent #site-branding.background .site-title a{ + background: #fff; + color: #2d2354; +} + +.site-description{ + clear: both; +} + +.tagline-hidden .site-description{ + clip: rect(1px, 1px, 1px, 1px); + position: absolute; +} + +.masthead-block{ + background: transparent; + height: 70px; +} + +@media (min-width: 1025px){ + .masthead-left #masthead{ + background: #fbfbfb; + width: 250px; + height: 100vh; + position: fixed; + top: 0; + left: 0; + right: auto; + z-index: 99; + } + + .masthead-left #content, + .masthead-left #colophon{ + width: calc(100% - 250px); + margin-left: 250px; + } + + .masthead-left #masthead #masthead-inner{ + display: block; + } + + .masthead-left #site-navigation{ + flex-direction: column; + } + + .masthead-left #primary-menu li{ + float: none; + } + + .masthead-left #primary-menu ul{ + left: 20px; + } + + .masthead-left .top-search .mini-search, + .masthead-left #masthead .top-account .mini-account, + .masthead-left #masthead .top-cart .mini-cart{ + right: auto; + left: 0; + } + + .masthead-left #top-bar .widget{ + display: block; + width: 100%; + text-align: center; + } + + .masthead-left #top-bar .widget:nth-child(2n+1){ + text-align: center; + margin-right: 0; + } + + .masthead-left #primary.full-width .entry-content .alignfull{ + margin-left: -webkit-calc(-50vw + 50% + 125px); + margin-left: calc(-50vw + 50% + 125px); + margin-right: -webkit-calc(-50vw + 50% + 125px); + margin-right: calc(-50vw + 50% + 125px); + max-width: calc(100vw - 250px); + width: calc(100vw - 250px); + } +} + +@media (max-width: 1024px){ + .masthead-left #masthead-inner{ + justify-items: start; + } + + .masthead-left #site-branding{ + grid-column: 2/3; + } + + .masthead-left .toggle-nav{ + grid-column: 1; + grid-row: 1; + justify-self: left; + } +} + +/*-------------------------------------------------------------- +## Menu +--------------------------------------------------------------*/ +.toggle-nav, +.toggle-nav-open{ + font-size: 32px; + background: transparent; + color: #2d2354; + cursor: pointer; + width: 32px; + padding: 0; + line-height: 1; +} + +.toggle-nav-open{ + margin: 0 auto; + padding: 10px 2px; +} + +#masthead.transparent .toggle-nav{ + color: #fff; +} + +.toggle-nav:hover, +.toggle-nav-open:hover{ + background: transparent; +} + +.toggle-nav:focus, +.toggle-nav-open:focus{ + outline: 1px dotted; +} + +#primary-menu{ + margin: 0; +} + +#primary-menu li{ + float: left; + position: relative; + list-style: none; +} + +#primary-menu > li{ + text-transform: uppercase; +} + +#primary-menu li a{ + display: block; + text-decoration: none; + padding: .625rem 1em; + transition: color .3s ease; +} + +#masthead.transparent #primary-menu li a{ + color: #fff; +} + +#masthead.transparent #primary-menu ul li a{ + color: #2d2354; +} + +#primary-menu li.menu-item-has-children a{ + padding-right: 1.5em; +} + +#primary-menu:hover li a{ + opacity: .7; + transition: opacity .3s ease; +} + +#primary-menu li:hover a, +#primary-menu li a:hover{ + opacity: 1; + transition: opacity .3s ease; +} + +#primary-menu ul{ + position: absolute; + visibility: hidden; + opacity: 0; + background: #fff; + color: #2d2354; + box-shadow: 0 3px 8px 1px rgba(0, 0, 0, 0.1); + min-width: 180px; + text-align: left; + top: 140%; + margin: 0; + z-index: 99999; + transition: all 0.3s ease; +} + +#primary-menu li.menu-item-has-children.locked > ul, +#primary-menu li.menu-item-has-children:hover > ul, +#primary-menu li.menu-item-has-children a:focus ~ ul{ + visibility: visible; + opacity: 1; + top: 100%; + transition: all 0.3s ease; +} +#primary-menu ul li{ + width: 100%; + background: none; + text-transform: none; +} +#primary-menu ul li a{ + position: relative; + overflow: hidden; +} + +#primary-menu li.menu-item-has-children:hover > ul:hover li a{ + opacity: .7; + transition: opacity .3s ease; +} +#primary-menu li.menu-item-has-children:hover > ul li:hover a, +#primary-menu li.menu-item-has-children:hover > ul li a:hover{ + opacity: 1; + transition: opacity .3s ease; +} + +#primary-menu ul li.menu-item-has-children ul, +#primary-menu ul li.menu-item-has-children ul, +#primary-menu ul li.menu-item-has-children.locked ul, +#primary-menu ul li.menu-item-has-children:hover ul, +#primary-menu ul li.menu-item-has-children a:focus ~ ul{ + left: 100%; + top: 5px; +} + +.sub-menu li{ + border-bottom: 1px solid rgba(255,255,255,0.1); +} + +.sub-menu li:last-child{ + border: 0; +} + +#primary-menu li.menu-item-has-children .sub-menu a{ + color: #2d2354; + padding-top: 20px; + padding-bottom: 20px; + margin: 0; + transition: all 0.3s ease; +} + +#primary-menu li.menu-item-has-children:hover .sub-menu a{ + padding-top: 8px; + padding-bottom: 8px; + transition: all 0.3s ease; +} + +.menu-item-has-children .sub-trigger{ + display: none; +} + +.page-links, +.comments-pagination{ + margin-bottom: 1em; +} + +.page-links a, +.comments-pagination .page-numbers{ + padding: 0 .5em; +} + +.posts-navigation, +.post-navigation{ + padding: 1em 0; + margin: 0 0 2em 0; + overflow: hidden; +} + +.posts-navigation .nav-previous, +.post-navigation .nav-previous{ + float: left; + width: 50%; +} + +.posts-navigation .nav-next, +.post-navigation .nav-next{ + float: right; + text-align: right; + width: 50%; +} + +/*-------------------------------------------------------------- +## Footer +--------------------------------------------------------------*/ +#colophon{ + color: #fff; + background-color: #2d2354; + background-repeat: no-repeat; + background-size: cover; +} + +#colophon aside{ + background: transparent; + color: #fff; +} + +.site-footer ul{ + list-style: none; + padding: 0; + margin: 0; +} + +.site-footer ul ul{ + margin-left: 10px; +} + +.site-footer a{ + color: #d82978; +} + +.top-footer-widget-title, +.footer-column-widget-title{ + color: #fff; + position: relative; + margin-bottom: 1em; +} + +#top-footer{ + border-bottom: 1px solid rgba(255,255,255,.05) +} + +#top-footer .container{ + padding-top: 1.5em; + padding-bottom: 1.5em; +} + +#middle-footer{ + padding: 1.5em 0 0; + border-bottom: 1px solid rgba(255,255,255,.05) +} + +#middle-footer .container{ + padding-bottom: 2em; +} + +.middle-footer{ + margin-left: -3%; +} + +.footer{ + float: left; + width: 30.3333333333%; + margin-left: 3%; +} + +#bottom-footer{ + padding: 1.5em 0; + line-height: 1.2; +} + +#bottom-footer .container{ + display: flex; + align-items: center; + justify-content: space-between; +} + +#bottom-footer.centered .container, +#bottom-footer.centered-info-below .container{ + flex-direction: column; + text-align: center; +} + +#bottom-footer.centered .site-info{ + margin-bottom: 2em; +} + +#bottom-footer.centered-info-below .site-info{ + margin-top: 2em; +} + +.site-info .copyright{ + margin-bottom: 0.5em; +} + +.site-info .sep{ + opacity: .4; +} + +.site-info-right, +#footer-menu ul{ + list-style-type: none; + list-style: none; + list-style-image: none; + line-height: 32px; +} +#footer-menu li{ + padding: 0 8px; + display: inline; +} + +#footer-menu a, +.widget_nav_menu a{ + position: relative; +} + +#footer-menu a[href*="facebook.com"], +.widget_nav_menu a[href*="facebook.com"], +#footer-menu a[href*="instagram.com"], +.widget_nav_menu a[href*="instagram.com"], +#footer-menu a[href*="twitter.com"], +.widget_nav_menu a[href*="twitter.com"], +#footer-menu a[href*="youtube.com"], +.widget_nav_menu a[href*="youtube.com"], +#footer-menu a[href^="mailto:"], +.widget_nav_menu a[href^="mailto:"], +#footer-menu a[href$="/feed/"], +.widget_nav_menu a[href$="/feed/"]{ + font-size: 1px; + letter-spacing: -1px; + margin-right: 0px; + margin-left: 28px; + color: transparent; +} + +#footer-menu a[href^="tel:"], +.widget_nav_menu a[href^="tel:"]{ + margin-right: 0px; + margin-left: 31px; +} + +#footer-menu a[href*="facebook.com"]:before, +.widget_nav_menu a[href*="facebook.com"]:before, +#footer-menu a[href*="instagram.com"]:before, +.widget_nav_menu a[href*="instagram.com"]:before, +#footer-menu a[href*="twitter.com"]:before, +.widget_nav_menu a[href*="twitter.com"]:before, +#footer-menu a[href*="youtube.com"]:before, +.widget_nav_menu a[href*="youtube.com"]:before{ + font-family: dashicons; + font-weight: normal; + text-align: center; + position: absolute; + font-size: 20px; + letter-spacing: normal; + width: 32px; + height: 32px; + line-height: 32px; + border-radius: 100%; + top: -20px; + right: 0; + color: #fff; +} + +#footer-menu a[href^="mailto:"]:before, +.widget_nav_menu a[href^="mailto:"]:before, +#footer-menu a[href$="/feed/"]:before, +.widget_nav_menu a[href$="/feed/"]:before{ + font-family: dashicons; + font-weight: 900; + text-align: center; + position: absolute; + font-size: 20px; + letter-spacing: normal; + width: 32px; + height: 32px; + line-height: 32px; + border-radius: 100%; + top: -20px; + right: 0; + color: #fff; +} + +#footer-menu a[href^="tel:"]:before, +.widget_nav_menu a[href^="tel:"]:before{ + font-family: dashicons; + font-weight: 900; + text-align: center; + position: absolute; + font-size: 20px; + letter-spacing: normal; + width: 32px; + height: 32px; + line-height: 32px; + border-radius: 100%; + top: -6px; + left: -36px; + color: #fff; +} + +#footer-menu a[href*="facebook.com"]:before, +.widget_nav_menu a[href*="facebook.com"]:before{ + content: "\f305"; + background: #3b5998; +} +#footer-menu a[href*="instagram.com"]:before, +.widget_nav_menu a[href*="instagram.com"]:before{ + content: "\f12d"; + background: #f04857; +} +#footer-menu a[href*="twitter.com"]:before, +.widget_nav_menu a[href*="twitter.com"]:before{ + content: "\f301"; + background: #1da1f2; +} +#footer-menu a[href*="youtube.com"]:before, +.widget_nav_menu a[href*="youtube.com"]:before{ + content: "\f236"; + background: #ff0000; +} +#footer-menu a[href^="mailto:"]:before, +.widget_nav_menu a[href^="mailto:"]:before{ + content: "\f465"; + background: #d82978; +} +#footer-menu a[href^="tel:"]:before, +.widget_nav_menu a[href^="tel:"]:before{ + content: "\f525"; + background: #d82978; +} +#footer-menu a[href$="/feed/"]:before, +.widget_nav_menu a[href$="/feed/"]:before{ + content: "\f303"; + background: #fd9800; +} + +/*-------------------------------------------------------------- +## Pagination CSS +--------------------------------------------------------------*/ +.pagination{ + text-align: center; + margin: 2em 0; +} + +.pagination span, +.pagination .dots, +.pagination a{ + background: #fbfbfb; + border: 1px solid #f1f1f1; + padding: .67rem 1.33rem; + color: #313131; + text-decoration: none; +} + +.pagination a:hover, +.pagination .current{ + background: transparent; + border-color: inherit; +} + +/*-------------------------------------------------------------- +## WooCommerce CSS +--------------------------------------------------------------*/ +.woocommerce nav.woocommerce-pagination{ + text-align: center; + margin: 2em 0; +} + +.woocommerce nav.woocommerce-pagination ul{ + border: 0; + margin: 0; + padding: 0; +} + +.woocommerce nav.woocommerce-pagination ul li{ + border: 0; + float: none; + margin: 0; +} + +.woocommerce nav.woocommerce-pagination ul li a, +.woocommerce nav.woocommerce-pagination ul li span{ + background: #fbfbfb; + border: 1px solid #f1f1f1; + padding: .67rem 1.33rem; + line-height: 2.68; + color: #313131; + display: unset; +} + +.woocommerce nav.woocommerce-pagination ul li a:focus, +.woocommerce nav.woocommerce-pagination ul li a:hover, +.woocommerce nav.woocommerce-pagination ul li span.current{ + background: transparent; + border-color: inherit; +} + +.single.single-product .quantity .input-text.qty.text, +.p-quantity .input-text.qty.text, +.woocommerce .quantity .qty{ + -moz-appearance: textfield; + -webkit-appearance: textfield; +} + +.single.single-product .quantity .input-text.qty.text::-webkit-outer-spin-button, +.p-quantity .input-text.qty.text::-webkit-outer-spin-button, +.woocommerce .quantity .qty::-webkit-outer-spin-button, +.single.single-product .quantity .input-text.qty.text::-webkit-inner-spin-button, +.p-quantity .input-text.qty.text::-webkit-inner-spin-button, +.woocommerce .quantity .qty::-webkit-inner-spin-button{ + -webkit-appearance: none; + margin: 0; +} + +.woocommerce .woocommerce-breadcrumb{ + color: #313131; + opacity: .8; + text-align: center; + margin-bottom: 2em; +} + +.woocommerce-products-header{ + display: flex; + align-items: center; +} + +.woocommerce .term-description{ + margin: 0; + padding: 0 0 0 4em; +} + +.woocommerce .woocommerce-result-count{ + margin: .7em 0 1em; +} + +.woocommerce div.product, +.woocommerce-page div.product{ + overflow: hidden; +} + + +.woocommerce ul.products li.product, +.woocommerce-page ul.products li.product, +.woocommerce ul.products.columns-2 li.product, +.woocommerce-page ul.products.columns-2 li.product, +.woocommerce ul.products.columns-3 li.product, +.woocommerce-page ul.products.columns-3 li.product, +.woocommerce ul.products.columns-4 li.product, +.woocommerce-page ul.products.columns-4 li.product, +.woocommerce ul.products.columns-5 li.product, +.woocommerce-page ul.products.columns-5 li.product, +.woocommerce ul.products.columns-6 li.product, +.woocommerce-page ul.products.columns-6 li.product, +.woocommerce ul.products.columns-7 li.product, +.woocommerce-page ul.products.columns-7 li.product, +.woocommerce ul.products.columns-8 li.product, +.woocommerce-page ul.products.columns-8 li.product{ + width: auto; + overflow: hidden; +} + +.woocommerce ul.products li.product .product-extra-img, +.woocommerce-page ul.products li.product .product-extra-img{ + visibility: hidden; + opacity: 0; + position: absolute; + top: 0; + left: 0; + right: 0; + overflow: hidden; + z-index: 8; + transition: all .5s ease-in; +} + +.woocommerce ul.products li.product:hover .product-extra-img, +.woocommerce-page ul.products li.product:hover .product-extra-img{ + visibility: visible; + opacity: 1; + transition: all .5s ease-out; +} + +.woocommerce .product-addtocart-wrap{ + border-top: 1px solid #f1f1f1; +} + +.woocommerce ul.products li.product .woocommerce-loop-category__title, +.woocommerce ul.products li.product .woocommerce-loop-product__title, +.woocommerce ul.products li.product h3{ + padding: 0; + margin: 0 0 .5em; + font-size: 1.125em; +} + +.woocommerce ul.products li.product .woocommerce-placeholder{ + border: none; +} + +.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist{ + left: auto; + right: 10px; +} + +.yith-wcwl-add-button > a i{ + margin-right: 0; + font-size: .875em; +} + +.woocommerce ul.products li.product .woocommerce-loop-category__title mark.count{ + display: none; +} + +.woocommerce div.product div.images .flex-control-thumbs li img{ + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + user-select: none; +} + +.woocommerce div.product p.price, +.woocommerce div.product span.price, +.woocommerce div.product .stock, +.woocommerce ul.products li.product .price{ + color: #313131; + transition: color .3s ease; +} + +.woocommerce ul.products li.product .price{ + font-size: 1em; + font-weight: 300; +} + +.woocommerce div.product p.price, +.woocommerce div.product span.price, +.woocommerce div.product .stock{ + font-size: 1.25em; +} + +.woocommerce ul.products li.product .price ins, +.woocommerce div.product p.price ins, +.woocommerce div.product span.price ins{ + font-weight: 400; +} + +.product .product_meta > span{ + position: relative; + display: block; + margin-bottom: 10px; +} + +.quantity.hidden .minus, +.quantity.hidden .plus{ + display: none; +} + +#add_payment_method .cart-collaterals .cart_totals .discount td, +.woocommerce-cart .cart-collaterals .cart_totals .discount td, +.woocommerce-checkout .cart-collaterals .cart_totals .discount td{ + color: #d82978; +} + +.woocommerce span.onsale, +.woocommerce ul.products li.product .onsale{ + background-color: #d82978; + margin: 0; + padding: .25em .5em; + top: 0; + left: 0; + right: auto; + font-weight: normal; + min-width: auto; + min-height: auto; + line-height: 2em; + border-radius: 0; +} + +.woocommerce span.onsale{ + font-size: 1em; +} + +.woocommerce ul.products li.product .onsale{ + font-size: .857em; +} + +.woocommerce div.product form.cart .variations select{ + display: block; + width: 100%; +} + +.woocommerce .products .star-rating{ + margin: .5em auto .5em; +} + +.woocommerce .product-addtocart-wrap a.button, +.woocommerce .product-addtocart-wrap a.button:hover, +.woocommerce .product-addtocart-wrap a.added_to_cart, +.woocommerce .product-addtocart-wrap a.added_to_cart:hover{ + background: transparent; + color: #d82978; + padding: 0; + margin: 0 0 1em 0; +} + +.woocommerce .product-addtocart-wrap .add_to_cart_button, +.woocommerce .product-addtocart-wrap a.added_to_cart{ + position: relative; +} + +.woocommerce .product-addtocart-wrap .product_type_simple.add_to_cart_button, +.woocommerce .product-addtocart-wrap .product_type_simple.add_to_cart_button:hover{ + padding-left: 1.25em; +} + +.woocommerce .product-addtocart-wrap .button.product_type_variable, +.woocommerce .product-addtocart-wrap .button.product_type_variable:hover{ + padding-right: 1em; +} + +.woocommerce .product-addtocart-wrap .product_type_simple.add_to_cart_button:before, +.woocommerce .product-addtocart-wrap .product_type_simple.add_to_cart_button:hover:before{ + position: absolute; + top: 0; + left: 0; + font-family: 'dashicons'; + content: "\f174"; + display: block !important; +} + +.woocommerce .product-addtocart-wrap .button.product_type_variable:before, +.woocommerce .product-addtocart-wrap .button.product_type_variable:hover:before{ + position: absolute; + top: .05em; + right: 0; + font-family: 'dashicons'; + content: "\f345"; + display: block !important; +} + +.woocommerce .product-addtocart-wrap a.added_to_cart, +.woocommerce .product-addtocart-wrap a.added_to_cart:hover{ + padding-left: 1.25em; + margin-top: 1em; + font-weight: 600; +} + +.woocommerce .product-addtocart-wrap a.added_to_cart:before{ + position: absolute; + top: .05em; + left: 0; + font-family: 'dashicons'; + font-weight: normal; + content: "\f177"; +} + +/*.woocommerce .product-addtocart-wrap .product_type_simple.add_to_cart_button:hover:before, +.woocommerce .product-addtocart-wrap .product_type_variable.add_to_cart_button:hover:before{ + display: none; +}*/ + +.woocommerce ul.products li.product .button.add_to_cart_button.added{ + display: none; +} + +.woocommerce-error{ + border-color: #b81c23; +} + +.woocommerce-info, +.woocommerce-message{ + border-color: #d82978; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs{ + padding: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs:before, +.woocommerce div.product .woocommerce-tabs ul.tabs li:after, +.woocommerce div.product .woocommerce-tabs ul.tabs li:before{ + border-width: 1px; + border-color: inherit; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:after, +.woocommerce div.product .woocommerce-tabs ul.tabs li:before{ + bottom: -6px; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:before{ + border-bottom-right-radius: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:after{ + border-bottom-left-radius: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li{ + padding: .5rem 1rem .25rem; + border-width: 1px; + border-bottom-width: 0; + background: #fbfbfb; + border-color: #f1f1f1; + margin-left: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child{ + margin-left: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li.active{ + background: #fff; + border-color: inherit; +} + +.woocommerce #respond input#submit.disabled, +.woocommerce #respond input#submit:disabled, +.woocommerce #respond input#submit:disabled[disabled], +.woocommerce a.button.disabled, +.woocommerce a.button:disabled, +.woocommerce a.button:disabled[disabled], +.woocommerce button.button.disabled, +.woocommerce button.button:disabled, +.woocommerce button.button:disabled[disabled], +.woocommerce input.button.disabled, +.woocommerce input.button:disabled, +.woocommerce input.button:disabled[disabled]{ + padding: 0 20px; +} + +.woocommerce table.shop_attributes, +.woocommerce table.shop_attributes th, +.woocommerce table.shop_attributes td{ + border-width: 0; +} + +.woocommerce table.shop_attributes td{ + padding: 0.3em; +} + +.woocommerce table.shop_attributes tr:nth-child(2n) td{ + background: transparent; +} + +.woocommerce table.shop_attributes tr td, +.woocommerce table.shop_attributes tr th{ + border-bottom: 1px solid rgba(0,0,0,.1); +} + +.woocommerce table.shop_attributes tr:last-child td, +.woocommerce table.shop_attributes tr:last-child th{ + border-bottom: none; +} + +.woocommerce .widget_price_filter .ui-slider .ui-slider-range, +.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{ + background-color: #d82978; +} + +.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{ + width: 1.2em; + height: 1.2em; + top: -.45em; +} + +.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content{ + background-color: rgba(0,0,0,.1); +} + +.woocommerce .widget_price_filter .ui-slider-horizontal{ + height: .3em; +} + +#top-footer ul.product_list_widget:after{ + content: ""; + display: table; +} + +#top-footer ul.product_list_widget:after{ + clear: both; +} + + +#top-footer ul.product_list_widget li{ + float: left; + width: 16.666666%; + margin-bottom: 10px; +} + +#top-footer ul.product_list_widget li:nth-child(6n+1){ + clear: both; +} + +#top-footer ul.product_list_widget li img{ + float: left; + width: 48px; + margin-right: 10px; +} + +.woocommerce ins{ + background: transparent; +} + +.woocommerce div.product form.cart div.quantity{ + float: none; + margin: 0; +} + +.woocommerce div.product form.cart div.quantity input[type="button"]{ + background-color: #fbfbfb; + border: 1px solid #f1f1f1; + color: inherit; + font-weight: 700; +} + +.woocommerce div.product form.cart .button{ + float: none; + width: 100%; + margin-top: 1em; +} + +section.up-sells.products, +section.related.products{ + clear: both; +} + +.woocommerce-MyAccount-navigation ul{ + list-style: none; + margin-left: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li a{ + position: relative; + display: block; + padding: .25em 0 .5em; + color: inherit; + font-weight: inherit; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{ + font-weight: 400; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{ + color: inherit; +} + +/* +## fix for WC products when using 'grid' layout +## standard WC is content: ' '; +## which causes issues with first item +*/ +.woocommerce .products ul::after, +.woocommerce .products ul::before, +.woocommerce ul.products::after, +.woocommerce ul.products::before, +.woocommerce-page ul.products::after, +.woocommerce-page ul.products::before{ + content: none; +} + +.product-template-single-product-image-after.woocommerce #content div.product div.images, +.product-template-single-product-image-after.woocommerce div.product div.images, +.product-template-single-product-image-after.woocommerce-page #content div.product div.images, +.product-template-single-product-image-after.woocommerce-page div.product div.images, +.product-template-single-product-image-after-tabs-inline.woocommerce #content div.product div.images, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product div.images, +.product-template-single-product-image-after-tabs-inline.woocommerce-page #content div.product div.images, +.product-template-single-product-image-after-tabs-inline.woocommerce-page div.product div.images{ + float: right; +} + +.product-template-single-product-image-after.woocommerce #content div.product div.summary, +.product-template-single-product-image-after.woocommerce div.product div.summary, +.product-template-single-product-image-after.woocommerce-page #content div.product div.summary, +.product-template-single-product-image-after.woocommerce-page div.product div.summary, +.product-template-single-product-image-after-tabs-inline.woocommerce #content div.product div.summary, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product div.summary, +.product-template-single-product-image-after-tabs-inline.woocommerce-page #content div.product div.summary, +.product-template-single-product-image-after-tabs-inline.woocommerce-page div.product div.summary{ + float: left; +} + +.product-template-single-product-image-after.woocommerce div.product div.images .woocommerce-product-gallery__trigger, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product div.images .woocommerce-product-gallery__trigger{ + right: auto; + left: .5em; +} + +.product-template-single-product-image-after.woocommerce .onsale, +.product-template-single-product-image-after-tabs-inline.woocommerce .onsale{ + left: auto; + right: 0; +} + +.product-template-single-product-wide-image.woocommerce #content div.product div.images, +.product-template-single-product-wide-image.woocommerce div.product div.images, +.product-template-single-product-wide-image.woocommerce-page #content div.product div.images, +.product-template-single-product-wide-image.woocommerce-page div.product div.images, +.product-template-single-product-wide-image.woocommerce #content div.product div.summary, +.product-template-single-product-wide-image.woocommerce div.product div.summary, +.product-template-single-product-wide-image.woocommerce-page #content div.product div.summary, +.product-template-single-product-wide-image.woocommerce-page div.product div.summary, +.product-template-single-product-wide-image-after.woocommerce #content div.product div.images, +.product-template-single-product-wide-image-after.woocommerce div.product div.images, +.product-template-single-product-wide-image-after.woocommerce-page #content div.product div.images, +.product-template-single-product-wide-image-after.woocommerce-page div.product div.images, +.product-template-single-product-wide-image-after.woocommerce #content div.product div.summary, +.product-template-single-product-wide-image-after.woocommerce div.product div.summary, +.product-template-single-product-wide-image-after.woocommerce-page #content div.product div.summary, +.product-template-single-product-wide-image-after.woocommerce-page div.product div.summary{ + float: none; + width: 100%; +} + +.product-template-single-product-tabs-inline.woocommerce #content div.product .woocommerce-tabs, +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs, +.product-template-single-product-tabs-inline.woocommerce-page #content div.product .woocommerce-tabs, +.product-template-single-product-tabs-inline.woocommerce-page div.product .woocommerce-tabs{ + margin-top: 2em; +} + +.product-template-single-product-tabs-inline.woocommerce #content div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-tabs-inline.woocommerce-page #content div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-tabs-inline.woocommerce-page div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-image-after-tabs-inline.woocommerce #content div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-image-after-tabs-inline.woocommerce-page #content div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-image-after-tabs-inline.woocommerce-page div.product .woocommerce-tabs ul.tabs li{ + display: block; +} + +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li{ + border-bottom-width: 1px; + max-width: 100%; + margin-left: 0; + margin-bottom: 2px; +} + +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs::before, +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li::after, +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li::before, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs::before, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li::after, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li::before{ + border: none; +} + +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li a, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li a{ + padding: .25em 0 .25em; +} + +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li a::after, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li a::after{ + font-family: dashicons; + content: "\f347"; + font-size: 1.2em; + position: absolute; + top: 0; + right: 0; + box-shadow: none; +} + +.product-template-single-product-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li.active a::after, +.product-template-single-product-image-after-tabs-inline.woocommerce div.product .woocommerce-tabs ul.tabs li.active a::after{ + content: ""; +} + +/*-------------------------------------------------------------- +## Sticky Footer CSS +--------------------------------------------------------------*/ +html,body{ + height: 100%; +} + +#page.sticky-footer{ + position: relative; + min-height: 100%; +} + +#colophon.sticky-footer{ + position: absolute; + bottom: 0; + left: 0; + right: 0; +} + +/*-------------------------------------------------------------- +## Blocks CSS +--------------------------------------------------------------*/ +.site-content{ + overflow-x: hidden; +} + +.wp-block-latest-posts.is-grid{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 3%; + grid-row-gap: 2em; +} + +.wp-block-latest-posts.is-grid.columns-2{ + grid-template-columns: 48.5% 48.5%; +} + +.wp-block-latest-posts.is-grid.columns-3{ + grid-template-columns: repeat(3,31.333333%); +} + +.wp-block-latest-posts.is-grid.columns-4{ + grid-template-columns: repeat(4,22.75%); +} + +.wp-block-latest-posts.is-grid.columns-5{ + grid-column-gap: 2%; + grid-row-gap: 1.33em; + grid-template-columns: repeat(5,18.4%); +} + +.wp-block-latest-posts.is-grid.columns-6{ + grid-column-gap: 2%; + grid-row-gap: 1.33em; + grid-template-columns: repeat(6,15%); +} + +.wp-block-latest-posts.columns-2 li, +.wp-block-latest-posts.columns-3 li, +.wp-block-latest-posts.columns-4 li, +.wp-block-latest-posts.columns-5 li, +.wp-block-latest-posts.columns-6 li{ + width: 100%; +} + +@media (max-width: 768px){ + .wp-block-latest-posts.is-grid.columns-2, + .wp-block-latest-posts.is-grid.columns-3, + .wp-block-latest-posts.is-grid.columns-4, + .wp-block-latest-posts.is-grid.columns-5, + .wp-block-latest-posts.is-grid.columns-6{ + grid-column-gap: 3%; + grid-row-gap: 2em; + grid-template-columns: 48.5% 48.5%; + } +} + +@media (max-width: 480px){ + .wp-block-latest-posts.is-grid.columns-2, + .wp-block-latest-posts.is-grid.columns-3, + .wp-block-latest-posts.is-grid.columns-4, + .wp-block-latest-posts.is-grid.columns-5, + .wp-block-latest-posts.is-grid.columns-6{ + grid-template-columns: 100%; + } +} + +.wp-block-latest-posts.is-grid li{ + margin: 0; + display: flex; + flex-direction: column; + justify-content: space-between; +} + + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__featured-image > img{ + width: 100%; +} + +.wp-block-latest-posts.is-grid li > a{ + font-family: 'Montserrat'; + font-size: 1.25em; + font-weight: normal; + margin: 1rem 0 0 0; +} + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__post-date{ + font-size: .8125em; + margin: 0; + color: inherit; + opacity: .7; +} + +.wp-block-latest-posts.is-grid li .wp-block-latest-posts__post-excerpt{ + margin: 0 0 1em 0; +} + +.wp-block-group.has-background, +p.has-background{ + padding: 1em 1.5em; +} + +#primary.full-width .entry-content .alignfull{ + margin-left: -webkit-calc(-50vw + 50%); + margin-left: calc(-50vw + 50%); + margin-right: -webkit-calc(-50vw + 50%); + margin-right: calc(-50vw + 50%); + max-width: 100vw; + width: 100vw; +} + +.entry-content .alignfull, +.entry-content .alignwide{ + width: 100%; +} + +.wp-block-image.alignfull img, +.wp-block-image.alignwide img{ + max-width: 100%; + width: 100%; +} + +.wp-block-cover, +.wp-block-cover-image{ + background-color: #2d2354; + color: #fff; +} + +.wp-block-cover-image.alignfull > .wp-block-cover-image__inner-container > .wp-block-group, +.wp-block-cover.alignfull > .wp-block-cover__inner-container > .wp-block-group, +.wp-block-group.alignfull > .wp-block-group__inner-container > .wp-block-group{ + width: 96%; + max-width: 1240px; + margin: 0 auto; +} + +.wp-block-button__link{ + background-color: #d82978; + border-radius: 0; + font-size: 1em; + color: #fff; + margin-bottom: 1em; + padding: .5em 1em; +} + +.is-style-outline .wp-block-button__link{ + color: #313131; +} + +.wp-block-column > div{ + margin-bottom: 1em; +} + +.has-drop-cap:not(:focus)::first-letter{ + font-size: 6em; + font-weight: normal; + margin: 0.05em 0.1em 0 0; +} + +.has-drop-cap:not(:focus)::first-letter::after{ + content: ""; + display: table; + clear: both; +} + +.has-drop-cap:not(:focus)::after{ + padding: 0; +} + +hr.wp-block-separator{ + background-color: rgba(0,0,0,0.1); + border: 0; + height: 4px; + margin-bottom: 2em; + width: 20%; +} + +hr.wp-block-separator.extra-small, +hr.wp-block-separator.is-style-extra-small{ + width: 1em; + max-width: 100%; +} + +hr.wp-block-separator.small, +hr.wp-block-separator.is-style-small{ + width: 4em; + max-width: 100%; +} + +hr.wp-block-separator.medium, +hr.wp-block-separator.is-style-medium{ + width: 10em; + max-width: 100%; +} + +hr.wp-block-separator.large, +hr.wp-block-separator.is-style-large{ + width: 16em; + max-width: 100%; +} + +hr.wp-block-separator.extra-large, +hr.wp-block-separator.is-style-extra-large{ + width: 22em; + max-width: 100%; +} + +hr.wp-block-separator.huge, +hr.wp-block-separator.is-style-huge{ + width: 28em; + max-width: 100%; +} + +hr.wp-block-separator.align-left, +hr.wp-block-separator.is-style-align-left{ + margin-left: 0; +} + +hr.wp-block-separator.align-right, +hr.wp-block-separator.is-style-align-right{ + margin-right: 0; +} + +.wp-block-separator.is-style-wide{ + width: 100%; +} + +.wp-block-separator.is-style-dots{ + width: auto; +} + +.wp-block-separator.is-style-dots::before{ + font-size: 2em; + color: initial; +} + +.wp-block-quote{ + border-left: 4px solid; + padding: 0 0 0 1em; + margin: 0 0 1em; +} + +.wp-block-pullquote{ + border-left: none; + border-top: 4px solid; + border-bottom: 4px solid; + padding: 3em 0 3em 0; + margin: 0 0 1em; +} + +.wp-block-pullquote blockquote{ + border-left: none; +} + +.has-accent-color-color, +.wp-block-button__link.has-accent-color-color, +.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-color, +hr.wp-block-separator.has-accent-color-color{ + color: #d82978; +} + +.has-accent-color-background-color, +.wp-block-button__link.has-accent-color-background-color, +hr.wp-block-separator.has-accent-color-background-color, +.wp-block-cover-image.has-background-dim.has-accent-color-background-color, +.wp-block-cover.has-background-dim.has-accent-color-background-color{ + background-color: #d82978; +} + +.has-accent-color-2-color, +.wp-block-button__link.has-accent-color-2-color, +.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-2-color, +hr.wp-block-separator.has-accent-color-2-color{ + color: #2d2354; +} + +.has-accent-color-2-background-color, +.wp-block-button__link.has-accent-color-2-background-color, +hr.wp-block-separator.has-accent-color-2-background-color, +.wp-block-cover-image.has-background-dim.has-accent-color-2-background-color, +.wp-block-cover.has-background-dim.has-accent-color-2-background-color{ + background-color: #2d2354; +} + +.has-accent-color-3-color, +.wp-block-button__link.has-accent-color-3-color, +.wp-block-button.is-style-outline .wp-block-button__link.has-accent-color-3-color, +hr.wp-block-separator.has-accent-color-3-color{ + color: #fbfbfb; +} + +.has-accent-color-3-background-color, +.wp-block-button__link.has-accent-color-3-background-color, +hr.wp-block-separator.has-accent-color-3-background-color, +.wp-block-cover-image.has-background-dim.has-accent-color-3-background-color, +.wp-block-cover.has-background-dim.has-accent-color-3-background-color{ + background-color: #fbfbfb; +} + +.has-black-color, +.wp-block-button__link.has-black-color, +.wp-block-button.is-style-outline .wp-block-button__link.has-black-color, +hr.wp-block-separator.has-black-color{ + color: #000000; +} + +.has-black-background-color, +.wp-block-button__link.has-black-background-color, +hr.wp-block-separator.has-black-background-color, +.wp-block-cover-image.has-background-dim.has-black-background-color, +.wp-block-cover.has-background-dim.has-black-background-color{ + background-color: #000000; +} + +.has-white-color, +.wp-block-button__link.has-white-color, +.wp-block-button.is-style-outline .wp-block-button__link.has-white-color, +hr.wp-block-separator.has-white-color{ + color: #ffffff; +} + +.has-white-background-color, +.wp-block-button__link.has-white-background-color, +hr.wp-block-separator.has-white-background-color, +.wp-block-cover-image.has-background-dim.has-white-background-color, +.wp-block-cover.has-background-dim.has-white-background-color{ + background-color: #ffffff; +} + +.wp-block-columns{ + margin-bottom: 0; +} + +.has-tiny-font-size{ + font-size: 10px; +} + +.has-small-font-size{ + font-size: 13px; +} + +.has-normal-font-size{ + font-size: 16px; +} + +.has-medium-font-size{ + font-size: 24px; +} + +.has-large-font-size{ + font-size: 36px; +} + +.has-huge-font-size{ + font-size: 48px; +} + +.has-gigantic-font-size{ + font-size: 60px; +} + +.has-massive-font-size{ + font-size: 72px; +} + +@media (min-width:600px) and (max-width: 781px){ + .has-medium-font-size{ + font-size: 20px; + } + + .has-large-font-size{ + font-size: 27px; + } + + .has-huge-font-size{ + font-size: 36px; + } + + .has-gigantic-font-size{ + font-size: 45px; + } + + .has-massive-font-size{ + font-size: 54px; + } +} + +@media (max-width:599px){ + .has-medium-font-size{ + font-size: 18px; + } + + .has-large-font-size{ + font-size: 23px; + } + + .has-huge-font-size{ + font-size: 30px; + } + + .has-gigantic-font-size{ + font-size: 36px; + } + + .has-massive-font-size{ + font-size: 44px; + } +} + +/*-------------------------------------------------------------- +## Block Styles +--------------------------------------------------------------*/ + +.is-style-rc-1{ + border-radius: 1px; +} +.is-style-rc-2{ + border-radius: 2px; +} +.is-style-rc-3{ + border-radius: 3px; +} +.is-style-rc-4{ + border-radius: 4px; +} +.is-style-rc-5{ + border-radius: 5px; +} +.is-style-rc-6{ + border-radius: 6px; +} +.is-style-rc-7{ + border-radius: 7px; +} +.is-style-rc-8{ + border-radius: 8px; +} +.is-style-rc-9{ + border-radius: 9px; +} +.is-style-rc-10{ + border-radius: 10px; +} +.is-style-rc-11{ + border-radius: 11px; +} +.is-style-rc-12{ + border-radius: 12px; +} +.is-style-rc-13{ + border-radius: 13px; +} +.is-style-rc-14{ + border-radius: 14px; +} +.is-style-rc-15{ + border-radius: 15px; +} +.is-style-rc-16{ + border-radius: 16px; +} +.is-style-rc-17{ + border-radius: 17px; +} +.is-style-rc-18{ + border-radius: 18px; +} +.is-style-rc-19{ + border-radius: 19px; +} +.is-style-rc-20{ + border-radius: 20px; +} + +.is-style-content-width{ + width: max-content; + margin: 0; +} + +.is-style-content-width.has-background{ + padding: 0.125em; +} + +.is-style-content-width.has-text-align-left{ + margin: 0 auto 0 0; +} + +.is-style-content-width.has-text-align-center{ + margin: 0 auto; +} + +.is-style-content-width.has-text-align-right{ + margin: 0 0 0 auto; +} + +p.is-style-zero-margin, +h1.is-style-zero-margin, +h2.is-style-zero-margin, +h3.is-style-zero-margin, +h4.is-style-zero-margin, +h5.is-style-zero-margin, +h6.is-style-zero-margin{ + margin-top: 0; + margin-bottom: 0; +} + +.is-style-translucent{ + opacity: 0.8; +} + +.is-style-with-separator{ + display: flex; + align-items: center; +} + +.is-style-with-separator:after{ + display: block; + content: ""; + margin-left: .5em; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-right.is-style-with-separator:after{ + display: none; +} + +.has-text-align-right.is-style-with-separator:before{ + display: block; + content: ""; + margin-right: .5em; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator:before, +.has-text-align-center.is-style-with-separator:after{ + display: block; + content: ""; + border-bottom: 2px solid; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator:before{ + margin-right: .5em; +} + +.has-text-align-center.is-style-with-separator:after{ + margin-left: .5em; +} + +p.is-style-with-separator:after, +p.has-text-align-right.is-style-with-separator:before, +p.has-text-align-center.is-style-with-separator:before, +p.has-text-align-center.is-style-with-separator:after{ + border-bottom: 1px solid; +} + +.is-style-with-separator-2{ + display: flex; + align-items: center; +} + +.is-style-with-separator-2:after{ + display: block; + content: ""; + margin-left: .5em; + border: .125em solid; + border-radius: .125em; + flex-grow: 1; +} + +.has-text-align-right.is-style-with-separator-2:after{ + display: none; +} + +.has-text-align-right.is-style-with-separator-2:before{ + display: block; + content: ""; + margin-right: .5em; + border: .125em solid; + border-radius: .125em; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator-2:before, +.has-text-align-center.is-style-with-separator-2:after{ + display: block; + content: ""; + border: .125em solid; + border-radius: .125em; + flex-grow: 1; +} + +.has-text-align-center.is-style-with-separator-2:before{ + margin-right: .5em; +} + +.has-text-align-center.is-style-with-separator-2:after{ + margin-left: .5em; +} + +.wp-block-cover.is-style-no-padding, +.wp-block-cover-image.is-style-no-padding{ + padding: 0; +} + +.is-style-point-down{ + clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%); +} + +.is-style-point-up{ + clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%); +} + +.is-style-box-shadow{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-image.is-style-box-shadow{ + box-shadow: none; +} + +.wp-block-image.is-style-box-shadow img{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1); +} + +.wp-block-image.is-style-chevron-left img{ + clip-path: polygon(100% 0%, 75% 50%, 100% 100%, 25% 100%, 0% 50%, 25% 0%); +} + +.wp-block-image.is-style-chevron-right img{ + clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%); +} + +.wp-block-image.is-style-point-down, +.wp-block-image.is-style-point-up{ + clip-path: none; +} + +.wp-block-image.is-style-point-down img{ + clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%); +} + +.wp-block-image.is-style-point-up img{ + clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%); +} + +.wp-block-group.is-style-quote p:first-of-type, +.wp-block-group.is-style-quote p:last-of-type{ + position: relative; +} + +.wp-block-group.is-style-quote p:last-of-type{ + padding-bottom: .33em; +} + +.wp-block-group.is-style-quote p:first-of-type:before, +.wp-block-group.is-style-quote p:last-of-type:after{ + font-family: dashicons; + content: "\f122"; + display: inline-block; + position: relative; + font-size: 2em; + opacity: .25; +} + +.wp-block-group.is-style-quote p:first-of-type:before{ + top: 0; + right: -.33em; +} + +.wp-block-group.is-style-quote p:last-of-type:after{ + vertical-align: text-top; + transform: rotate(180deg); + top: .165em; + left: -.33em; +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-bordered .blocks-gallery-image, +.wp-block-gallery.is-style-bordered .blocks-gallery-item{ + border-radius: 10px; + padding: 10px; + background-color: rgba(0,0,0,0.1); +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image figure img, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item figure img, +.wp-block-gallery.is-style-bordered .blocks-gallery-image figure img, +.wp-block-gallery.is-style-bordered .blocks-gallery-item figure img{ + border-radius: 6px; +} + +.is-style-bordered .blocks-gallery-grid .blocks-gallery-image figcaption, +.is-style-bordered .blocks-gallery-grid .blocks-gallery-item figcaption, +.wp-block-gallery.is-style-bordered .blocks-gallery-image figcaption, +.wp-block-gallery.is-style-bordered .blocks-gallery-item figcaption{ + bottom: 10px; + width: calc(100% - 20px); + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +.is-style-box-shadow .blocks-gallery-grid, +.wp-block-gallery.is-style-box-shadow{ + box-shadow: none; +} + +.is-style-box-shadow .blocks-gallery-grid .blocks-gallery-image, +.is-style-box-shadow .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-box-shadow .blocks-gallery-image, +.wp-block-gallery.is-style-boc-shadow .blocks-gallery-item{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1); +} + +.is-style-framed .blocks-gallery-grid .blocks-gallery-image, +.is-style-framed .blocks-gallery-grid .blocks-gallery-item, +.wp-block-gallery.is-style-framed .blocks-gallery-image, +.wp-block-gallery.is-style-framed .blocks-gallery-item{ + padding: 5px; + border: 5px solid rgba(0,0,0,0.1); +} + +.is-style-framed .blocks-gallery-grid .blocks-gallery-image figcaption, +.is-style-framed .blocks-gallery-grid .blocks-gallery-item figcaption, +.wp-block-gallery.is-style-framed .blocks-gallery-image figcaption, +.wp-block-gallery.is-style-framed .blocks-gallery-item figcaption{ + bottom: 5px; + width: calc(100% - 10px); +} + +.wp-block-media-text.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(100% 0%,90% 100%,0% 100%,0% 0%); +} + +.wp-block-media-text.has-media-on-the-right.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(0% 0%,100% 0%,100% 100%,10% 100%); +} + +@media (max-width:599px){ + .wp-block-media-text.is-stacked-on-mobile.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(100% 0%,100% 90%,0% 100%,0% 0%); + } + + .wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right.is-style-angled-divider .wp-block-media-text__media{ + clip-path: polygon(0% 0%,100% 10%,100% 100%,0% 100%); + } +} + +.wp-block-media-text.is-style-inset-frame .wp-block-media-text__media{ + position: relative; +} + +.wp-block-media-text.is-style-inset-frame .wp-block-media-text__media:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); +} + +.wp-block-media-text.is-style-inset-frame.media-text-overlap-heading .wp-block-media-text__content, +.wp-block-media-text.is-style-inset-frame.is-style-media-text-overlap .wp-block-media-text__content{ + z-index: 1; +} + +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-image figure, +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-item figure, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-image figure, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-item figure{ + position: relative; +} + +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-image figure:after, +.is-style-inset-frame .blocks-gallery-grid .blocks-gallery-item figure:after, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-image figure:after, +.wp-block-gallery.is-style-inset-frame .blocks-gallery-item figure:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); +} + +.wp-block-cover.is-style-inset-frame, +.wp-block-cover-image.is-style-inset-frame{ + padding: 40px; +} + +.wp-block-cover.is-style-inset-frame:after, +.wp-block-cover-image.is-style-inset-frame:after{ + content: ""; + position: absolute; + top: 20px; + right: 20px; + bottom: 20px; + left: 20px; + border: 5px solid rgba(255, 255, 255, 0.3); + min-height: calc(100% - 40px); +} +/*-------------------------------------------------------------- +## Block Patterns +--------------------------------------------------------------*/ + +.featured-style-1 .wp-block-columns, +.wp-block-columns.featured-style-1{ + margin-top: 60px; +} + +.featured-style-1 .wp-block-columns .wp-block-column, +.wp-block-columns.featured-style-1 .wp-block-column{ + background-color: #fbfbfb; + padding-left: 1em; + padding-right: 1em; + border-radius: 6px; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.featured-style-1 .wp-block-image{ + margin-top: -60px; +} + +.featured-style-1 .wp-block-image figure{ + background-color: #2d2354; + padding: 1em; + border-radius: 50%; + box-shadow: 0px 0px 0px 4px rgba(45, 35, 84, 0.45); +} + +.wp-block-columns.pricing-table.has-featured{ + margin-top: 30px; +} + +.wp-block-columns.pricing-table .wp-block-column{ + background-color: #fbfbfb; + padding: 1em; + border-radius: 6px; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-columns.pricing-table .wp-block-column.is-featured{ + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.06); + transform: translateY(-30px); +} + +.wp-block-columns.pricing-table ul{ + list-style: none; + margin: 0; +} + +.wp-block-columns.pricing-table li{ + display: block; + margin-left: 2em; +} + +.wp-block-columns.pricing-table li:before{ + font-family: dashicons; + content: "\f147"; + font-size: 1.4em; + vertical-align: middle; + margin-right: 0.5em; + margin-left: -1.5em; +} + +.wp-block-columns.pricing-table div.wp-block-buttons{ + margin-bottom: 0; +} + +.wp-block-cover.has-overlap{ + padding-bottom: 120px; +} + +.wp-block-columns.overlap, +.wp-block-columns.pricing-table.has-featured.overlap{ + position: relative; + z-index: 9; + margin-top: -90px; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns:last-child{ + margin-bottom: 0; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18%; +} + +.features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78%; + margin-left: 4%; +} + +.wp-block-columns.with-offset{ + margin-top: 4em; +} + +.wp-block-columns.with-offset .wp-block-column.has-offset, +.wp-block-column.is-style-offset{ + margin-top: -4em; + margin-bottom: 4em; +} + +.wp-block-column.is-style-offset-box-shadow{ + margin-top: -4em; + margin-bottom: 4em; + box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.03); +} + +.wp-block-columns.without-gaps .wp-block-column:not(:first-child), +.wp-block-columns.is-style-no-spacing .wp-block-column:not(:first-child){ + margin-left: 0; +} + +.wp-block-gallery.without-gaps .blocks-gallery-item, +.wp-block-gallery.is-style-no-spacing .blocks-gallery-item{ + margin: 0 !important; +} + +.wp-block-media-text.food-menu-item .wp-block-media-text__content .wp-block-separator{ + margin-left: -25%; + margin-top: -28px; + height: 1px; + width: 45%; +} + +.wp-block-media-text.has-media-on-the-right.food-menu-item .wp-block-media-text__content .wp-block-separator{ + margin-left: 80%; +} + +.wp-block-cover.about-profile .wp-block-columns{ + margin-top: 2em; + margin-bottom: 2em; +} + +.about-profile .wp-block-column .wp-block-image{ + margin-bottom: 0; +} + +.about-profile .wp-block-column hr.wp-block-separator{ + width: 150%; + max-width: unset; +} + +.about-profile .wp-block-column .wp-block-social-links{ + margin-top: 2em; +} + +.wp-block-group.testimonial:before{ + font-family: dashicons; + font-size: 2.4em; + content: "\f122"; + color: #d82978; +} + +.wp-block-group.testimonial hr.wp-block-separator{ + margin-bottom: 1em; +} + +.media-text-overlap-heading.wp-block-media-text{ + -ms-grid-columns: 50% 1fr !important; + grid-template-columns: 50% 1fr !important; +} + +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right{ + -ms-grid-columns: 1fr 50% !important; + grid-template-columns: 1fr 50% !important; +} + +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h1:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h2:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h3:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h4:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h5:first-child, +.media-text-overlap-heading.wp-block-media-text .wp-block-media-text__content h6:first-child{ + width: 216%; + margin-left: -117.5%; + margin-top: 1em; +} + +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h1:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h2:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h3:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h4:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h5:first-child, +.media-text-overlap-heading.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content h6:first-child{ + margin-left: 0; + margin-right: -117.5%; +} + +.wp-block-media-text.is-image-fill.media-text-overlap, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap{ + margin-top: 60px; + margin-bottom: 60px; +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.media-text-overlap, +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.is-style-media-text-overlap{ + margin-top: 0; + margin-bottom: 90px; +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.media-text-overlap, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.is-style-media-text-overlap{ + margin-top: 90px; + margin-bottom: 0; +} + +.wp-block-media-text.is-image-fill.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap figure.wp-block-media-text__media{ + height: calc(100% + 120px); +} + +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-top.is-style-media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.media-text-overlap figure.wp-block-media-text__media, +.wp-block-media-text.is-image-fill.is-vertically-aligned-bottom.is-style-media-text-overlap figure.wp-block-media-text__media{ + height: calc(100% + 90px); +} + +.wp-block-media-text.is-image-fill.media-text-overlap .wp-block-media-text__content, +.wp-block-media-text.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-left: -120px; + padding-top: 20%; + padding-bottom: 20%; + background: inherit; +} + +.wp-block-media-text.has-media-on-the-right.is-image-fill.media-text-overlap .wp-block-media-text__content, +.wp-block-media-text.has-media-on-the-right.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-left: 0; + margin-right: -120px; +} + +.ribbon-group{ + margin-bottom: 40px; +} + +.ribbon-group > .wp-block-group__inner-container > *:not(.alignfull){ + max-width: calc(100% - 60px) !important; +} + +.ribbon-group .wp-block-group__inner-container > h1, +.ribbon-group .wp-block-group__inner-container > h2, +.ribbon-group .wp-block-group__inner-container > h3, +.ribbon-group .wp-block-group__inner-container > h4, +.ribbon-group .wp-block-group__inner-container > h5, +.ribbon-group .wp-block-group__inner-container > h6{ + position: relative; + display: inline-block; + padding: 20px 30px; + margin: 0; + z-index: 1; +} + +.ribbon-group .wp-block-group__inner-container > h1:before, +.ribbon-group .wp-block-group__inner-container > h2:before, +.ribbon-group .wp-block-group__inner-container > h3:before, +.ribbon-group .wp-block-group__inner-container > h4:before, +.ribbon-group .wp-block-group__inner-container > h5:before, +.ribbon-group .wp-block-group__inner-container > h6:before{ + content: ""; + position: absolute; + width: 0; + height: 0; + left: 0; + top: 100%; + background: inherit; + border: 30px solid rgba(0,0,0,0.25); + clip-path: polygon(0% 0%, 100% 0%, 100% 100%); +} + +.ribbon-group > .wp-block-group__inner-container > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){ + position: relative; + margin: -10px 0 10px 60px; +} + +.rtl .ribbon-group .wp-block-group__inner-container > h1:before, +.rtl .ribbon-group .wp-block-group__inner-container > h2:before, +.rtl .ribbon-group .wp-block-group__inner-container > h3:before, +.rtl .ribbon-group .wp-block-group__inner-container > h4:before, +.rtl .ribbon-group .wp-block-group__inner-container > h5:before, +.rtl .ribbon-group .wp-block-group__inner-container > h6:before{ + left: auto; + right: 0; + clip-path: polygon(0% 0%, 100% 0%, 0% 100%); +} + +.rtl .ribbon-group > .wp-block-group__inner-container > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){ + position: relative; + margin: -10px 60px 10px 0; +} + +@media (max-width: 781px){ + .featured-style-1 .wp-block-columns .wp-block-column, + .wp-block-columns.featured-style-1 .wp-block-column{ + flex-basis: 100% !important; + margin-bottom: 90px; + } + + .wp-block-columns.pricing-table .wp-block-column{ + flex-basis: 100% !important; + margin-bottom: 30px; + } + + .wp-block-columns.pricing-table .wp-block-column.is-featured{ + transform: none; + } + + .featured-style-1 .wp-block-columns .wp-block-column:nth-child(2n), + .wp-block-columns.featured-style-1 .wp-block-column:nth-child(2n), + .wp-block-columns.pricing-table .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .featured-style-1 .wp-block-columns .wp-block-column:last-child, + .wp-block-columns.featured-style-1 .wp-block-column:last-child, + .wp-block-columns.pricing-table .wp-block-column:last-child{ + margin-bottom: 0; + } + + .features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18% !important; + } + + .features-media-text .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78% !important; + } + + .wp-block-columns.without-gaps .wp-block-column:nth-child(2n), + .wp-block-columns.is-style-no-spacing .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .wp-block-columns.is-style-not-stacked-on-mobile, + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile{ + flex-wrap: nowrap; + } + + .wp-block-columns.is-style-not-stacked-on-mobile .wp-block-column, + .wp-block-columns.is-style-not-stacked-on-mobile.is-style-no-spacing .wp-block-column, + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile .wp-block-column{ + flex-basis: auto !important; + flex-grow: 1; + } + + .wp-block-columns.is-style-not-stacked-on-mobile .wp-block-column:not(:first-child){ + margin-left: 32px !important; + } + + .wp-block-columns.is-style-not-stacked-on-mobile.is-style-no-spacing .wp-block-column:not(:first-child), + .wp-block-columns.is-style-no-spacing-not-stacked-on-mobile .wp-block-column:not(:first-child){ + margin-left: 0 !important; + } +} + +@media (min-width:600px) and (max-width: 781px){ + .wp-block-columns.without-gaps .wp-block-column, + .wp-block-columns.is-style-no-spacing .wp-block-column{ + flex-basis: 50% !important; + } + + .wp-block-columns.cta-with-images .wp-block-column, + .wp-block-columns.food-menu-item .wp-block-column{ + flex-basis: 100% !important; + } + + .wp-block-columns.cta-with-images .wp-block-column:nth-child(2n), + .wp-block-columns.food-menu-item .wp-block-column:nth-child(2n){ + margin-left: 0; + } + + .wp-block-columns.food-menu-item .wp-block-column .has-text-align-right{ + text-align: left; + } + + .wp-block-media-text.food-menu-item{ + margin-bottom: .5em; + } + + .wp-block-media-text.food-menu-item .wp-block-media-text__content .has-large-font-size{ + font-size: 24px; + } + + .about-profile .wp-block-column hr.wp-block-separator{ + width: 50%; + } +} + +@media (max-width:599px){ + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{ + margin-top: 2em; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content{ + margin-top: 0; + margin-bottom: 1em; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content .wp-block-columns .wp-block-column:first-child{ + flex-basis: 18% !important; + } + + .features-media-text.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content .wp-block-columns .wp-block-column:nth-child(2n){ + flex-basis: 78% !important; + } + + .wp-block-columns.with-offset{ + margin-top: 0; + } + + .wp-block-columns.with-offset .wp-block-column.has-offset, + .wp-block-column.is-style-offset, + .wp-block-column.is-style-offset-box-shadow{ + margin-top: 0; + margin-bottom: 0; + } + + .wp-block-columns.food-menu > .wp-block-column:first-child{ + margin-bottom: 2em; + } + + .wp-block-columns.food-menu-item .wp-block-column:first-child{ + flex-basis: 66.66% !important; + } + + .wp-block-columns.food-menu-item .wp-block-column:nth-child(2n){ + flex-basis: 33.33% !important; + } + + .wp-block-media-text.food-menu-item{ + margin-bottom: 2em; + } + + .wp-block-media-text.food-menu-item .wp-block-media-text__content .wp-block-separator{ + display: none; + } + + .about-profile .wp-block-column hr.wp-block-separator{ + width: 25%; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right{ + -ms-grid-columns: 100% !important; + grid-template-columns: 100% !important; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h1:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h2:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h3:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h4:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h5:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content h6:first-child{ + width: 100%; + margin-left: 0; + margin-top: -1em; + } + + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h1:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h2:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h3:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h4:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h5:first-child, + .media-text-overlap-heading.wp-block-media-text.is-stacked-on-mobile.has-media-on-the-right .wp-block-media-text__content h6:first-child{ + margin-right: 0; + margin-top: 1em; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile{ + width: 90%; + margin-left: 5%; + margin-right: 5%; + margin-top: 0; + margin-bottom: 0; + } + + #primary.full-width .entry-content .alignfull.wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile, + #primary.full-width .entry-content .alignfull.wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile{ + width: 100%; + margin-left: 0; + margin-right: 0; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile figure.wp-block-media-text__media, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile figure.wp-block-media-text__media{ + height: 100%; + width: 111%; + margin-left: -5.5%; + } + + .wp-block-media-text.is-image-fill.media-text-overlap.is-stacked-on-mobile .wp-block-media-text__content, + .wp-block-media-text.is-image-fill.is-style-media-text-overlap.is-stacked-on-mobile .wp-block-media-text__content{ + margin-top: -40px; + margin-left: 0; + padding-top: 8%; + padding-bottom: 8%; + } + + .wp-block-media-text.has-media-on-the-right.is-image-fill.media-text-overlap .wp-block-media-text__content, + .wp-block-media-text.has-media-on-the-right.is-image-fill.is-style-media-text-overlap .wp-block-media-text__content{ + margin-bottom: -40px; + margin-top: 0; + margin-right: 0; + } +} + +/*-------------------------------------------------------------- +## WooCommerce Blocks CSS +--------------------------------------------------------------*/ + +.wp-block-woocommerce-attribute-filter, +.wp-block-woocommerce-price-filter{ + background: #fbfbfb; + padding: 1em 1.5em .25em 1.5em; +} + +.wp-block-woocommerce-active-filters > h5{ + background: #fbfbfb; + padding: 1rem 1.5rem 1.25em 1.5rem; + margin: 0; +} + +.wp-block-woocommerce-active-filters > div{ + background: #fbfbfb; + padding: 0 1.5em 0 1.5em; +} + +.wp-block-woocommerce-active-filters > div:last-child{ + background: #fbfbfb; + padding-bottom: .25em; +} + +.wc-block-attribute-filter .wc-block-attribute-filter-list li{ + text-decoration: none; +} + +.wc-block-active-filters .wc-block-active-filters__clear-all{ + color: inherit; +} + +.wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress, +.rtl .wc-block-price-filter .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input-progress{ + --range-color: #d82978; +} + +.wc-block-price-filter .wc-block-price-filter__range-input-wrapper input[type="range"]:focus{ + border: none; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-webkit-slider-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__range-input::-moz-range-thumb{ + background-image: none; + background-color: #d82978; + width: 21px; + border-radius: 50%; +} + +.wc-block-price-filter .wc-block-price-filter__controls .wc-block-price-filter__amount{ + border-radius: 0; +} + +.wc-block-featured-product, +.wc-block-featured-category{ + background-color: #2d2354; + overflow: hidden; +} + +@media (min-width: 600px){ + .wp-block-column > div.equal-height, + .wp-block-cover.equal-height, + .wp-block-cover-image.equal-height, + .wc-block-featured-product.equal-height, + .wc-block-featured-category.equal-height{ + min-height: auto !important; + height: calc(100% - 1em); + } + + .wp-block-column > div.equal-height-2, + .wp-block-cover.equal-height-2, + .wp-block-cover-image.equal-height-2, + .wc-block-featured-product.equal-height-2, + .wc-block-featured-category.equal-height-2{ + min-height: auto !important; + height: calc(50% - 1em); + } + + .wp-block-column > div.equal-height-3, + .wp-block-cover.equal-height-3, + .wp-block-cover-image.equal-height-3, + .wc-block-featured-product.equal-height-3, + .wc-block-featured-category.equal-height-3{ + min-height: auto !important; + height: calc(33.333% - 1em); + } + + .wp-block-column > div.equal-height-4, + .wp-block-cover.equal-height-4, + .wp-block-cover-image.equal-height-4, + .wc-block-featured-product.equal-height-4, + .wc-block-featured-category.equal-height-4{ + min-height: auto !important; + height: calc(25% - 1em); + } +} + +.wc-block-featured-product .wc-block-featured-product__variation{ + font-size: 1.125em; +} + +.wc-block-featured-product .wc-block-featured-product__price{ + font-size: 1.25em; +} + +.wc-block-grid .wc-block-grid__products, +.wc-block-grid__products{ + margin: 0 0 1em 0; + display: grid; + grid-column-gap: 1%; + grid-row-gap: 1em; +} + +.wc-block-grid.has-1-columns .wc-block-grid__products{ + grid-template-columns: 100%; +} + +.wc-block-grid.has-2-columns .wc-block-grid__products{ + grid-template-columns: 49.5% 49.5%; +} + +.wc-block-grid.has-3-columns .wc-block-grid__products{ + grid-template-columns: repeat(3,32.666666%); +} + +.wc-block-grid.has-4-columns .wc-block-grid__products{ + grid-template-columns: repeat(4,24.25%); +} + +.wc-block-grid.has-5-columns .wc-block-grid__products{ + grid-template-columns: repeat(5,19.2%); +} + +.wc-block-grid.has-6-columns .wc-block-grid__products{ + grid-template-columns: repeat(6,15.833333%); +} + +.wc-block-grid.has-7-columns .wc-block-grid__products{ + grid-template-columns: repeat(7,13.428571%); +} + +.wc-block-grid.has-8-columns .wc-block-grid__products{ + grid-template-columns: repeat(8,11.625%); +} + +@media (max-width: 768px){ + .wc-block-grid.has-3-columns .wc-block-grid__products, + .wc-block-grid.has-4-columns .wc-block-grid__products, + .wc-block-grid.has-5-columns .wc-block-grid__products, + .wc-block-grid.has-6-columns .wc-block-grid__products, + .wc-block-grid.has-7-columns .wc-block-grid__products, + .wc-block-grid.has-8-columns .wc-block-grid__products{ + display: grid; + grid-template-columns: 49.5% 49.5%; + } +} + +@media (max-width: 480px){ + .wc-block-grid.has-2-columns .wc-block-grid__products, + .wc-block-grid.has-3-columns .wc-block-grid__products, + .wc-block-grid.has-4-columns .wc-block-grid__products, + .wc-block-grid.has-5-columns .wc-block-grid__products, + .wc-block-grid.has-6-columns .wc-block-grid__products, + .wc-block-grid.has-7-columns .wc-block-grid__products, + .wc-block-grid.has-8-columns .wc-block-grid__products{ + display: grid; + grid-template-columns: 100%; + } + + .wc-block-grid.has-1-columns .wc-block-grid__product, + .wc-block-grid.has-2-columns .wc-block-grid__product, + .wc-block-grid.has-3-columns .wc-block-grid__product, + .wc-block-grid.has-4-columns .wc-block-grid__product, + .wc-block-grid.has-5-columns .wc-block-grid__product, + .wc-block-grid.has-6-columns .wc-block-grid__product, + .wc-block-grid.has-7-columns .wc-block-grid__product, + .wc-block-grid.has-8-columns .wc-block-grid__product{ + margin: 0; + } +} + +.wc-block-grid.has-2-columns .wc-block-grid__product, +.wc-block-grid.has-3-columns .wc-block-grid__product, +.wc-block-grid.has-4-columns .wc-block-grid__product, +.wc-block-grid.has-5-columns .wc-block-grid__product, +.wc-block-grid.has-6-columns .wc-block-grid__product, +.wc-block-grid.has-7-columns .wc-block-grid__product, +.wc-block-grid.has-8-columns .wc-block-grid__product{ + max-width: 100%; +} + +.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-5-columns:not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-6-columns:not(.alignfull) .wc-block-grid__product, +.wc-block-grid.has-7-columns .wc-block-grid__product, +.wc-block-grid.has-8-columns .wc-block-grid__product{ + font-size: 1em; +} + +.wc-block-grid__product{ + background: #fbfbfb; + border: 1px solid #f1f1f1; + margin: 0 !important; + padding: 0 !important; + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1 1 auto; + overflow: hidden; +} + +.wc-block-grid__product .wc-block-grid__product-image{ + margin: 0; +} + +.wc-block-grid__product .wc-block-grid__product-image img{ + width: 100%; +} + +.wc-block-grid__product .product-extra-img{ + visibility: hidden; + opacity: 0; + position: absolute; + top: 0; + left: 0; + right: 0; + overflow: hidden; + z-index: 8; + transition: all .5s ease-in; +} + +.wc-block-grid__product:hover .product-extra-img{ + visibility: visible; + opacity: 1; + transition: all .5s ease-out; +} + +.wc-block-grid__product .wc-block-grid__product-title{ + padding: 0; + margin: 1em 0 .5em; + font-size: 1.125em; + font-weight: normal; + font-family: 'Montserrat'; + color: #313131; +} + +.wc-block-grid__product .wc-block-grid__product-price{ + padding: 0; + margin: 0 0 .5em; + font-size: 1em; + font-weight: 300; +} + +.wc-block-featured-product .wc-block-featured-product__price del +.wc-block-grid__product .wc-block-grid__product-price del{ + opacity: .5; +} + +.wc-block-featured-product .wc-block-featured-product__price ins, +.wc-block-grid__product .wc-block-grid__product-price ins{ + background: 0 0; + font-weight: 400; +} + +.wc-block-grid__product-onsale{ + background-color: #d82978; + margin: 0; + padding: .25em .5em; + position: absolute; + top: 0; + left: 0; + right: auto; + font-weight: normal; + min-width: auto; + min-height: auto; + line-height: 2em; + border-radius: 0; + border: none; + color: #fff; + text-transform: none; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart{ + margin: 0; + border-top: 1px solid #f1f1f1; + padding-bottom: 0 !important; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button, +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart{ + position: relative; + background: transparent; + color: #d82978; + padding: 1em 1.25em 1em 0; + font-weight: 400; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button[href*="add-to-cart"]{ + padding: 1em 0 1em 1.25em; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button:before{ + position: absolute; + top: auto; + right: 0; + font-family: 'dashicons'; + content: "\f345"; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button[href*="add-to-cart"]:before{ + position: absolute; + top: auto; + right: auto; + left: 0; + font-family: 'dashicons'; + content: "\f174"; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.add_to_cart_button.added{ + display: none; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart{ + font-weight: 600; + padding: 1em 0 1em 1.25em; +} + +.wc-block-grid__product .wc-block-grid__product-add-to-cart a.added_to_cart:before{ + position: absolute; + top: auto; + left: 0; + font-family: 'dashicons'; + content: "\f177"; +} + +/*-------------------------------------------------------------- +## Icons CSS +--------------------------------------------------------------*/ + +.nav-links .dashicons{ + line-height: 1.25; +} + +.woocommerce-pagination .page-numbers .dashicons{ + line-height: 2.1; +} + +.comment-list a.comment-reply-link:before{ + font-family: dashicons; + content: "\f474"; + margin-right: 5px; +} + +.toggle-nav:before{ + font-family: dashicons; + content: "\f228"; +} + +.toggle-nav-open:before{ + font-family: dashicons; + content: "\f158"; +} + +.menu-item-has-children:after{ + font-family: dashicons; + content: "\f347"; + font-size: 1em; + text-shadow: none; + opacity: .8; + position: absolute; + top: .7rem; + right: .2rem; +} +.menu-item-has-children .menu-item-has-children:after{ + content: "\f345"; + top: .4rem; + right: 1rem; +} + +#primary-menu:hover .menu-item-has-children:after{ + opacity: .4; +} +#primary-menu li.menu-item-has-children:hover:after{ + opacity: .8; +} + +#masthead .icons{ + font-family: dashicons; + font-size: 1.4em; + line-height: 1.1; +} + +#masthead .icons.cordero-icon-search:before{ + display: block; + width: 1em; + content: "\f179"; + cursor: pointer; +} + +#masthead .top-search.search-open .icons.cordero-icon-search:before{ + content: "\f158"; +} + +#masthead .cordero-icon-user:before{ + content: "\f110"; +} + +.logged-in #masthead .cordero-icon-user:before{ + content: "\f110"; +} + +#masthead .cordero-icon-heart:before{ + content: "\f487"; +} + +#masthead .icons, +#masthead a.wishlist_products_counter{ + position: relative; +} + +#masthead a.wishlist_products_counter{ + margin-right: 15px; +} + +#masthead a.wishlist_products_counter:before{ + font-family: dashicons; + content: "\f487"; + font-size: 1.4em; + line-height: 1.1; +} + +#masthead .cordero-icon-shopping-cart:before{ + content: "\f174"; +} + +.shop-filter-wrap .shop-filter-toggle .toggle-icon:before{ + font-family: dashicons; + content: "\f347"; + position: absolute; + top: 0; + left: .5em; + font-size: 1.4em; + line-height: 1; +} +.shop-filter-wrap .shop-filter-toggle.active .toggle-icon:before{ + content: "\f343"; +} + +.cordero-icon-folder:before{ + font-family: dashicons; + content: "\f318"; + font-style: normal; +} + +.cordero-icon-tag:before{ + font-family: dashicons; + content: "\f323"; + font-style: normal; +} + +a.more-tag:after{ + font-family: dashicons; + content: "\f345"; + position: absolute; + top: .1875em; + right: auto; + margin-left: .25em; + font-size: .875em; +} + +.woocommerce-MyAccount-navigation-link:before{ + font-family: dashicons; + content: "\f12a"; + font-style: normal; + display: inline-block; + width: 20px; +} +.woocommerce-MyAccount-navigation-link--dashboard:before{ + content: "\f110"; +} +.woocommerce-MyAccount-navigation-link--orders:before{ + content: "\f513"; +} +.woocommerce-MyAccount-navigation-link--downloads:before{ + content: "\f316"; +} +.woocommerce-MyAccount-navigation-link--edit-address:before{ + content: "\f230"; +} +.woocommerce-MyAccount-navigation-link--edit-account:before{ + content: "\f464"; +} +.woocommerce-MyAccount-navigation-link--customer-logout:before{ + content: "\f310"; +} + +/*-------------------------------------------------------------- +## Jetpack CSS +--------------------------------------------------------------*/ + +.infinite-scroll #main nav.pagination{ + display: none; +} + +.infinite-loader{ + color: #d82978; + margin-bottom: 20px; +} + +.infinite-loader .spinner{ + left: 50% !important; +} + +#infinite-handle{ + text-align: center; + margin-bottom: 20px; +} + +#infinite-handle span{ + background: transparent; + font-size: inherit; + padding: 0; +} + +.infinite-wrap .entry-video{ + max-width: 100%; + overflow: hidden; +} + +/*-------------------------------------------------------------- +## Responsive CSS +--------------------------------------------------------------*/ + +@media (max-width: 1120px){ + .container, + .wp-block-cover-image.alignfull .wp-block-cover__inner-container, + .wp-block-cover.alignfull .wp-block-cover__inner-container{ + max-width: 100%; + padding: 0 10px; + } + + #top-footer ul.product_list_widget li{ + width: 25%; + } + + #top-footer ul.product_list_widget li:nth-child(4n+1){ + clear: both; + } + + #top-footer ul.product_list_widget li:nth-child(6n+1){ + clear: none; + } +} + +@media (max-width: 1024px){ + + .logo-left #site-branding{ + grid-column: 1/3; + } + + .logo-right #site-branding{ + grid-column: 2/4; + } + + .logo-left .toggle-nav{ + grid-column: 3/4; + justify-self: end; + } + + .logo-right .toggle-nav{ + grid-column: 1/2; + justify-self: start; + } + + .toggle-nav, + .toggle-nav-open, + #site-navigation .menu-close{ + display: block; + } + + #site-navigation .menu-close{ + width: 100%; + } + + .toggle-nav-open, + .toggle-nav-open:hover{ + padding: 20px 0; + background: #fbfbfb; + border-bottom: 1px solid #f1f1f1; + width: calc(100% - 2px); + margin: 1px; + } + + .admin-bar .toggle-nav-open{ + padding-top: 66px; + } + + #site-navigation .menu-close{ + opacity: 0; + } + + #site-navigation .menu-close:focus{ + opacity: 1; + outline: 1px dotted #2d2354; + } + + #site-navigation{ + visibility: hidden; + opacity: 0; + background: #fff; + position: fixed; + top: 0; + left: -100%; + width: 80%; + height: 100vh; + display: flex; + flex-direction: column; + overflow: hidden auto; + box-shadow: 3px -1px 8px rgba(0, 0, 0, 0.4); + transition: all .3s ease-in; + z-index: 9999; + } + + .menu-open #site-navigation{ + visibility: visible; + opacity: 1; + left: 0; + transition: all .3s ease-out; + } + + body.menu-open{ + overflow: hidden; + } + + #site-nav-after{ + display: block; + position: fixed; + top: 0; + left: -100%; + width: 100%; + height: 100vh; + z-index: 99; + transition: all .3s ease-in; + } + + .menu-open #site-nav-after{ + left: 0; + cursor: pointer; + transition: all .3s ease-out; + } + + #masthead.transparent #site-navigation, + #masthead.transparent #site-navigation a, + #masthead.transparent #primary-menu li a, + #masthead.transparent .top-search .cordero-icon-search{ + color: #2d2354; + } + + #primary-menu{ + padding: 10px 2%; + } + + #primary-menu li{ + position: relative; + width: 100%; + border-top: 0; + margin-top: 0; + } + #primary-menu > li:after{ + display: none; + } + #primary-menu li a{ + display: inline-block; + padding: 8px 10px; + margin: 0; + width: calc(100% - 40px); + } + #primary-menu li.menu-item-has-children a, + #primary-menu li.menu-item-has-children a:hover{ + padding: 8px 10px; + } + .menu-item-has-children:after{ + display: none; + } + .menu-item-has-children .menu-item-has-children:after{ + display: none; + } + #primary-menu > li.current-menu-item, + #primary-menu > li:hover, + #primary-menu > li.current-menu-item:hover{ + background-image: none; + } + .menu-item-has-children .sub-trigger{ + position: relative; + width: 30px; + height: 20px; + line-height: 0.5; + z-index: 100; + cursor: pointer; + display: inline-block; + color: #2d2354; + background: transparent; + } + + .menu-item-has-children .sub-trigger:focus{ + outline: 1px dotted; + } + .menu-item-has-children .sub-trigger:after{ + position: absolute; + top: 0; + left: 0; + font-family: dashicons; + font-size: 26px; + text-shadow: none; + content: "\f347"; + } + .menu-item-has-children .sub-trigger.is-open:after{ + content: "\f343"; + } + #primary-menu .sub-menu, + #primary-menu li:hover > .sub-menu, + #primary-menu ul.children, + #primary-menu li:hover > ul.children, + #primary-menu ul li.menu-item-has-children ul, + #primary-menu ul li.menu-item-has-children ul, + #primary-menu ul li.menu-item-has-children.locked ul, + #primary-menu ul li.menu-item-has-children:hover ul, + #primary-menu ul li.menu-item-has-children a:focus ~ ul{ + left: 0; + width: 100%; + border: none; + box-shadow: none; + display: none; + opacity: 1; + visibility: visible; + position: relative; + top: 0 !important; + transition: none; + background: transparent; + } + #primary-menu .sub-menu li, + #primary-menu ul.children li{ + padding: 0; + text-transform: none; + border: 0; + } + + #primary-menu li.menu-item-has-children .sub-menu a{ + padding-top: 8px; + padding-bottom: 8px; + } + + #primary-menu > li > ul, + #primary-menu > li > ul > li > ul, + #primary-menu > li > ul > li > ul > li > ul{ + padding-left: 10px; + } + + #primary-menu ul{ + transition: none; + } + + #primary-menu ul ul, + #primary-menu ul li:hover ul{ + left: auto; + top: auto; + } + + #masthead .top-account .mini-account, + #masthead .top-cart .mini-cart{ + display: none; + } + + #masthead .extra-wrap{ + justify-content: left; + padding: 10px 2%; + } + + .top-search .mini-search{ + left: 1px; + right: auto; + bottom: 40px; + } + +} + +@media (max-width: 768px){ + #top-bar .widget{ + display: block; + width: 100%; + } + + #top-bar .widget:nth-child(odd){ + text-align: center; + margin-right: 0; + } + #top-bar .widget:nth-child(even){ + text-align: center; + margin-left: 0; + } + + #top-bar li{ + margin-left: 7px; + } + + #top-bar li:first-child{ + margin-left: 0; + } + + #main.post-columns-1 #grid-loop, + .related-posts.post-columns-1 #grid-loop, + #main.post-columns-1 .infinite-wrap, + #main.post-columns-2 #grid-loop, + .related-posts.post-columns-2 #grid-loop, + #main.post-columns-2 .infinite-wrap, + #main.post-columns-3 #grid-loop, + .related-posts.post-columns-3 #grid-loop, + #main.post-columns-3 .infinite-wrap, + #main.post-columns-4 #grid-loop, + .related-posts.post-columns-4 #grid-loop, + #main.post-columns-4 .infinite-wrap{ + grid-template-columns: 48.5% 48.5%; + } + + .woocommerce ul.products.columns-2, + .woocommerce-page ul.products.columns-2, + .woocommerce ul.products.columns-3, + .woocommerce-page ul.products.columns-3, + .woocommerce ul.products.columns-4, + .woocommerce-page ul.products.columns-4, + .woocommerce ul.products.columns-5, + .woocommerce-page ul.products.columns-5, + .woocommerce ul.products.columns-6, + .woocommerce-page ul.products.columns-6, + .woocommerce ul.products.columns-7, + .woocommerce-page ul.products.columns-7, + .woocommerce ul.products.columns-8, + .woocommerce-page ul.products.columns-8{ + grid-template-columns: 49.5% 49.5%; + } + + .footer{ + width: 47%; + } + + .footer:nth-child(3){ + clear: both; + } + + .footer:nth-child(3), + .footer:nth-child(4){ + margin-top: 25px; + } + + #masthead .top-account:hover .mini-account, + #masthead .top-cart:hover .mini-cart{ + transform: translateY(-480px); + visibility: hidden; + z-index: -99; + } + + #masthead a.cordero-cart{ + margin-right: 12px; + } + + #bottom-footer .container{ + flex-direction: column; + text-align: center; + } + + #bottom-footer .site-info{ + margin-bottom: 2em; + } + + #bottom-footer.info-right .site-info{ + margin-top: 2em; + } + + #shop-filters aside{ + display: block; + border-right: 0; + border-top: 1px solid #fff; + clear: both; + } + + #shop-filters aside:first-child{ + border-top: none; + } + + #shop-filters aside:after{ + clear: both; + } + + #shop-filters aside:before, + #shop-filters aside:after{ + content: ""; + display: table; + } + + #primary{ + width: auto !important; + float: none !important; + margin-bottom: 25px; + } + + #secondary{ + width: auto; + float: none !important; + } + + .sidebar-below #secondary, + .post-template-template-single-reading #secondary, + .post-template-template-single-reading-paragraph #secondary{ + display: block; + } + + .woocommerce ul.products[class*="columns-"] li.product, + .woocommerce-page ul.products[class*="columns-"] li.product{ + width: auto; + margin: 0; + } + + #top-footer ul.product_list_widget li{ + width: 50%; + } + + #top-footer ul.product_list_widget li:nth-child(2n+1){ + clear: both; + } + + #top-footer ul.product_list_widget li:nth-child(4n+1){ + clear: none; + } + + .woocommerce-products-header{ + flex-direction: column; + } + + .woocommerce .term-description { + padding: 0; + } + +} + +@media (max-width: 599px){ + #masthead{ + top: 0 !important; + } +} + +@media (max-width: 580px){ + #comments{ + padding: 15px; + } + + #top-footer ul.product_list_widget li{ + float: none; + width: 100%; + } + + #top-footer ul.product_list_widget li:nth-child(2n+1){ + clear: none; + } +} + +@media (max-width: 480px){ + .middle-footer{ + margin: 0; + } + + .footer{ + width: auto; + float: none; + margin: 0 0 20px !important; + } + + .footer:last-child{ + margin: 0 !important; + } + + #bottom-footer{ + text-align: center; + } + + #comments{ + padding: 10px; + } + + .author-email-url{ + margin-left: 0 + } + + .comment-form-author, + .comment-form-email, + .comment-form-url{ + width: auto; + margin-left: 0; + float: none; + } + + #masthead .top-account, + #masthead .top-wishlist, + #masthead .top-cart{ + margin: 0 0 0 10px; + } + + #main.post-columns-1 #grid-loop, + .related-posts.post-columns-1 #grid-loop, + #main.post-columns-1 .infinite-wrap, + #main.post-columns-2 #grid-loop, + .related-posts.post-columns-2 #grid-loop, + #main.post-columns-2 .infinite-wrap, + #main.post-columns-3 #grid-loop, + .related-posts.post-columns-3 #grid-loop, + #main.post-columns-3 .infinite-wrap, + #main.post-columns-4 #grid-loop, + .related-posts.post-columns-4 #grid-loop, + #main.post-columns-4 .infinite-wrap, + .woocommerce ul.products.columns-2, + .woocommerce-page ul.products.columns-2, + .woocommerce ul.products.columns-3, + .woocommerce-page ul.products.columns-3, + .woocommerce ul.products.columns-4, + .woocommerce-page ul.products.columns-4, + .woocommerce ul.products.columns-5, + .woocommerce-page ul.products.columns-5, + .woocommerce ul.products.columns-6, + .woocommerce-page ul.products.columns-6, + .woocommerce ul.products.columns-7, + .woocommerce-page ul.products.columns-7, + .woocommerce ul.products.columns-8, + .woocommerce-page ul.products.columns-8{ + grid-template-columns: 100%; + } +} + +/*-------------------------------------------------------------- +## Print CSS +--------------------------------------------------------------*/ +@media print{ + #masthead, + #secondary, + #colophon, + #respond{ + display: none; + } +} diff --git a/template-no-title.php b/template-no-title.php new file mode 100644 index 0000000..3e91e0b --- /dev/null +++ b/template-no-title.php @@ -0,0 +1,44 @@ + + + + +
    +
    + + + + + + + + + +
    +
    + + + + + + diff --git a/template-single-reading-paragraph.php b/template-single-reading-paragraph.php new file mode 100644 index 0000000..55aeabd --- /dev/null +++ b/template-single-reading-paragraph.php @@ -0,0 +1,51 @@ + + + + +
    +
    + + + + + + '%title', + 'next_text' => '%title', + ) ); + } + + if ( !get_theme_mod( 'disable_related' ) ) { + get_template_part( 'content', 'related' ); + } + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) : + comments_template(); + endif; + ?> + + + +
    +
    + + + + + + diff --git a/template-single-reading.php b/template-single-reading.php new file mode 100644 index 0000000..864d543 --- /dev/null +++ b/template-single-reading.php @@ -0,0 +1,51 @@ + + + + +
    +
    + + + + + + '%title', + 'next_text' => '%title', + ) ); + } + + if ( !get_theme_mod( 'disable_related' ) ) { + get_template_part( 'content', 'related' ); + } + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) : + comments_template(); + endif; + ?> + + + +
    +
    + + + + + + diff --git a/template-single-transparent-header.php b/template-single-transparent-header.php new file mode 100644 index 0000000..0538bf7 --- /dev/null +++ b/template-single-transparent-header.php @@ -0,0 +1,52 @@ + + + + +
    +
    + + + + + + '%title', + 'next_text' => '%title', + ) ); + } + + if ( !get_theme_mod( 'disable_related' ) ) { + get_template_part( 'content', 'related' ); + } + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) : + comments_template(); + endif; + ?> + + + +
    +
    + + + + diff --git a/template-transparent-header.php b/template-transparent-header.php new file mode 100644 index 0000000..9ccaf5f --- /dev/null +++ b/template-transparent-header.php @@ -0,0 +1,41 @@ + + + + +
    +
    + + + + + + + + + +
    +
    + + + + diff --git a/woocommerce/content-single-product-tabs-inline.php b/woocommerce/content-single-product-tabs-inline.php new file mode 100644 index 0000000..79252ac --- /dev/null +++ b/woocommerce/content-single-product-tabs-inline.php @@ -0,0 +1,76 @@ + +
    > + + + +
    + +
    + + +
    + + diff --git a/woocommerce/content-single-product-wide-image-after.php b/woocommerce/content-single-product-wide-image-after.php new file mode 100644 index 0000000..ca62527 --- /dev/null +++ b/woocommerce/content-single-product-wide-image-after.php @@ -0,0 +1,74 @@ + +
    > + +
    + +
    + + + + +
    + + diff --git a/woocommerce/single-product-image-after-tabs-inline.php b/woocommerce/single-product-image-after-tabs-inline.php new file mode 100644 index 0000000..5e43c07 --- /dev/null +++ b/woocommerce/single-product-image-after-tabs-inline.php @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file
    +
    ', + esc_html__( 'Upgrade message from the plugin author:', 'cordero' ), + ' ', wp_kses_data( $item['upgrade_notice'] ), ' +
    +