modified file bootstrap-buttons.css
This commit is contained in:
@ -1,169 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This file handles column-related functionality.
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_get_columns' ) ) {
|
||||
/**
|
||||
* Initiate columns.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_get_columns() {
|
||||
$generate_blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// 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;
|
||||
|
||||
// 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.
|
||||
$columns = ( is_singular() ) ? false : $columns;
|
||||
|
||||
// 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.
|
||||
if ( is_search() ) {
|
||||
global $wp_query;
|
||||
|
||||
// phpcs:ignore -- non-strict comparison allowed.
|
||||
if ( 0 == $wp_query->post_count ) {
|
||||
$columns = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the result.
|
||||
return apply_filters( 'generate_blog_columns', $columns );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_get_masonry' ) ) {
|
||||
/**
|
||||
* Check if masonry is enabled.
|
||||
* This function is a mess with strings as bools etc.. Will re-write in a big upate to get lots of testing.
|
||||
*/
|
||||
function generate_blog_get_masonry() {
|
||||
$generate_blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// 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 {
|
||||
$masonry = 'false';
|
||||
}
|
||||
|
||||
// Allow masonry to be turned off using a boolean.
|
||||
if ( false === apply_filters( 'generate_blog_masonry', 'false' ) ) {
|
||||
$masonry = 'false';
|
||||
}
|
||||
|
||||
return $masonry;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_add_columns_container' ) ) {
|
||||
add_action( 'generate_before_main_content', 'generate_blog_add_columns_container' );
|
||||
/**
|
||||
* Add columns container
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function generate_blog_add_columns_container() {
|
||||
if ( ! generate_blog_get_columns() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$columns = generate_blog_get_column_count();
|
||||
|
||||
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 grid-' . esc_attr( $columns ) . ' tablet-grid-50 mobile-grid-100"></div>' : '' // phpcs:ignore -- no escaping needed.
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_add_ending_columns_container' ) ) {
|
||||
add_action( 'generate_after_main_content', 'generate_blog_add_ending_columns_container' );
|
||||
/**
|
||||
* Add closing columns container
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function generate_blog_add_ending_columns_container() {
|
||||
if ( ! generate_blog_get_columns() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '</div><!-- .generate-columns-contaier -->';
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_columns_css' ) ) {
|
||||
/**
|
||||
* Add inline CSS
|
||||
*/
|
||||
function generate_blog_columns_css() {
|
||||
$generate_blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( function_exists( 'generate_spacing_get_defaults' ) ) {
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
}
|
||||
|
||||
$separator = ( function_exists( 'generate_spacing_get_defaults' ) ) ? absint( $spacing_settings['separator'] ) : 20;
|
||||
|
||||
$return = '';
|
||||
if ( generate_blog_get_columns() ) {
|
||||
$return .= '.generate-columns {margin-bottom: ' . $separator . 'px;padding-left: ' . $separator . 'px;}';
|
||||
$return .= '.generate-columns-container {margin-left: -' . $separator . 'px;}';
|
||||
$return .= '.page-header {margin-bottom: ' . $separator . 'px;margin-left: ' . $separator . 'px}';
|
||||
$return .= '.generate-columns-container > .paging-navigation {margin-left: ' . $separator . 'px;}';
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_get_column_count' ) ) {
|
||||
/**
|
||||
* Get our column grid class
|
||||
*/
|
||||
function generate_blog_get_column_count() {
|
||||
$generate_blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
$count = $generate_blog_settings['columns'];
|
||||
|
||||
return apply_filters( 'generate_blog_get_column_count', $count );
|
||||
}
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
.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-wrap: wrap;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.generate-columns .inside-article {
|
||||
height: 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;
|
||||
}
|
||||
|
||||
.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,
|
||||
.grid-sizer.grid-20 {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-25,
|
||||
.grid-sizer.grid-25 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-33,
|
||||
.grid-sizer.grid-33 {
|
||||
width: 33.3333%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-50,
|
||||
.grid-sizer.grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-60,
|
||||
.grid-sizer.grid-60 {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-66,
|
||||
.grid-sizer.grid-66 {
|
||||
width: 66.66667%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-100,
|
||||
.grid-sizer.grid-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.generate-columns.tablet-grid-50,
|
||||
.grid-sizer.tablet-grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.generate-columns-activated .generate-columns-container {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.generate-columns-container > *,
|
||||
.generate-columns-container .generate-columns {
|
||||
padding-left: 0;
|
||||
}
|
||||
.generate-columns-container .page-header {
|
||||
margin-left: 0;
|
||||
}
|
||||
.generate-columns.mobile-grid-100,
|
||||
.grid-sizer.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 +0,0 @@
|
||||
.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-wrap:wrap;align-items:stretch}.generate-columns .inside-article{height: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}.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,.grid-sizer.grid-20{width:20%}.generate-columns.grid-25,.grid-sizer.grid-25{width:25%}.generate-columns.grid-33,.grid-sizer.grid-33{width:33.3333%}.generate-columns.grid-50,.grid-sizer.grid-50{width:50%}.generate-columns.grid-60,.grid-sizer.grid-60{width:60%}.generate-columns.grid-66,.grid-sizer.grid-66{width:66.66667%}.generate-columns.grid-100,.grid-sizer.grid-100{width:100%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50,.grid-sizer.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container .generate-columns,.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100,.grid-sizer.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,104 +0,0 @@
|
||||
.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;
|
||||
}
|
||||
|
||||
.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 +0,0 @@
|
||||
.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}.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}}
|
@ -1,254 +0,0 @@
|
||||
.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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.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-wrap: wrap;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.generate-columns .inside-article {
|
||||
height: 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;
|
||||
}
|
||||
|
||||
.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,
|
||||
.grid-sizer.grid-20 {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-25,
|
||||
.grid-sizer.grid-25 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-33,
|
||||
.grid-sizer.grid-33 {
|
||||
width: 33.3333%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-50,
|
||||
.grid-sizer.grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-60,
|
||||
.grid-sizer.grid-60 {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-66,
|
||||
.grid-sizer.grid-66 {
|
||||
width: 66.66667%;
|
||||
}
|
||||
|
||||
.generate-columns.grid-100,
|
||||
.grid-sizer.grid-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.generate-columns.tablet-grid-50,
|
||||
.grid-sizer.tablet-grid-50 {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.generate-columns-activated .generate-columns-container {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.generate-columns-container > *,
|
||||
.generate-columns-container .generate-columns {
|
||||
padding-left: 0;
|
||||
}
|
||||
.generate-columns-container .page-header {
|
||||
margin-left: 0;
|
||||
}
|
||||
.generate-columns.mobile-grid-100,
|
||||
.grid-sizer.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;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,58 +0,0 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
|
||||
if ( ! function_exists( 'generate_blog_get_defaults' ) ) {
|
||||
/**
|
||||
* Set our defaults
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_get_defaults() {
|
||||
$generate_blog_defaults = array(
|
||||
'excerpt_length' => '55',
|
||||
'read_more' => __( 'Read more', 'gp-premium' ),
|
||||
'read_more_button' => false,
|
||||
'masonry' => false,
|
||||
'masonry_load_more' => __( '+ More', 'gp-premium' ),
|
||||
'masonry_loading' => __( 'Loading...', 'gp-premium' ),
|
||||
'infinite_scroll' => false,
|
||||
'infinite_scroll_button' => false,
|
||||
'post_image' => true,
|
||||
'post_image_position' => '',
|
||||
'post_image_alignment' => 'post-image-aligned-center',
|
||||
'post_image_size' => 'full',
|
||||
'post_image_width' => '',
|
||||
'post_image_height' => '',
|
||||
'post_image_padding' => true,
|
||||
'single_post_image' => true,
|
||||
'single_post_image_position' => 'inside-content',
|
||||
'single_post_image_alignment' => 'center',
|
||||
'single_post_image_size' => 'full',
|
||||
'single_post_image_width' => '',
|
||||
'single_post_image_height' => '',
|
||||
'single_post_image_padding' => true,
|
||||
'page_post_image' => true,
|
||||
'page_post_image_position' => 'above-content',
|
||||
'page_post_image_alignment' => 'center',
|
||||
'page_post_image_size' => 'full',
|
||||
'page_post_image_width' => '',
|
||||
'page_post_image_height' => '',
|
||||
'page_post_image_padding' => true,
|
||||
'date' => true,
|
||||
'author' => true,
|
||||
'categories' => true,
|
||||
'tags' => true,
|
||||
'comments' => true,
|
||||
'single_date' => true,
|
||||
'single_author' => true,
|
||||
'single_categories' => true,
|
||||
'single_tags' => true,
|
||||
'single_post_navigation' => true,
|
||||
'column_layout' => false,
|
||||
'columns' => '50',
|
||||
'featured_column' => false,
|
||||
);
|
||||
|
||||
return apply_filters( 'generate_blog_option_defaults', $generate_blog_defaults );
|
||||
}
|
||||
}
|
@ -1,714 +0,0 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
|
||||
// Pull in our defaults and functions
|
||||
require plugin_dir_path( __FILE__ ) . 'defaults.php';
|
||||
require plugin_dir_path( __FILE__ ) . 'images.php';
|
||||
require plugin_dir_path( __FILE__ ) . 'columns.php';
|
||||
require plugin_dir_path( __FILE__ ) . 'customizer.php';
|
||||
require plugin_dir_path( __FILE__ ) . 'migrate.php';
|
||||
|
||||
if ( ! function_exists( 'generate_blog_scripts' ) ) {
|
||||
add_action( 'wp_enqueue_scripts', 'generate_blog_scripts', 50 );
|
||||
/**
|
||||
* 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()
|
||||
);
|
||||
|
||||
wp_add_inline_style( 'generate-style', generate_blog_css() );
|
||||
wp_add_inline_style( 'generate-style', generate_blog_columns_css() );
|
||||
|
||||
$deps = array();
|
||||
|
||||
if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) {
|
||||
$deps[] = 'masonry';
|
||||
$deps[] = 'imagesloaded';
|
||||
}
|
||||
|
||||
if ( $settings[ 'infinite_scroll' ] && ! is_singular() && ! is_404() && ! is_post_type_archive( 'product' ) ) {
|
||||
$deps[] = 'infinite-scroll';
|
||||
wp_enqueue_script( 'infinite-scroll', plugin_dir_url( __FILE__ ) . 'js/infinite-scroll.pkgd.min.js', array(), '3.0.6', true );
|
||||
|
||||
$font_icons = true;
|
||||
|
||||
if ( function_exists( 'generate_get_option' ) ) {
|
||||
if ( 'font' !== generate_get_option( 'icons' ) ) {
|
||||
$font_icons = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $settings['infinite_scroll_button'] && $font_icons ) {
|
||||
wp_enqueue_style( 'gp-premium-icons' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) || ( $settings[ 'infinite_scroll' ] && ! is_singular() && ! is_404() && ! is_post_type_archive( 'product' ) ) ) {
|
||||
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' => '.masonry-post',
|
||||
'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' => '.infinite-scroll-path a',
|
||||
'append' => '#main .infinite-scroll-item',
|
||||
'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,
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$needs_columns_css = false;
|
||||
$needs_featured_image_css = false;
|
||||
|
||||
if ( generate_blog_get_columns() || $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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_post_classes' ) ) {
|
||||
add_filter( 'post_class', 'generate_blog_post_classes' );
|
||||
/**
|
||||
* Adds custom classes to the content container
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_post_classes( $classes ) {
|
||||
global $wp_query;
|
||||
$paged = get_query_var( 'paged' );
|
||||
$paged = $paged ? $paged : 1;
|
||||
|
||||
// Get our options
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( $settings['infinite_scroll'] ) {
|
||||
$classes[] = 'infinite-scroll-item';
|
||||
}
|
||||
|
||||
// Set our masonry class
|
||||
if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) {
|
||||
$classes[] = 'masonry-post';
|
||||
}
|
||||
|
||||
// Set our column classes
|
||||
if ( generate_blog_get_columns() && ! is_singular() ) {
|
||||
$classes[] = 'generate-columns';
|
||||
$classes[] = 'tablet-grid-50';
|
||||
$classes[] = 'mobile-grid-100';
|
||||
$classes[] = 'grid-parent';
|
||||
|
||||
// Set our featured column class
|
||||
if ( $wp_query->current_post == 0 && $paged == 1 && $settings['featured_column'] ) {
|
||||
if ( 50 == generate_blog_get_column_count() ) {
|
||||
$classes[] = 'grid-100';
|
||||
}
|
||||
|
||||
if ( 33 == generate_blog_get_column_count() ) {
|
||||
$classes[] = 'grid-66';
|
||||
}
|
||||
|
||||
if ( 25 == generate_blog_get_column_count() ) {
|
||||
$classes[] = 'grid-50';
|
||||
}
|
||||
|
||||
if ( 20 == generate_blog_get_column_count() ) {
|
||||
$classes[] = 'grid-60';
|
||||
}
|
||||
$classes[] = 'featured-column';
|
||||
} else {
|
||||
$classes[] = 'grid-' . generate_blog_get_column_count();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $settings['post_image_padding'] && ! is_singular() ) {
|
||||
$classes[] = 'no-featured-image-padding';
|
||||
}
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( ! $settings[$location . '_post_image_padding'] && is_singular() ) {
|
||||
$classes[] = 'no-featured-image-padding';
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! is_singular() && has_post_thumbnail() && ! empty( $atts ) ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) {
|
||||
$classes[] = 'resize-featured-image';
|
||||
}
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_body_classes' ) ) {
|
||||
add_filter( 'body_class', 'generate_blog_body_classes' );
|
||||
/**
|
||||
* Adds custom classes to the body
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_body_classes( $classes ) {
|
||||
// Get theme options
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( is_singular() ) {
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( 'below-title' == $settings[$location . '_post_image_position'] ) {
|
||||
$classes[] = 'post-image-below-header';
|
||||
}
|
||||
|
||||
if ( 'inside-content' == $settings[$location . '_post_image_position'] ) {
|
||||
$classes[] = 'post-image-above-header';
|
||||
}
|
||||
|
||||
$classes[] = ( ! empty( $settings[$location . '_post_image_alignment'] ) ) ? 'post-image-aligned-' . $settings[$location . '_post_image_alignment'] : 'post-image-aligned-center';
|
||||
} else {
|
||||
$classes[] = ( '' == $settings['post_image_position'] ) ? 'post-image-below-header' : 'post-image-above-header';
|
||||
$classes[] = ( ! empty( $settings['post_image_alignment'] ) ) ? $settings['post_image_alignment'] : 'post-image-aligned-center';
|
||||
}
|
||||
|
||||
if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) {
|
||||
$classes[] = 'masonry-enabled';
|
||||
}
|
||||
|
||||
if ( generate_blog_get_columns() && ! is_singular() ) {
|
||||
$classes[] = 'generate-columns-activated';
|
||||
}
|
||||
|
||||
if ( $settings[ 'infinite_scroll' ] && ! is_singular() ) {
|
||||
$classes[] = 'infinite-scroll';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_excerpt_length' ) ) {
|
||||
add_filter( 'excerpt_length', 'generate_excerpt_length', 15 );
|
||||
/**
|
||||
* Set our excerpt length
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_excerpt_length( $length ) {
|
||||
$generate_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
return absint( apply_filters( 'generate_excerpt_length', $generate_settings['excerpt_length'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_css' ) ) {
|
||||
/**
|
||||
* Build our inline CSS
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_css() {
|
||||
global $post;
|
||||
$return = '';
|
||||
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ! defined( 'GENERATE_VERSION' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
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['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'] && $disable_headline && is_singular() ) {
|
||||
$return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) {
|
||||
$return .= '.entry-header .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;
|
||||
$content_padding_top = 40;
|
||||
$content_padding_right = 40;
|
||||
$content_padding_left = 40;
|
||||
$mobile_content_padding_top = 30;
|
||||
$mobile_content_padding_right = 30;
|
||||
$mobile_content_padding_left = 30;
|
||||
|
||||
if ( function_exists( 'generate_spacing_get_defaults' ) ) {
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
|
||||
$separator = absint( $spacing_settings['separator'] );
|
||||
$content_padding_top = absint( $spacing_settings['content_top'] );
|
||||
$content_padding_right = absint( $spacing_settings['content_right'] );
|
||||
$content_padding_left = absint( $spacing_settings['content_left'] );
|
||||
$mobile_content_padding_top = absint( $spacing_settings['mobile_content_top'] );
|
||||
$mobile_content_padding_right = absint( $spacing_settings['mobile_content_right'] );
|
||||
$mobile_content_padding_left = absint( $spacing_settings['mobile_content_left'] );
|
||||
}
|
||||
|
||||
if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) {
|
||||
$return .= '.page-header {margin-bottom: ' . $separator . 'px;margin-left: ' . $separator . 'px}';
|
||||
}
|
||||
|
||||
if ( $settings[ 'infinite_scroll' ] && ! is_singular() ) {
|
||||
$return .= '#nav-below {display:none;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['post_image_padding'] && 'post-image-aligned-center' == $settings['post_image_alignment'] && ! is_singular() ) {
|
||||
$return .= '.no-featured-image-padding .post-image {margin-left:-' . $content_padding_left . 'px;margin-right:-' . $content_padding_right . 'px;}';
|
||||
$return .= '.post-image-above-header .no-featured-image-padding .inside-article .post-image {margin-top:-' . $content_padding_top . 'px;}';
|
||||
}
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( ! $settings[$location . '_post_image_padding'] && 'center' == $settings[$location . '_post_image_alignment'] && is_singular() ) {
|
||||
$return .= '.no-featured-image-padding .featured-image {margin-left:-' . $content_padding_left . 'px;margin-right:-' . $content_padding_right . 'px;}';
|
||||
$return .= '.post-image-above-header .no-featured-image-padding .inside-article .featured-image {margin-top:-' . $content_padding_top . 'px;}';
|
||||
}
|
||||
|
||||
if ( ! $settings['page_post_image_padding'] || ! $settings['single_post_image_padding'] || ! $settings['post_image_padding'] ) {
|
||||
$return .= '@media ' . generate_premium_get_media_query( 'mobile' ) . '{';
|
||||
if ( ! $settings['post_image_padding'] && 'post-image-aligned-center' == $settings['post_image_alignment'] && ! is_singular() ) {
|
||||
$return .= '.no-featured-image-padding .post-image {margin-left:-' . $mobile_content_padding_left . 'px;margin-right:-' . $mobile_content_padding_right . 'px;}';
|
||||
$return .= '.post-image-above-header .no-featured-image-padding .inside-article .post-image {margin-top:-' . $mobile_content_padding_top . 'px;}';
|
||||
}
|
||||
|
||||
if ( ! $settings[$location . '_post_image_padding'] && 'center' == $settings[$location . '_post_image_alignment'] && is_singular() ) {
|
||||
$return .= '.no-featured-image-padding .featured-image {margin-left:-' . $mobile_content_padding_left . 'px;margin-right:-' . $mobile_content_padding_right . 'px;}';
|
||||
$return .= '.post-image-above-header .no-featured-image-padding .inside-article .featured-image {margin-top:-' . $mobile_content_padding_top . 'px;}';
|
||||
}
|
||||
$return .= '}';
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! empty( $atts ) ) {
|
||||
$image_width = $atts['width'] && 9999 !== $atts['width'] ? 'width: ' . $atts['width'] . 'px;' : '';
|
||||
$image_height = $atts['height'] && 9999 !== $atts['height'] ? 'height: ' . $atts['height'] . 'px;' : '';
|
||||
$image_crop = $atts['crop'] ? '-o-object-fit: cover;object-fit: cover;' : '';
|
||||
|
||||
if ( ! $image_width && $image_height ) {
|
||||
$image_crop = '-o-object-fit: cover;object-fit: cover;';
|
||||
}
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
$return .= '.resize-featured-image .post-image img {' . $image_width . $image_height . $image_crop . '}';
|
||||
}
|
||||
|
||||
if ( is_single() || is_page() ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) {
|
||||
$return .= '.featured-image img {' . $image_width . $image_height . $image_crop . '}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_excerpt_more' ) ) {
|
||||
add_filter( 'excerpt_more', 'generate_blog_excerpt_more', 15 );
|
||||
/**
|
||||
* Prints the read more HTML
|
||||
*/
|
||||
function generate_blog_excerpt_more( $more ) {
|
||||
$generate_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( '' == $generate_settings['read_more'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
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' )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_content_more' ) ) {
|
||||
add_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
|
||||
/**
|
||||
* Prints the read more HTML
|
||||
*/
|
||||
function generate_blog_content_more( $more ) {
|
||||
$generate_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
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" 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' )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the setting and returns false if $thing is disabled
|
||||
*
|
||||
* @since 1.4
|
||||
*
|
||||
* @param String $data The original data, passed through if not disabled
|
||||
* @param String $thing The name of the thing to check
|
||||
* @return String|False The original data, or false (if disabled)
|
||||
*/
|
||||
function generate_disable_post_thing( $data, $thing ) {
|
||||
$generate_blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ! $generate_blog_settings[$thing] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_disable_post_date' ) ) {
|
||||
add_filter( 'generate_post_date', 'generate_disable_post_date' );
|
||||
/**
|
||||
* Remove the post date if set
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_disable_post_date( $date ) {
|
||||
if ( is_singular() ) {
|
||||
return generate_disable_post_thing( $date, 'single_date' );
|
||||
} else {
|
||||
return generate_disable_post_thing( $date, 'date' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_disable_post_author' ) ) {
|
||||
add_filter( 'generate_post_author', 'generate_disable_post_author' );
|
||||
/**
|
||||
* Set the author if set
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_disable_post_author( $author ) {
|
||||
if ( is_singular() ) {
|
||||
return generate_disable_post_thing( $author, 'single_author' );
|
||||
} else {
|
||||
return generate_disable_post_thing( $author, 'author' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_disable_post_categories' ) ) {
|
||||
add_filter( 'generate_show_categories', 'generate_disable_post_categories' );
|
||||
/**
|
||||
* Remove the categories if set
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_disable_post_categories( $categories ) {
|
||||
if ( is_singular() ) {
|
||||
return generate_disable_post_thing( $categories, 'single_categories' );
|
||||
} else {
|
||||
return generate_disable_post_thing( $categories, 'categories' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_disable_post_tags' ) ) {
|
||||
add_filter( 'generate_show_tags', 'generate_disable_post_tags' );
|
||||
/**
|
||||
* Remove the tags if set
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_disable_post_tags( $tags ) {
|
||||
if ( is_singular() ) {
|
||||
return generate_disable_post_thing( $tags, 'single_tags' );
|
||||
} else {
|
||||
return generate_disable_post_thing( $tags, 'tags' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_disable_post_comments_link' ) ) {
|
||||
add_filter( 'generate_show_comments', 'generate_disable_post_comments_link' );
|
||||
/**
|
||||
* Remove the link to comments if set
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_disable_post_comments_link( $comments_link ) {
|
||||
return generate_disable_post_thing( $comments_link, 'comments' );
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'generate_show_post_navigation', 'generate_disable_post_navigation' );
|
||||
/**
|
||||
* Remove the single post navigation
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
function generate_disable_post_navigation( $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' );
|
||||
add_filter( 'generate_content_more_link_output', 'generate_blog_read_more_button' );
|
||||
/**
|
||||
* Add the button class to our read more link if set.
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @param string $output Our existing read more link.
|
||||
*/
|
||||
function generate_blog_read_more_button( $output ) {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ! $settings['read_more_button'] ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'%5$s<p class="read-more-container"><a title="%1$s" class="read-more button" 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( $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' )
|
||||
),
|
||||
'generate_excerpt_more_output' === current_filter() ? ' ... ' : ''
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_load_more' ) ) {
|
||||
add_action( 'generate_after_main_content', 'generate_blog_load_more', 20 );
|
||||
/**
|
||||
* Build our load more button
|
||||
*/
|
||||
function generate_blog_load_more() {
|
||||
// Get theme options
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ( ! $settings[ 'infinite_scroll_button' ] || ! $settings[ 'infinite_scroll' ] ) || is_singular() || is_404() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $wp_query;
|
||||
|
||||
if ( $wp_query->max_num_pages < 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( is_post_type_archive( 'product' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( is_tax( 'product_cat' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$icon = '';
|
||||
|
||||
if ( function_exists( 'generate_get_svg_icon' ) ) {
|
||||
$icon = generate_get_svg_icon( 'spinner' );
|
||||
}
|
||||
|
||||
printf(
|
||||
'<div class="masonry-load-more load-more %1$s %2$s">
|
||||
<a class="button" href="#">%3$s%4$s</a>
|
||||
</div>',
|
||||
$icon ? 'has-svg-icon' : '',
|
||||
( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) ? 'are-images-unloaded' : '',
|
||||
$icon,
|
||||
wp_kses_post( $settings['masonry_load_more'] )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see whether we're getting page or single post options.
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @return string Name of our singular template
|
||||
*/
|
||||
function generate_blog_get_singular_template() {
|
||||
$template = 'single';
|
||||
|
||||
if ( is_page() ) {
|
||||
$template = 'page';
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
add_action( 'generate_after_footer', 'generate_blog_do_infinite_scroll_path', 500 );
|
||||
/**
|
||||
* Add a next page of posts link for infinite scroll.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function generate_blog_do_infinite_scroll_path() {
|
||||
if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( $settings['infinite_scroll'] && ! is_singular() && ! is_404() ) {
|
||||
printf(
|
||||
'<div class="infinite-scroll-path" aria-hidden="true" style="display: none;">%s</div>',
|
||||
get_next_posts_link()
|
||||
);
|
||||
}
|
||||
}
|
@ -1,370 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @since 1.10.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function generate_blog_get_image_sizes() {
|
||||
$sizes = get_intermediate_image_sizes();
|
||||
|
||||
$new_sizes = array(
|
||||
'full' => 'full',
|
||||
);
|
||||
|
||||
foreach ( $sizes as $key => $name ) {
|
||||
$new_sizes[ $name ] = $name;
|
||||
}
|
||||
|
||||
return $new_sizes;
|
||||
}
|
||||
|
||||
add_filter( 'generate_page_header_default_size', 'generate_blog_set_featured_image_size' );
|
||||
/**
|
||||
* Set our featured image sizes.
|
||||
*
|
||||
* @since 1.10.0
|
||||
*
|
||||
* @param string $size The existing size.
|
||||
* @return string The new size.
|
||||
*/
|
||||
function generate_blog_set_featured_image_size( $size ) {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
$size = $settings['post_image_size'];
|
||||
}
|
||||
|
||||
if ( is_single() ) {
|
||||
$size = $settings['single_post_image_size'];
|
||||
}
|
||||
|
||||
if ( is_page() ) {
|
||||
$size = $settings['page_post_image_size'];
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! empty( $atts ) ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && $image_src[3] && apply_filters( 'generate_use_featured_image_size_match', true ) ) {
|
||||
return $values;
|
||||
} else {
|
||||
return $size;
|
||||
}
|
||||
}
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_get_blog_image_attributes' ) ) {
|
||||
/**
|
||||
* Build our image attributes
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_get_blog_image_attributes() {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( is_singular() ) {
|
||||
if ( is_singular( 'page' ) ) {
|
||||
$single = 'page_';
|
||||
} else {
|
||||
$single = 'single_';
|
||||
}
|
||||
} else {
|
||||
$single = '';
|
||||
}
|
||||
|
||||
$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,
|
||||
);
|
||||
|
||||
// If there's no height or width, empty the array.
|
||||
if ( 9999 == $atts['width'] && 9999 == $atts['height'] ) { // phpcs:ignore
|
||||
$atts = array();
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_blog_image_attributes', $atts );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_blog_setup' ) ) {
|
||||
add_action( 'wp', 'generate_blog_setup', 50 );
|
||||
/**
|
||||
* Setup our blog functions and actions
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_blog_setup() {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
// 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' ) ) {
|
||||
remove_action( 'generate_after_entry_header', 'generate_page_header_post_image' );
|
||||
add_action( 'generate_before_content', 'generate_page_header_post_image' );
|
||||
}
|
||||
}
|
||||
|
||||
$page_header_content = false;
|
||||
if ( function_exists( 'generate_page_header_get_options' ) ) {
|
||||
$options = generate_page_header_get_options();
|
||||
|
||||
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 ( ! $page_header_content && is_singular() ) {
|
||||
remove_action( 'generate_before_content', 'generate_page_header' );
|
||||
remove_action( 'generate_after_entry_header', 'generate_page_header' );
|
||||
remove_action( 'generate_after_header', 'generate_page_header' );
|
||||
}
|
||||
}
|
||||
|
||||
// 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' ] ) {
|
||||
add_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' );
|
||||
}
|
||||
|
||||
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' ] ) {
|
||||
add_action( 'generate_after_header', 'generate_blog_single_featured_image' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 ) {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings['post_image'] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build our featured images for single posts and pages.
|
||||
*
|
||||
* This function is way more complicated than it could be so it can
|
||||
* ensure compatibility with the Page Header add-on.
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @return string The image HTML
|
||||
*/
|
||||
function generate_blog_single_featured_image() {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
$image_id = get_post_thumbnail_id( get_the_ID(), 'full' );
|
||||
|
||||
if ( function_exists( 'generate_page_header_get_image' ) && generate_page_header_get_image( 'ID' ) ) {
|
||||
if ( intval( $image_id ) !== generate_page_header_get_image( 'ID' ) ) {
|
||||
$image_id = generate_page_header_get_image( 'ID' );
|
||||
}
|
||||
}
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[ $location . '_post_image' ] || ! $image_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$attrs = array(
|
||||
'itemprop' => 'image',
|
||||
);
|
||||
|
||||
if ( function_exists( 'generate_get_schema_type' ) ) {
|
||||
if ( 'microdata' !== generate_get_schema_type() ) {
|
||||
$attrs = array();
|
||||
}
|
||||
}
|
||||
|
||||
if ( function_exists( 'wp_get_loading_attr_default' ) ) {
|
||||
$attrs['loading'] = wp_get_loading_attr_default( 'the_post_thumbnail' );
|
||||
}
|
||||
|
||||
$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,
|
||||
apply_filters( 'generate_page_header_default_size', 'full' ),
|
||||
''
|
||||
);
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
$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,
|
||||
);
|
||||
|
||||
$image_html = apply_filters( 'generate_single_featured_image_html', $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' );
|
||||
/**
|
||||
* Filter our image attributes in case we're using differents atts in our Page Header
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @param array $atts Our existing image attributes.
|
||||
* @return array Image attributes
|
||||
*/
|
||||
function generate_blog_page_header_image_atts( $atts ) {
|
||||
if ( ! function_exists( 'generate_page_header_get_options' ) ) {
|
||||
return $atts;
|
||||
}
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
return $atts;
|
||||
}
|
||||
|
||||
$options = generate_page_header_get_options();
|
||||
|
||||
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,
|
||||
);
|
||||
}
|
||||
|
||||
return $atts;
|
||||
}
|
||||
|
||||
add_filter( 'generate_single_featured_image_html', 'generate_blog_page_header_link' );
|
||||
/**
|
||||
* Add our Page Header link to our featured image if set.
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @param string $image_html Our existing image HTML.
|
||||
* @return string Our new image HTML.
|
||||
*/
|
||||
function generate_blog_page_header_link( $image_html ) {
|
||||
if ( ! function_exists( 'generate_page_header_get_options' ) ) {
|
||||
return $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>';
|
||||
} else {
|
||||
return $image_html;
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'generate_blog_remove_featured_image_class', 20 );
|
||||
/**
|
||||
* Remove the featured image classes if they're disabled.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @param array $classes The body classes.
|
||||
*/
|
||||
function generate_blog_remove_featured_image_class( $classes ) {
|
||||
if ( is_singular() ) {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( is_single() ) {
|
||||
$disable_single_featured_image = ! $settings['single_post_image'];
|
||||
$classes = generate_premium_remove_featured_image_class( $classes, $disable_single_featured_image );
|
||||
}
|
||||
|
||||
if ( is_page() && ! $settings['page_post_image'] ) {
|
||||
$disable_page_featured_image = ! $settings['page_post_image'];
|
||||
$classes = generate_premium_remove_featured_image_class( $classes, $disable_page_featured_image );
|
||||
}
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
jQuery( function( $ ) {
|
||||
// Featured image controls
|
||||
var featuredImageArchiveControls = [
|
||||
'generate_blog_settings-post_image',
|
||||
'generate_blog_settings-post_image_padding',
|
||||
'generate_blog_settings-post_image_position',
|
||||
'generate_blog_settings-post_image_alignment',
|
||||
'generate_blog_settings-post_image_size',
|
||||
'generate_blog_settings-post_image_width',
|
||||
'generate_blog_settings-post_image_height',
|
||||
'generate_regenerate_images_notice',
|
||||
];
|
||||
|
||||
$.each( featuredImageArchiveControls, function( index, value ) {
|
||||
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-archives' );
|
||||
} );
|
||||
|
||||
var featuredImageSingleControls = [
|
||||
'generate_blog_settings-single_post_image',
|
||||
'generate_blog_settings-single_post_image_padding',
|
||||
'generate_blog_settings-single_post_image_position',
|
||||
'generate_blog_settings-single_post_image_alignment',
|
||||
'generate_blog_settings-single_post_image_size',
|
||||
'generate_blog_settings-single_post_image_width',
|
||||
'generate_blog_settings-single_post_image_height',
|
||||
'generate_regenerate_single_post_images_notice',
|
||||
];
|
||||
|
||||
$.each( featuredImageSingleControls, function( index, value ) {
|
||||
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-single' ).css( {
|
||||
visibility: 'hidden',
|
||||
height: '0',
|
||||
width: '0',
|
||||
margin: '0',
|
||||
overflow: 'hidden',
|
||||
} );
|
||||
} );
|
||||
|
||||
var featuredImagePageControls = [
|
||||
'generate_blog_settings-page_post_image',
|
||||
'generate_blog_settings-page_post_image_padding',
|
||||
'generate_blog_settings-page_post_image_position',
|
||||
'generate_blog_settings-page_post_image_alignment',
|
||||
'generate_blog_settings-page_post_image_size',
|
||||
'generate_blog_settings-page_post_image_width',
|
||||
'generate_blog_settings-page_post_image_height',
|
||||
'generate_regenerate_page_images_notice',
|
||||
];
|
||||
|
||||
$.each( featuredImagePageControls, function( index, value ) {
|
||||
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-page' ).css( {
|
||||
visibility: 'hidden',
|
||||
height: '0',
|
||||
width: '0',
|
||||
margin: '0',
|
||||
overflow: 'hidden',
|
||||
} );
|
||||
} );
|
||||
|
||||
// Post meta controls
|
||||
var postMetaArchiveControls = [
|
||||
'generate_settings-post_content',
|
||||
'generate_blog_settings-excerpt_length',
|
||||
'generate_blog_settings-read_more',
|
||||
'generate_blog_settings-read_more_button',
|
||||
'generate_blog_settings-date',
|
||||
'generate_blog_settings-author',
|
||||
'generate_blog_settings-categories',
|
||||
'generate_blog_settings-tags',
|
||||
'generate_blog_settings-comments',
|
||||
'generate_blog_settings-infinite_scroll',
|
||||
'generate_blog_settings-infinite_scroll_button',
|
||||
'blog_masonry_load_more_control',
|
||||
'blog_masonry_loading_control',
|
||||
];
|
||||
|
||||
$.each( postMetaArchiveControls, function( index, value ) {
|
||||
$( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-archives' );
|
||||
} );
|
||||
|
||||
var postMetaSingleControls = [
|
||||
'generate_blog_settings-single_date',
|
||||
'generate_blog_settings-single_author',
|
||||
'generate_blog_settings-single_categories',
|
||||
'generate_blog_settings-single_tags',
|
||||
'generate_blog_settings-single_post_navigation',
|
||||
];
|
||||
|
||||
$.each( postMetaSingleControls, function( index, value ) {
|
||||
$( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-single' ).css( {
|
||||
visibility: 'hidden',
|
||||
height: '0',
|
||||
width: '0',
|
||||
margin: '0',
|
||||
overflow: 'hidden',
|
||||
} );
|
||||
} );
|
||||
} );
|
@ -1,76 +0,0 @@
|
||||
/**
|
||||
* Theme Customizer enhancements for a better user experience.
|
||||
*
|
||||
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
// Container width
|
||||
wp.customize( 'generate_settings[container_width]', function( value ) {
|
||||
value.bind( function() {
|
||||
if ( $( '.masonry-container' )[ 0 ] ) {
|
||||
jQuery( '.masonry-container' ).imagesLoaded( function() {
|
||||
$container = jQuery( '.masonry-container' );
|
||||
if ( jQuery( $container ).length ) {
|
||||
$container.masonry( {
|
||||
columnWidth: '.grid-sizer',
|
||||
itemSelector: '.masonry-post',
|
||||
stamp: '.page-header',
|
||||
} );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
$( 'body' ).on( 'generate_spacing_updated', function() {
|
||||
if ( $( '.masonry-container' )[ 0 ] ) {
|
||||
jQuery( '.masonry-container' ).imagesLoaded( function() {
|
||||
$container = jQuery( '.masonry-container' );
|
||||
if ( jQuery( $container ).length ) {
|
||||
$container.masonry( {
|
||||
columnWidth: '.grid-sizer',
|
||||
itemSelector: '.masonry-post',
|
||||
stamp: '.page-header',
|
||||
} );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
/**
|
||||
* The first infinite scroll load in the Customizer misses article classes if they've been
|
||||
* added or removed in the previous refresh.
|
||||
*
|
||||
* This is totally hacky, but I'm just happy I finally got it working!
|
||||
*/
|
||||
var $container = $( '.infinite-scroll-item' ).first().parent();
|
||||
$container.on( 'load.infiniteScroll', function( event, response ) {
|
||||
var $posts = $( response ).find( 'article' );
|
||||
if ( wp.customize.value( 'generate_blog_settings[column_layout]' )() ) {
|
||||
$posts.addClass( 'generate-columns' );
|
||||
$posts.addClass( 'grid-parent' );
|
||||
$posts.addClass( 'grid-' + wp.customize.value( 'generate_blog_settings[columns]' )() );
|
||||
$posts.addClass( 'tablet-grid-50' );
|
||||
$posts.addClass( 'mobile-grid-100' );
|
||||
} else {
|
||||
$posts.removeClass( 'generate-columns' );
|
||||
$posts.removeClass( 'grid-parent' );
|
||||
$posts.removeClass( 'grid-' + wp.customize.value( 'generate_blog_settings[columns]' )() );
|
||||
$posts.removeClass( 'tablet-grid-50' );
|
||||
$posts.removeClass( 'mobile-grid-100' );
|
||||
}
|
||||
|
||||
if ( wp.customize.value( 'generate_blog_settings[masonry]' )() ) {
|
||||
$posts.addClass( 'masonry-post' );
|
||||
} else {
|
||||
$posts.removeClass( 'masonry-post' );
|
||||
}
|
||||
|
||||
if ( ! wp.customize.value( 'generate_blog_settings[post_image_padding]' )() ) {
|
||||
$posts.addClass( 'no-featured-image-padding' );
|
||||
} else {
|
||||
$posts.removeClass( 'no-featured-image-padding' );
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
File diff suppressed because one or more lines are too long
@ -1,100 +0,0 @@
|
||||
document.addEventListener( 'DOMContentLoaded', function() {
|
||||
var msnryContainer = document.querySelector( '.masonry-container' );
|
||||
|
||||
if ( msnryContainer ) {
|
||||
// eslint-disable-next-line no-undef -- Masonry is a dependency.
|
||||
var msnry = new Masonry( msnryContainer, generateBlog.masonryInit ),
|
||||
navBelow = document.querySelector( '#nav-below' ),
|
||||
loadMore = document.querySelector( '.load-more' );
|
||||
|
||||
// eslint-disable-next-line no-undef -- imagesLoaded is a dependency.
|
||||
imagesLoaded( msnryContainer, function() {
|
||||
msnry.layout();
|
||||
msnryContainer.classList.remove( 'are-images-unloaded' );
|
||||
|
||||
if ( loadMore ) {
|
||||
loadMore.classList.remove( 'are-images-unloaded' );
|
||||
}
|
||||
|
||||
if ( navBelow ) {
|
||||
navBelow.style.opacity = 1;
|
||||
}
|
||||
} );
|
||||
|
||||
if ( navBelow ) {
|
||||
msnryContainer.parentNode.insertBefore( navBelow, msnryContainer.nextSibling );
|
||||
}
|
||||
|
||||
window.addEventListener( 'orientationchange', function() {
|
||||
msnry.layout();
|
||||
} );
|
||||
}
|
||||
|
||||
var hasInfiniteScroll = document.querySelector( '.infinite-scroll' ),
|
||||
nextLink = document.querySelector( '.infinite-scroll-path a' );
|
||||
|
||||
if ( hasInfiniteScroll && nextLink ) {
|
||||
var infiniteItems = document.querySelectorAll( '.infinite-scroll-item' ),
|
||||
container = infiniteItems[ 0 ].parentNode,
|
||||
button = document.querySelector( '.load-more a' ),
|
||||
svgIcon = '';
|
||||
|
||||
if ( generateBlog.icon ) {
|
||||
svgIcon = generateBlog.icon;
|
||||
}
|
||||
|
||||
var infiniteScrollInit = generateBlog.infiniteScrollInit;
|
||||
|
||||
infiniteScrollInit.outlayer = msnry;
|
||||
|
||||
// eslint-disable-next-line no-undef -- InfiniteScroll is a dependency.
|
||||
var infiniteScroll = new InfiniteScroll( container, infiniteScrollInit );
|
||||
|
||||
if ( button ) {
|
||||
button.addEventListener( 'click', function( e ) {
|
||||
document.activeElement.blur();
|
||||
e.target.innerHTML = svgIcon + generateBlog.loading;
|
||||
e.target.classList.add( 'loading' );
|
||||
} );
|
||||
}
|
||||
|
||||
infiniteScroll.on( 'append', function( response, path, items ) {
|
||||
if ( button && ! document.querySelector( '.generate-columns-container' ) ) {
|
||||
container.appendChild( button.parentNode );
|
||||
}
|
||||
|
||||
items.forEach( function( element ) {
|
||||
var images = element.querySelectorAll( 'img' );
|
||||
|
||||
if ( images ) {
|
||||
images.forEach( function( image ) {
|
||||
var imgOuterHTML = image.outerHTML;
|
||||
image.outerHTML = imgOuterHTML;
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
if ( msnryContainer && msnry ) {
|
||||
// eslint-disable-next-line no-undef -- ImagesLoaded is a dependency.
|
||||
imagesLoaded( msnryContainer, function() {
|
||||
msnry.layout();
|
||||
} );
|
||||
}
|
||||
|
||||
if ( button ) {
|
||||
button.innerHTML = svgIcon + generateBlog.more;
|
||||
button.classList.remove( 'loading' );
|
||||
}
|
||||
|
||||
document.body.dispatchEvent( new Event( 'post-load' ) );
|
||||
} );
|
||||
|
||||
infiniteScroll.on( 'last', function() {
|
||||
var loadMoreElement = document.querySelector( '.load-more' );
|
||||
|
||||
if ( loadMoreElement ) {
|
||||
loadMoreElement.style.display = 'none';
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
@ -1 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded",function(){var t,e,n,r,a,i,l=document.querySelector(".masonry-container"),o=(l&&(t=new Masonry(l,generateBlog.masonryInit),e=document.querySelector("#nav-below"),n=document.querySelector(".load-more"),imagesLoaded(l,function(){t.layout(),l.classList.remove("are-images-unloaded"),n&&n.classList.remove("are-images-unloaded"),e&&(e.style.opacity=1)}),e&&l.parentNode.insertBefore(e,l.nextSibling),window.addEventListener("orientationchange",function(){t.layout()})),document.querySelector(".infinite-scroll")),c=document.querySelector(".infinite-scroll-path a");o&&c&&(r=document.querySelectorAll(".infinite-scroll-item")[0].parentNode,a=document.querySelector(".load-more a"),i="",generateBlog.icon&&(i=generateBlog.icon),(o=generateBlog.infiniteScrollInit).outlayer=t,c=new InfiniteScroll(r,o),a&&a.addEventListener("click",function(e){document.activeElement.blur(),e.target.innerHTML=i+generateBlog.loading,e.target.classList.add("loading")}),c.on("append",function(e,n,o){a&&!document.querySelector(".generate-columns-container")&&r.appendChild(a.parentNode),o.forEach(function(e){e=e.querySelectorAll("img");e&&e.forEach(function(e){var n=e.outerHTML;e.outerHTML=n})}),l&&t&&imagesLoaded(l,function(){t.layout()}),a&&(a.innerHTML=i+generateBlog.more,a.classList.remove("loading")),document.body.dispatchEvent(new Event("post-load"))}),c.on("last",function(){var e=document.querySelector(".load-more");e&&(e.style.display="none")}))});
|
@ -1,122 +0,0 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
|
||||
add_action( 'admin_init', 'generate_blog_update_visibility_settings' );
|
||||
/**
|
||||
* Migrates our old Blog settings so we can use checkboxes instead.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
function generate_blog_update_visibility_settings() {
|
||||
// Get our migration settings
|
||||
$settings = get_option( 'generate_migration_settings', array() );
|
||||
|
||||
// If we've already ran this function, bail
|
||||
if ( isset( $settings[ 'blog_visibility_updated' ] ) && 'true' == $settings[ 'blog_visibility_updated' ] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// A lot of the defaults changed, so lets put the old defaults here
|
||||
$defaults = array(
|
||||
'masonry' => 'false',
|
||||
'masonry_width' => 'width2',
|
||||
'masonry_most_recent_width' => 'width4',
|
||||
'post_image' => 'true',
|
||||
'date' => 'true',
|
||||
'author' => 'true',
|
||||
'categories' => 'true',
|
||||
'tags' => 'true',
|
||||
'comments' => 'true',
|
||||
);
|
||||
|
||||
// Get our spacing settings
|
||||
$blog_settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
$defaults
|
||||
);
|
||||
|
||||
$new_settings = array();
|
||||
|
||||
// These options use to be a select input with false + true values
|
||||
// This will make the false values empty so the options can be checkboxes
|
||||
$keys = array( 'date', 'author', 'categories', 'tags', 'comments', 'masonry', 'post_image' );
|
||||
foreach ( $keys as $key ) {
|
||||
if ( is_string( $blog_settings[ $key ] ) ) {
|
||||
if ( 'false' == $blog_settings[ $key ] ) {
|
||||
$new_settings[ $key ] = false;
|
||||
} elseif ( 'true' == $blog_settings[ $key ] ) {
|
||||
$new_settings[ $key ] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the single post meta options to whatever the blog options are
|
||||
$new_settings[ 'single_date' ] = isset( $new_settings[ 'date' ] ) ? $new_settings[ 'date' ] : true;
|
||||
$new_settings[ 'single_author' ] = isset( $new_settings[ 'author' ] ) ? $new_settings[ 'author' ] : true;
|
||||
$new_settings[ 'single_categories' ] = isset( $new_settings[ 'categories' ] ) ? $new_settings[ 'categories' ] : true;
|
||||
$new_settings[ 'single_tags' ] = isset( $new_settings[ 'tags' ] ) ? $new_settings[ 'tags' ] : true;
|
||||
|
||||
if ( isset( $new_settings[ 'masonry' ] ) && $new_settings[ 'masonry' ] ) {
|
||||
$new_settings[ 'column_layout' ] = true;
|
||||
$new_settings[ 'infinite_scroll' ] = true;
|
||||
$new_settings[ 'infinite_scroll_button' ] = true;
|
||||
|
||||
if ( 'width2' == $blog_settings['masonry_width'] ) {
|
||||
$new_settings[ 'columns' ] = '33';
|
||||
}
|
||||
|
||||
if ( 'width4' == $blog_settings['masonry_width'] ) {
|
||||
$new_settings[ 'columns' ] = '50';
|
||||
}
|
||||
|
||||
if ( 'width6' == $blog_settings['masonry_width'] ) {
|
||||
$new_settings[ 'columns' ] = '100';
|
||||
}
|
||||
|
||||
if ( 'width2' == $blog_settings[ 'masonry_width' ] ) {
|
||||
if ( 'width2' !== $blog_settings[ 'masonry_most_recent_width' ] ) {
|
||||
$new_settings[ 'featured_column' ] = true;
|
||||
} else {
|
||||
$new_settings[ 'featured_column' ] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'width4' == $blog_settings[ 'masonry_width' ] ) {
|
||||
if ( 'width6' == $blog_settings[ 'masonry_most_recent_width' ] ) {
|
||||
$new_settings[ 'featured_column' ] = true;
|
||||
} else {
|
||||
$new_settings[ 'featured_column' ] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'width6' == $blog_settings[ 'masonry_width' ] ) {
|
||||
$new_settings[ 'featured_column' ] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( function_exists( 'generate_page_header_get_defaults' ) ) {
|
||||
$page_header_settings = wp_parse_args(
|
||||
get_option( 'generate_page_header_settings', array() ),
|
||||
generate_page_header_get_defaults()
|
||||
);
|
||||
|
||||
if ( 'hide' == $page_header_settings[ 'post_header_position' ] ) {
|
||||
$new_settings[ 'single_post_image' ] = false;
|
||||
} else {
|
||||
$new_settings[ 'single_post_image_position' ] = $page_header_settings[ 'post_header_position' ];
|
||||
}
|
||||
|
||||
$new_settings[ 'page_post_image_position' ] = $page_header_settings[ 'page_header_position' ];
|
||||
}
|
||||
|
||||
unset( $blog_settings['masonry_width'] );
|
||||
unset( $blog_settings['masonry_most_recent_width'] );
|
||||
|
||||
$update_settings = wp_parse_args( $new_settings, $blog_settings );
|
||||
update_option( 'generate_blog_settings', $update_settings );
|
||||
|
||||
// Update our migration option so we don't need to run this again
|
||||
$updated[ 'blog_visibility_updated' ] = 'true';
|
||||
$migration_settings = wp_parse_args( $updated, $settings );
|
||||
update_option( 'generate_migration_settings', $migration_settings );
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog module.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
// Define the version. This used to be a standalone plugin, so we need to keep this constant.
|
||||
if ( ! defined( 'GENERATE_BLOG_VERSION' ) ) {
|
||||
define( 'GENERATE_BLOG_VERSION', GP_PREMIUM_VERSION );
|
||||
}
|
||||
|
||||
// Include functions identical between standalone addon and GP Premium.
|
||||
require plugin_dir_path( __FILE__ ) . 'functions/generate-blog.php';
|
Reference in New Issue
Block a user