golden hour
/home/phakp/public_html/wp/wp-content/themes/neve/inc/views/pluggable
⬆️ Go Up
Upload
File/Folder
Size
Actions
masonry.php
1.56 KB
Del
OK
metabox_settings.php
10.43 KB
Del
OK
pagination.php
4.45 KB
Del
OK
Edit: masonry.php
<?php /** * Handles blog masonry. * * Author: Andrei Baicus <andrei@themeisle.com> * Created on: 31/08/2018 * * @package Neve\Views\Pluggable */ namespace Neve\Views\Pluggable; use Neve\Views\Base_View; /** * Class Masonry * * @package Neve\Views\Pluggable */ class Masonry extends Base_View { /** * Function that is run after instantiation. * * @return void */ public function init() { add_filter( 'neve_filter_main_script_localization', array( $this, 'filter_localization' ) ); add_filter( 'neve_filter_main_script_dependencies', array( $this, 'filter_dependencies' ) ); } /** * Filter localization to add masonry to the main script. * * @param array $data localization array. * * @return array */ public function filter_localization( $data ) { if ( ! $this->is_masonry_enabled() ) { return $data; } $data['masonry'] = 'enabled'; return $data; } /** * Filter dependencies to add masonry to the main script. * * @param array $data dependencies array. * * @return array */ public function filter_dependencies( $data ) { if ( ! $this->is_masonry_enabled() ) { return $data; } array_push( $data, 'masonry' ); return $data; } /** * Check if masonry is enabled. * * @return string */ public function is_masonry_enabled() { $blog_layout = get_theme_mod( 'neve_blog_archive_layout', 'grid' ); $columns = get_theme_mod( 'neve_grid_layout', '1' ); if ( $blog_layout !== 'grid' || $columns === 1 ) { return false; } return get_theme_mod( 'neve_enable_masonry', false ); } }
Save