updated plugin GP Premium
version 1.11.2
This commit is contained in:
@ -1,5 +1,13 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
/**
|
||||
* This file handles column-related functionality.
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_get_columns' ) ) {
|
||||
/**
|
||||
@ -13,33 +21,36 @@ if ( ! function_exists( 'generate_blog_get_columns' ) ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// If columns are enabled, set to true
|
||||
$columns = ( true == $generate_blog_settings['column_layout'] ) ? true : false;
|
||||
// If columns are enabled, set to true.
|
||||
$columns = ( $generate_blog_settings['column_layout'] ) ? true : false;
|
||||
|
||||
// If we're not dealing with posts, set it to false.
|
||||
// Check for is_home() to prevent bug in Yoast that throws off the post type check.
|
||||
$columns = ( 'post' == get_post_type() || is_search() || is_home() ) ? $columns : false;
|
||||
$columns = ( 'post' === get_post_type() || is_search() || is_home() ) ? $columns : false;
|
||||
|
||||
// If masonry is enabled via filter, enable columns
|
||||
// If masonry is enabled via filter, enable columns.
|
||||
// phpcs:ignore -- Non-strict comparison allowed.
|
||||
$columns = ( 'true' == apply_filters( 'generate_blog_masonry', 'false' ) ) ? true : $columns;
|
||||
|
||||
// If we're on a singular post or page, disable
|
||||
// If we're on a singular post or page, disable.
|
||||
$columns = ( is_singular() ) ? false : $columns;
|
||||
|
||||
// Turn off columns if we're on a WooCommerce search page
|
||||
// Turn off columns if we're on a WooCommerce search page.
|
||||
if ( function_exists( 'is_woocommerce' ) ) {
|
||||
$columns = ( is_woocommerce() && is_search() ) ? false : $columns;
|
||||
}
|
||||
|
||||
// Bail if there's no search results
|
||||
// Bail if there's no search results.
|
||||
if ( is_search() ) {
|
||||
global $wp_query;
|
||||
|
||||
// phpcs:ignore -- non-strict comparison allowed.
|
||||
if ( 0 == $wp_query->post_count ) {
|
||||
$columns = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the result
|
||||
// Return the result.
|
||||
return apply_filters( 'generate_blog_columns', $columns );
|
||||
}
|
||||
}
|
||||
@ -56,6 +67,7 @@ if ( ! function_exists( 'generate_blog_get_masonry' ) ) {
|
||||
);
|
||||
|
||||
// If masonry is enabled via option or filter, enable it.
|
||||
// phpcs:ignore -- non-strict comparison allowed.
|
||||
if ( $generate_blog_settings['masonry'] || 'true' == apply_filters( 'generate_blog_masonry', 'false' ) ) {
|
||||
$masonry = 'true';
|
||||
} else {
|
||||
@ -88,7 +100,7 @@ if ( ! function_exists( 'generate_blog_add_columns_container' ) ) {
|
||||
printf(
|
||||
'<div class="generate-columns-container %1$s">%2$s',
|
||||
'false' !== generate_blog_get_masonry() ? 'masonry-container are-images-unloaded' : '',
|
||||
'false' !== generate_blog_get_masonry() ? '<div class="grid-sizer ' . esc_attr( 'grid-' . esc_attr( $columns ) ) . ' tablet-grid-50 mobile-grid-100"></div>' : ''
|
||||
'false' !== generate_blog_get_masonry() ? '<div class="grid-sizer grid-' . esc_attr( $columns ) . ' tablet-grid-50 mobile-grid-100"></div>' : '' // phpcs:ignore -- no escaping needed.
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -126,7 +138,7 @@ if ( ! function_exists( 'generate_blog_columns_css' ) ) {
|
||||
);
|
||||
}
|
||||
|
||||
$separator = ( function_exists('generate_spacing_get_defaults') ) ? absint( $spacing_settings['separator'] ) : 20;
|
||||
$separator = ( function_exists( 'generate_spacing_get_defaults' ) ) ? absint( $spacing_settings['separator'] ) : 20;
|
||||
|
||||
$return = '';
|
||||
if ( generate_blog_get_columns() ) {
|
||||
|
143
wp-content/plugins/gp-premium/blog/functions/css/columns.css
Normal file
143
wp-content/plugins/gp-premium/blog/functions/css/columns.css
Normal file
@ -0,0 +1,143 @@
|
||||
.masonry-enabled .page-header {
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.separate-containers .site-main > .generate-columns-container {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.masonry-container.are-images-unloaded,
|
||||
.load-more.are-images-unloaded,
|
||||
.masonry-enabled #nav-below {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.generate-columns-container:not(.masonry-container) {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.generate-columns-container:not(.masonry-container) .generate-columns {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.generate-columns .inside-article {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,
|
||||
.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image {
|
||||
float: none;
|
||||
text-align: center;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.generate-columns-container .paging-navigation,
|
||||
.generate-columns-container .page-header {
|
||||
flex: 1 1 100%;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.generate-columns-container .paging-navigation {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.no-sidebar .generate-columns-container .inside-article > * {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.load-more:not(.has-svg-icon) .button.loading:before {
|
||||
content: "\e900";
|
||||
display: inline-block;
|
||||
font-family: "GP Premium";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
animation: spin 2s infinite linear;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.load-more .button:not(.loading) .gp-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.load-more .gp-icon svg {
|
||||
animation: spin 2s infinite linear;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.generate-columns {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.generate-columns.grid-20 {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-25 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-33 {
|
||||
width: 33.3333%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-60 {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-66 {
|
||||
width: 66.66667%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.generate-columns.tablet-grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.generate-columns-activated .generate-columns-container {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.generate-columns-container > * {
|
||||
padding-left: 0;
|
||||
}
|
||||
.generate-columns-container .page-header {
|
||||
margin-left: 0;
|
||||
}
|
||||
.generate-columns.mobile-grid-100 {
|
||||
width: 100%;
|
||||
}
|
||||
.generate-columns-container > .paging-navigation {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.load-more {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
1
wp-content/plugins/gp-premium/blog/functions/css/columns.min.css
vendored
Normal file
1
wp-content/plugins/gp-premium/blog/functions/css/columns.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){display:flex;flex-flow:row wrap;align-items:stretch}.generate-columns-container:not(.masonry-container) .generate-columns{display:flex}.generate-columns .inside-article{width:100%;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.no-sidebar .generate-columns-container .inside-article>*{max-width:none}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{animation:spin 2s infinite linear;margin-right:7px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.generate-columns{box-sizing:border-box}.generate-columns.grid-20{width:20%}.generate-columns.grid-25{width:25%}.generate-columns.grid-33{width:33.3333%}.generate-columns.grid-50{width:50%}.generate-columns.grid-60{width:60%}.generate-columns.grid-66{width:66.66667%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100{width:100%}.generate-columns-container>.paging-navigation{margin-left:0}}@media (max-width:768px){.load-more{display:block;text-align:center;margin-bottom:0}}
|
@ -0,0 +1,110 @@
|
||||
.post-image-above-header .inside-article .post-image,
|
||||
.post-image-above-header .inside-article .featured-image {
|
||||
margin-top: 0;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .inside-article .post-image,
|
||||
.post-image-aligned-left .inside-article .featured-image {
|
||||
margin-top: 0;
|
||||
margin-right: 2em;
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.post-image-aligned-center .post-image,
|
||||
.post-image-aligned-center .featured-image {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.post-image-aligned-right .inside-article .post-image,
|
||||
.post-image-aligned-right .inside-article .featured-image {
|
||||
margin-top: 0;
|
||||
margin-left: 2em;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.post-image-below-header.post-image-aligned-right .inside-article .post-image,
|
||||
.post-image-below-header.post-image-aligned-right .inside-article .featured-image,
|
||||
.post-image-below-header.post-image-aligned-center .inside-article .featured-image,
|
||||
.post-image-below-header.post-image-aligned-left .inside-article .post-image,
|
||||
.post-image-below-header.post-image-aligned-left .inside-article .featured-image {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.post-image-aligned-left > .featured-image,
|
||||
.post-image-aligned-right > .featured-image {
|
||||
float: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .featured-image {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.post-image-aligned-right .featured-image {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .inside-article:before,
|
||||
.post-image-aligned-left .inside-article:after,
|
||||
.post-image-aligned-right .inside-article:before,
|
||||
.post-image-aligned-right .inside-article:after {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .inside-article:after,
|
||||
.post-image-aligned-right .inside-article:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .inside-article,
|
||||
.post-image-aligned-right .inside-article {
|
||||
zoom: 1;
|
||||
/* For IE 6/7 (trigger hasLayout) */
|
||||
}
|
||||
|
||||
.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image,
|
||||
.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
|
||||
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
|
||||
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image,
|
||||
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
body:not(.post-image-aligned-center) .inside-article .post-image,
|
||||
body:not(.post-image-aligned-center) .featured-image,
|
||||
body:not(.post-image-aligned-center) .inside-article .featured-image {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
float: none;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
1
wp-content/plugins/gp-premium/blog/functions/css/featured-images.min.css
vendored
Normal file
1
wp-content/plugins/gp-premium/blog/functions/css/featured-images.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.post-image-aligned-left .inside-article,.post-image-aligned-right .inside-article{zoom:1}.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image,.one-container.post-image-above-header .page-header+.no-featured-image-padding .inside-article .post-image{margin-top:0}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0;margin-right:0}.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}}
|
File diff suppressed because one or more lines are too long
@ -1,27 +1,27 @@
|
||||
.post-image-above-header .inside-article .post-image,
|
||||
.post-image-above-header .inside-article .featured-image {
|
||||
margin-top:0;
|
||||
margin-bottom:2em;
|
||||
margin-top: 0;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.post-image-aligned-left .inside-article .post-image,
|
||||
.post-image-aligned-left .inside-article .featured-image {
|
||||
margin-top:0;
|
||||
margin-right:2em;
|
||||
float:left;
|
||||
margin-top: 0;
|
||||
margin-right: 2em;
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.post-image-aligned-center .post-image,
|
||||
.post-image-aligned-center .featured-image {
|
||||
text-align:center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.post-image-aligned-right .inside-article .post-image,
|
||||
.post-image-aligned-right .inside-article .featured-image {
|
||||
margin-top:0;
|
||||
margin-left:2em;
|
||||
float:right;
|
||||
margin-top: 0;
|
||||
margin-left: 2em;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
.post-image-below-header.post-image-aligned-center .inside-article .featured-image,
|
||||
.post-image-below-header.post-image-aligned-left .inside-article .post-image,
|
||||
.post-image-below-header.post-image-aligned-left .inside-article .featured-image {
|
||||
margin-top:2em;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.post-image-aligned-left > .featured-image,
|
||||
@ -63,31 +63,52 @@
|
||||
|
||||
.post-image-aligned-left .inside-article,
|
||||
.post-image-aligned-right .inside-article {
|
||||
zoom: 1; /* For IE 6/7 (trigger hasLayout) */
|
||||
zoom: 1;
|
||||
/* For IE 6/7 (trigger hasLayout) */
|
||||
}
|
||||
|
||||
.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image,
|
||||
.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
|
||||
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
|
||||
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image,
|
||||
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,
|
||||
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image,
|
||||
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
body:not(.post-image-aligned-center) .inside-article .post-image,
|
||||
body:not(.post-image-aligned-center) .featured-image,
|
||||
body:not(.post-image-aligned-center) .inside-article .featured-image {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
float: none;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.masonry-enabled .page-header {
|
||||
position: relative !important;
|
||||
}
|
||||
@ -99,33 +120,22 @@
|
||||
.masonry-container.are-images-unloaded,
|
||||
.load-more.are-images-unloaded,
|
||||
.masonry-enabled #nav-below {
|
||||
opacity: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.generate-columns-container:not(.masonry-container) {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-flex-flow: row wrap;
|
||||
-ms-flex-flow: row wrap;
|
||||
flex-flow: row wrap;
|
||||
|
||||
-webkit-align-items: stretch;
|
||||
-ms-flex-align: stretch;
|
||||
align-items: stretch;
|
||||
flex-flow: row wrap;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.generate-columns-container:not(.masonry-container) .generate-columns {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.generate-columns .inside-article {
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@ -139,10 +149,7 @@
|
||||
|
||||
.generate-columns-container .paging-navigation,
|
||||
.generate-columns-container .page-header {
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-flex: 1 1 100%;
|
||||
-ms-flex: 1 1 100%;
|
||||
flex: 1 1 100%;
|
||||
flex: 1 1 100%;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@ -157,16 +164,12 @@
|
||||
.load-more:not(.has-svg-icon) .button.loading:before {
|
||||
content: "\e900";
|
||||
display: inline-block;
|
||||
font-family: "GP Premium";
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
font-family: "GP Premium";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
animation: spin 2s infinite linear;
|
||||
margin-right: 7px;
|
||||
}
|
||||
@ -176,23 +179,53 @@
|
||||
}
|
||||
|
||||
.load-more .gp-icon svg {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.generate-columns {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.generate-columns.grid-20 {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-25 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-33 {
|
||||
width: 33.3333%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-60 {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-66 {
|
||||
width: 66.66667%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.generate-columns.tablet-grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.generate-columns-activated .generate-columns-container {
|
||||
margin-left: 0;
|
||||
@ -204,21 +237,18 @@
|
||||
.generate-columns-container .page-header {
|
||||
margin-left: 0;
|
||||
}
|
||||
.generate-columns.mobile-grid-100 {
|
||||
width: 100%;
|
||||
}
|
||||
.generate-columns-container > .paging-navigation {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:768px) {
|
||||
body:not(.post-image-aligned-center) .inside-article .post-image,
|
||||
body:not(.post-image-aligned-center) .featured-image,
|
||||
body:not(.post-image-aligned-center) .inside-article .featured-image {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
float: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.load-more {
|
||||
display: block;
|
||||
text-align:center;
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
1
wp-content/plugins/gp-premium/blog/functions/css/style.min.css
vendored
Normal file
1
wp-content/plugins/gp-premium/blog/functions/css/style.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -14,6 +14,8 @@ if ( ! function_exists( 'generate_blog_scripts' ) ) {
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
function generate_blog_scripts() {
|
||||
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
@ -47,15 +49,80 @@ if ( ! function_exists( 'generate_blog_scripts' ) ) {
|
||||
}
|
||||
|
||||
if ( ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) || ( $settings[ 'infinite_scroll' ] && ! is_singular() && ! is_404() ) ) {
|
||||
wp_enqueue_script( 'generate-blog', plugin_dir_url( __FILE__ ) . 'js/scripts.min.js', $deps, GENERATE_BLOG_VERSION, true );
|
||||
wp_localize_script( 'generate-blog', 'blog', array(
|
||||
'more' => $settings['masonry_load_more'],
|
||||
'loading' => $settings['masonry_loading'],
|
||||
'icon' => function_exists( 'generate_get_svg_icon' ) ? generate_get_svg_icon( 'spinner' ) : '',
|
||||
) );
|
||||
wp_enqueue_script( 'generate-blog', plugin_dir_url( __FILE__ ) . "js/scripts{$suffix}.js", $deps, GENERATE_BLOG_VERSION, true );
|
||||
|
||||
wp_localize_script(
|
||||
'generate-blog',
|
||||
'generateBlog',
|
||||
array(
|
||||
'more' => $settings['masonry_load_more'],
|
||||
'loading' => $settings['masonry_loading'],
|
||||
'icon' => function_exists( 'generate_get_svg_icon' ) ? generate_get_svg_icon( 'spinner' ) : '',
|
||||
'masonryInit' => apply_filters(
|
||||
'generate_blog_masonry_init',
|
||||
array(
|
||||
'columnWidth' => '.grid-sizer',
|
||||
'itemSelector' => 'none',
|
||||
'stamp' => '.page-header',
|
||||
'percentPosition' => true,
|
||||
'stagger' => 30,
|
||||
'visibleStyle' => array(
|
||||
'transform' => 'translateY(0)',
|
||||
'opacity' => 1,
|
||||
),
|
||||
'hiddenStyle' => array(
|
||||
'transform' => 'translateY(5px)',
|
||||
'opacity' => 0,
|
||||
),
|
||||
)
|
||||
),
|
||||
'infiniteScrollInit' => apply_filters(
|
||||
'generate_blog_infinite_scroll_init',
|
||||
array(
|
||||
'path' => '.nav-links .next',
|
||||
'append' => '#main article',
|
||||
'history' => false,
|
||||
'loadOnScroll' => $settings['infinite_scroll_button'] ? false : true,
|
||||
'button' => $settings['infinite_scroll_button'] ? '.load-more a' : null,
|
||||
'scrollThreshold' => $settings['infinite_scroll_button'] ? false : 600,
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'generate-blog', plugin_dir_url( __FILE__ ) . 'css/style-min.css', array(), GENERATE_BLOG_VERSION );
|
||||
$needs_columns_css = false;
|
||||
$needs_featured_image_css = false;
|
||||
|
||||
if ( ( ! is_singular() && $settings['column_layout'] ) || $settings['infinite_scroll'] ) {
|
||||
$needs_columns_css = true;
|
||||
}
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
if ( $settings['post_image'] ) {
|
||||
$needs_featured_image_css = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_page() && has_post_thumbnail() ) {
|
||||
if ( $settings['page_post_image'] ) {
|
||||
$needs_featured_image_css = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_single() && has_post_thumbnail() ) {
|
||||
if ( $settings['single_post_image'] ) {
|
||||
$needs_featured_image_css = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $needs_columns_css && $needs_featured_image_css ) {
|
||||
wp_enqueue_style( 'generate-blog', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_BLOG_VERSION );
|
||||
} elseif ( $needs_columns_css ) {
|
||||
wp_enqueue_style( 'generate-blog-columns', plugin_dir_url( __FILE__ ) . "css/columns{$suffix}.css", array(), GENERATE_BLOG_VERSION );
|
||||
} elseif ( $needs_featured_image_css ) {
|
||||
wp_enqueue_style( 'generate-blog-images', plugin_dir_url( __FILE__ ) . "css/featured-images{$suffix}.css", array(), GENERATE_BLOG_VERSION );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,31 +287,37 @@ if ( ! function_exists( 'generate_blog_css' ) ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// Get disable headline meta
|
||||
$disable_headline = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-disable-headline', true ) : '';
|
||||
|
||||
if ( ! $settings['categories'] && ! $settings['comments'] && ! $settings['tags'] && ! is_singular() ) {
|
||||
$return .= '.blog footer.entry-meta, .archive footer.entry-meta {display:none;}';
|
||||
if ( ! defined( 'GENERATE_VERSION' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $settings['single_date'] && ! $settings['single_author'] && $disable_headline && is_singular() ) {
|
||||
$return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}';
|
||||
}
|
||||
if ( version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) {
|
||||
// Get disable headline meta.
|
||||
$disable_headline = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-disable-headline', true ) : '';
|
||||
|
||||
if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) {
|
||||
$return .= '.entry-header .entry-meta {display:none;}';
|
||||
}
|
||||
if ( ! $settings['categories'] && ! $settings['comments'] && ! $settings['tags'] && ! is_singular() ) {
|
||||
$return .= '.blog footer.entry-meta, .archive footer.entry-meta {display:none;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['single_date'] && ! $settings['single_author'] && is_singular() ) {
|
||||
$return .= '.entry-header .entry-meta {display:none;}';
|
||||
}
|
||||
if ( ! $settings['single_date'] && ! $settings['single_author'] && $disable_headline && is_singular() ) {
|
||||
$return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['single_post_navigation'] && is_singular() ) {
|
||||
$return .= '.post-navigation {display:none;}';
|
||||
}
|
||||
if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) {
|
||||
$return .= '.entry-header .entry-meta {display:none;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['single_categories'] && ! $settings['single_post_navigation'] && ! $settings['single_tags'] && is_singular() ) {
|
||||
$return .= '.single footer.entry-meta {display:none;}';
|
||||
if ( ! $settings['single_date'] && ! $settings['single_author'] && is_singular() ) {
|
||||
$return .= '.entry-header .entry-meta {display:none;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['single_post_navigation'] && is_singular() ) {
|
||||
$return .= '.post-navigation {display:none;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['single_categories'] && ! $settings['single_post_navigation'] && ! $settings['single_tags'] && is_singular() ) {
|
||||
$return .= '.single footer.entry-meta {display:none;}';
|
||||
}
|
||||
}
|
||||
|
||||
$separator = 20;
|
||||
@ -349,16 +422,24 @@ if ( ! function_exists( 'generate_blog_excerpt_more' ) ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// If empty, return
|
||||
if ( '' == $generate_settings['read_more'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_excerpt_more_output', sprintf( ' ... <a title="%1$s" class="read-more" href="%2$s">%3$s</a>',
|
||||
the_title_attribute( 'echo=0' ),
|
||||
esc_url( get_permalink( get_the_ID() ) ),
|
||||
wp_kses_post( $generate_settings['read_more'] )
|
||||
) );
|
||||
return apply_filters(
|
||||
'generate_excerpt_more_output',
|
||||
sprintf(
|
||||
' ... <a title="%1$s" class="read-more" href="%2$s" aria-label="%4$s">%3$s</a>',
|
||||
the_title_attribute( 'echo=0' ),
|
||||
esc_url( get_permalink( get_the_ID() ) ),
|
||||
wp_kses_post( $generate_settings['read_more'] ),
|
||||
sprintf(
|
||||
/* translators: Aria-label describing the read more button */
|
||||
_x( 'More on %s', 'more on post title', 'gp-premium' ),
|
||||
the_title_attribute( 'echo=0' )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -373,17 +454,24 @@ if ( ! function_exists( 'generate_blog_content_more' ) ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// If empty, return
|
||||
if ( '' == $generate_settings['read_more'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_content_more_link_output', sprintf( '<p class="read-more-container"><a title="%1$s" class="read-more content-read-more" href="%2$s">%3$s%4$s</a></p>',
|
||||
the_title_attribute( 'echo=0' ),
|
||||
esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
|
||||
wp_kses_post( $generate_settings['read_more'] ),
|
||||
'<span class="screen-reader-text">' . get_the_title() . '</span>'
|
||||
) );
|
||||
return apply_filters(
|
||||
'generate_content_more_link_output',
|
||||
sprintf(
|
||||
'<p class="read-more-container"><a title="%1$s" class="read-more content-read-more" href="%2$s" aria-label="%4$s">%3$s</a></p>',
|
||||
the_title_attribute( 'echo=0' ),
|
||||
esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump', '#more-' . get_the_ID() ) ),
|
||||
wp_kses_post( $generate_settings['read_more'] ),
|
||||
sprintf(
|
||||
/* translators: Aria-label describing the read more button */
|
||||
_x( 'More on %s', 'more on post title', 'gp-premium' ),
|
||||
the_title_attribute( 'echo=0' )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,15 +573,18 @@ if ( ! function_exists( 'generate_disable_post_comments_link' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'next_post_link', 'generate_disable_post_navigation' );
|
||||
add_filter( 'previous_post_link', 'generate_disable_post_navigation' );
|
||||
add_filter( 'generate_show_post_navigation', 'generate_disable_post_navigation' );
|
||||
/**
|
||||
* Remove the single post navigation
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
function generate_disable_post_navigation( $navigation ) {
|
||||
return generate_disable_post_thing( $navigation, 'single_post_navigation' );
|
||||
if ( is_singular() ) {
|
||||
return generate_disable_post_thing( $navigation, 'single_post_navigation' );
|
||||
} else {
|
||||
return $navigation;
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'generate_excerpt_more_output', 'generate_blog_read_more_button' );
|
||||
|
@ -1,5 +1,13 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
/**
|
||||
* Functions specific to featured images.
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
/**
|
||||
* Collects all available image sizes which we use in the Customizer.
|
||||
@ -95,13 +103,13 @@ if ( ! function_exists( 'generate_get_blog_image_attributes' ) ) {
|
||||
$ignore_crop = array( '', '0', '9999' );
|
||||
|
||||
$atts = array(
|
||||
'width' => ( in_array( $settings["{$single}post_image_width"], $ignore_crop ) ) ? 9999 : absint( $settings["{$single}post_image_width"] ),
|
||||
'height' => ( in_array( $settings["{$single}post_image_height"], $ignore_crop ) ) ? 9999 : absint( $settings["{$single}post_image_height"] ),
|
||||
'crop' => ( in_array( $settings["{$single}post_image_width"], $ignore_crop ) || in_array( $settings["{$single}post_image_height"], $ignore_crop ) ) ? false : true
|
||||
'width' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_width" ] ),
|
||||
'height' => ( in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_height" ] ),
|
||||
'crop' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) || in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? false : true,
|
||||
);
|
||||
|
||||
// If there's no height or width, empty the array
|
||||
if ( 9999 == $atts[ 'width' ] && 9999 == $atts[ 'height' ] ) {
|
||||
// If there's no height or width, empty the array.
|
||||
if ( 9999 == $atts['width'] && 9999 == $atts['height'] ) { // phpcs:ignore
|
||||
$atts = array();
|
||||
}
|
||||
|
||||
@ -122,13 +130,13 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// Move our featured images to above the title
|
||||
if ( 'post-image-above-header' == $settings['post_image_position'] ) {
|
||||
// Move our featured images to above the title.
|
||||
if ( 'post-image-above-header' === $settings['post_image_position'] ) {
|
||||
remove_action( 'generate_after_entry_header', 'generate_post_image' );
|
||||
add_action( 'generate_before_content', 'generate_post_image' );
|
||||
|
||||
// If we're using the Page Header add-on, move those as well
|
||||
if ( function_exists('generate_page_header_post_image') ) {
|
||||
// If we're using the Page Header add-on, move those as well.
|
||||
if ( function_exists( 'generate_page_header_post_image' ) ) {
|
||||
remove_action( 'generate_after_entry_header', 'generate_page_header_post_image' );
|
||||
add_action( 'generate_before_content', 'generate_page_header_post_image' );
|
||||
}
|
||||
@ -137,12 +145,13 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
|
||||
$page_header_content = false;
|
||||
if ( function_exists( 'generate_page_header_get_options' ) ) {
|
||||
$options = generate_page_header_get_options();
|
||||
if ( '' !== $options[ 'content' ] ) {
|
||||
|
||||
if ( $options && '' !== $options['content'] ) {
|
||||
$page_header_content = true;
|
||||
}
|
||||
|
||||
// If our Page Header has no content, remove it
|
||||
// This will allow the Blog add-on to add an image for us
|
||||
// If our Page Header has no content, remove it.
|
||||
// This will allow the Blog add-on to add an image for us.
|
||||
if ( ! $page_header_content && is_singular() ) {
|
||||
remove_action( 'generate_before_content', 'generate_page_header' );
|
||||
remove_action( 'generate_after_entry_header', 'generate_page_header' );
|
||||
@ -150,23 +159,23 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the core theme featured image
|
||||
// I would like to filter instead one day
|
||||
// Remove the core theme featured image.
|
||||
// I would like to filter instead one day.
|
||||
remove_action( 'generate_after_header', 'generate_featured_page_header' );
|
||||
remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' );
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( $settings[$location . '_post_image'] && is_singular() && ! $page_header_content ) {
|
||||
if ( 'below-title' == $settings[$location . '_post_image_position'] ) {
|
||||
if ( $settings[ $location . '_post_image' ] && is_singular() && ! $page_header_content ) {
|
||||
if ( 'below-title' === $settings[ $location . '_post_image_position' ] ) {
|
||||
add_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' );
|
||||
}
|
||||
|
||||
if ( 'inside-content' == $settings[$location . '_post_image_position'] ) {
|
||||
if ( 'inside-content' === $settings[ $location . '_post_image_position' ] ) {
|
||||
add_action( 'generate_before_content', 'generate_blog_single_featured_image' );
|
||||
}
|
||||
|
||||
if ( 'above-content' == $settings[$location . '_post_image_position'] ) {
|
||||
if ( 'above-content' === $settings[ $location . '_post_image_position' ] ) {
|
||||
add_action( 'generate_after_header', 'generate_blog_single_featured_image' );
|
||||
}
|
||||
}
|
||||
@ -178,6 +187,7 @@ add_filter( 'generate_featured_image_output', 'generate_blog_featured_image' );
|
||||
* Remove featured image if set or using WooCommerce.
|
||||
*
|
||||
* @since 1.5
|
||||
* @param string $output The existing output.
|
||||
* @return string The image HTML
|
||||
*/
|
||||
function generate_blog_featured_image( $output ) {
|
||||
@ -219,15 +229,27 @@ function generate_blog_single_featured_image() {
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[$location . '_post_image'] || ! $image_id ) {
|
||||
if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[ $location . '_post_image' ] || ! $image_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$image_html = apply_filters( 'post_thumbnail_html',
|
||||
wp_get_attachment_image( $image_id, apply_filters( 'generate_page_header_default_size', 'full' ), '',
|
||||
array(
|
||||
'itemprop' => 'image',
|
||||
)
|
||||
$attrs = array(
|
||||
'itemprop' => 'image',
|
||||
);
|
||||
|
||||
if ( function_exists( 'generate_get_schema_type' ) ) {
|
||||
if ( 'microdata' !== generate_get_schema_type() ) {
|
||||
$attrs = array();
|
||||
}
|
||||
}
|
||||
|
||||
$image_html = apply_filters(
|
||||
'post_thumbnail_html', // phpcs:ignore -- Core filter.
|
||||
wp_get_attachment_image(
|
||||
$image_id,
|
||||
apply_filters( 'generate_page_header_default_size', 'full' ),
|
||||
'',
|
||||
$attrs
|
||||
),
|
||||
get_the_ID(),
|
||||
$image_id,
|
||||
@ -240,18 +262,23 @@ function generate_blog_single_featured_image() {
|
||||
$classes = array(
|
||||
is_page() ? 'page-header-image' : null,
|
||||
is_singular() && ! is_page() ? 'page-header-image-single' : null,
|
||||
'above-content' == $settings[$location . '_post_image_position'] ? 'grid-container grid-parent' : null,
|
||||
'above-content' === $settings[ $location . '_post_image_position' ] ? 'grid-container grid-parent' : null,
|
||||
);
|
||||
|
||||
$image_html = apply_filters( 'generate_single_featured_image_html', $image_html );
|
||||
|
||||
echo apply_filters( 'generate_single_featured_image_output', sprintf(
|
||||
'<div class="featured-image %2$s">
|
||||
%1$s
|
||||
</div>',
|
||||
$image_html,
|
||||
implode( ' ', $classes )
|
||||
), $image_html );
|
||||
// phpcs:ignore -- No need to escape here.
|
||||
echo apply_filters(
|
||||
'generate_single_featured_image_output',
|
||||
sprintf(
|
||||
'<div class="featured-image %2$s">
|
||||
%1$s
|
||||
</div>',
|
||||
$image_html,
|
||||
implode( ' ', $classes )
|
||||
),
|
||||
$image_html
|
||||
);
|
||||
}
|
||||
|
||||
add_filter( 'generate_blog_image_attributes', 'generate_blog_page_header_image_atts' );
|
||||
@ -274,13 +301,13 @@ function generate_blog_page_header_image_atts( $atts ) {
|
||||
|
||||
$options = generate_page_header_get_options();
|
||||
|
||||
if ( 'enable' == $options[ 'image_resize' ] ) {
|
||||
if ( $options && 'enable' === $options['image_resize'] ) {
|
||||
$ignore_crop = array( '', '0', '9999' );
|
||||
|
||||
$atts = array(
|
||||
'width' => ( in_array( $options[ 'image_width' ], $ignore_crop ) ) ? 9999 : absint( $options[ 'image_width' ] ),
|
||||
'height' => ( in_array( $options[ 'image_height' ], $ignore_crop ) ) ? 9999 : absint( $options[ 'image_height' ] ),
|
||||
'crop' => ( in_array( $options[ 'image_width' ], $ignore_crop ) || in_array( $options[ 'image_height' ], $ignore_crop ) ) ? false : true
|
||||
'width' => ( in_array( $options['image_width'], $ignore_crop ) ) ? 9999 : absint( $options['image_width'] ),
|
||||
'height' => ( in_array( $options['image_height'], $ignore_crop ) ) ? 9999 : absint( $options['image_height'] ),
|
||||
'crop' => ( in_array( $options['image_width'], $ignore_crop ) || in_array( $options['image_height'], $ignore_crop ) ) ? false : true,
|
||||
);
|
||||
}
|
||||
|
||||
@ -304,7 +331,7 @@ function generate_blog_page_header_link( $image_html ) {
|
||||
$options = generate_page_header_get_options();
|
||||
|
||||
if ( ! empty( $options['image_link'] ) ) {
|
||||
return '<a href="' . esc_url( $options[ 'image_link' ] ) . '"' . apply_filters( 'generate_page_header_link_target', '' ) . '>' . $image_html . '</a>';
|
||||
return '<a href="' . esc_url( $options['image_link'] ) . '"' . apply_filters( 'generate_page_header_link_target', '' ) . '>' . $image_html . '</a>';
|
||||
} else {
|
||||
return $image_html;
|
||||
}
|
||||
|
@ -3,15 +3,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
var msnry = false;
|
||||
|
||||
if ( $masonry_container.length ) {
|
||||
var $grid = $masonry_container.masonry({
|
||||
columnWidth: '.grid-sizer',
|
||||
itemSelector: 'none',
|
||||
stamp: '.page-header',
|
||||
percentPosition: true,
|
||||
stagger: 30,
|
||||
visibleStyle: { transform: 'translateY(0)', opacity: 1 },
|
||||
hiddenStyle: { transform: 'translateY(5px)', opacity: 0 },
|
||||
} );
|
||||
var $grid = $masonry_container.masonry( generateBlog.masonryInit );
|
||||
|
||||
msnry = $grid.data( 'masonry' );
|
||||
|
||||
@ -37,22 +29,19 @@ jQuery( document ).ready( function( $ ) {
|
||||
var $button = $( '.load-more a' );
|
||||
var svgIcon = '';
|
||||
|
||||
if ( blog.icon ) {
|
||||
svgIcon = blog.icon;
|
||||
if ( generateBlog.icon ) {
|
||||
svgIcon = generateBlog.icon;
|
||||
}
|
||||
|
||||
$container.infiniteScroll( {
|
||||
path: '.nav-links .next',
|
||||
append: '#main article',
|
||||
history: false,
|
||||
outlayer: msnry,
|
||||
loadOnScroll: $button.length ? false : true,
|
||||
button: $button.length ? '.load-more a' : null,
|
||||
scrollThreshold: $button.length ? false : 600,
|
||||
} );
|
||||
var infiniteScrollInit = generateBlog.infiniteScrollInit;
|
||||
|
||||
infiniteScrollInit.outlayer = msnry;
|
||||
|
||||
$container.infiniteScroll( infiniteScrollInit );
|
||||
|
||||
$button.on( 'click', function( e ) {
|
||||
$( this ).html( svgIcon + blog.loading ).addClass( 'loading' );
|
||||
document.activeElement.blur();
|
||||
$( this ).html( svgIcon + generateBlog.loading ).addClass( 'loading' );
|
||||
} );
|
||||
|
||||
$container.on( 'append.infiniteScroll', function( event, response, path, items ) {
|
||||
@ -60,8 +49,11 @@ jQuery( document ).ready( function( $ ) {
|
||||
$container.append( $button.parent() );
|
||||
}
|
||||
|
||||
// Fix srcset images not loading in Safari.
|
||||
// img.outerHTML = img.outerHTML isn't minified properly, so we need the extra var.
|
||||
$( items ).find( 'img' ).each( function( index, img ) {
|
||||
img.outerHTML = img.outerHTML;
|
||||
var imgOuterHTML = img.outerHTML;
|
||||
img.outerHTML = imgOuterHTML;
|
||||
} );
|
||||
|
||||
if ( $grid ) {
|
||||
@ -70,7 +62,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
} );
|
||||
}
|
||||
|
||||
$button.html( svgIcon + blog.more ).removeClass( 'loading' );
|
||||
$button.html( svgIcon + generateBlog.more ).removeClass( 'loading' );
|
||||
} );
|
||||
|
||||
$container.on( 'last.infiniteScroll', function() {
|
||||
|
@ -1 +1 @@
|
||||
jQuery(document).ready(function(t){var n=t(".masonry-container"),o=!1;if(n.length){var i=n.masonry({columnWidth:".grid-sizer",itemSelector:"none",stamp:".page-header",percentPosition:!0,stagger:30,visibleStyle:{transform:"translateY(0)",opacity:1},hiddenStyle:{transform:"translateY(5px)",opacity:0}});o=i.data("masonry"),i.imagesLoaded(function(){i.masonry("layout"),i.removeClass("are-images-unloaded"),t(".load-more").removeClass("are-images-unloaded"),t("#nav-below").css("opacity","1"),i.masonry("option",{itemSelector:".masonry-post"});var n=i.find(".masonry-post");i.masonry("appended",n)}),t("#nav-below").insertAfter(".masonry-container"),t(window).on("orientationchange",function(n){i.masonry("layout")})}if(t(".infinite-scroll").length&&t(".nav-links .next").length){var l=t("#main article").first().parent(),r=t(".load-more a"),s="";blog.icon&&(s=blog.icon),l.infiniteScroll({path:".nav-links .next",append:"#main article",history:!1,outlayer:o,loadOnScroll:!r.length,button:r.length?".load-more a":null,scrollThreshold:!r.length&&600}),r.on("click",function(n){t(this).html(s+blog.loading).addClass("loading")}),l.on("append.infiniteScroll",function(n,o,e,a){t(".generate-columns-container").length||l.append(r.parent()),t(a).find("img").each(function(n,o){o.outerHTML=o.outerHTML}),i&&i.imagesLoaded(function(){i.masonry("layout")}),r.html(s+blog.more).removeClass("loading")}),l.on("last.infiniteScroll",function(){t(".load-more").hide()})}});
|
||||
jQuery(document).ready(function(t){var i,r,l,s,n,e=t(".masonry-container"),o=!1;e.length&&(o=(i=e.masonry(generateBlog.masonryInit)).data("masonry"),i.imagesLoaded(function(){i.masonry("layout"),i.removeClass("are-images-unloaded"),t(".load-more").removeClass("are-images-unloaded"),t("#nav-below").css("opacity","1"),i.masonry("option",{itemSelector:".masonry-post"});var n=i.find(".masonry-post");i.masonry("appended",n)}),t("#nav-below").insertAfter(".masonry-container"),t(window).on("orientationchange",function(n){i.masonry("layout")})),t(".infinite-scroll").length&&t(".nav-links .next").length&&(r=t("#main article").first().parent(),l=t(".load-more a"),s="",generateBlog.icon&&(s=generateBlog.icon),(n=generateBlog.infiniteScrollInit).outlayer=o,r.infiniteScroll(n),l.on("click",function(n){document.activeElement.blur(),t(this).html(s+generateBlog.loading).addClass("loading")}),r.on("append.infiniteScroll",function(n,e,o,a){t(".generate-columns-container").length||r.append(l.parent()),t(a).find("img").each(function(n,e){var o=e.outerHTML;e.outerHTML=o}),i&&i.imagesLoaded(function(){i.masonry("layout")}),l.html(s+generateBlog.more).removeClass("loading")}),r.on("last.infiniteScroll",function(){t(".load-more").hide()}))});
|
Reference in New Issue
Block a user