Changeset 148927
- Timestamp:
- 06/04/2021 03:34:59 PM (4 years ago)
- Location:
- lightning/14.3.3
- Files:
-
- 4 edited
- 1 copied
- . (copied) (copied from lightning/14.3.2)
- _g2/inc/layout-controller/functions-layout-controll.php (modified) (6 diffs)
- _g3/inc/layout-controller/functions-layout-controll.php (modified) (6 diffs)
- readme.txt (modified) (2 diffs)
- style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lightning/14.3.3/_g2/inc/layout-controller/functions-layout-controll.php
r147588 r148927 25 25 26 26 /** 27 * lightning_layout_by_single 28 * 29 * @since Lightning 14.3.3 30 * @return false / col-two / col-one / col-one-no-subsection 31 */ 32 function lightning_layout_by_single() { 33 $layout = false; 34 if ( is_singular() ){ 35 global $post; 36 if ( is_page() ) { 37 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 38 $template_onecolumn = array( 39 'page-onecolumn.php', 40 'page-lp.php', 41 ); 42 if ( in_array( $template, $template_onecolumn, true ) ) { 43 $layout = 'col-one'; 44 } 45 } 46 if ( isset( $post->_lightning_design_setting['layout'] ) ) { 47 if ( 'col-two' === $post->_lightning_design_setting['layout'] ) { 48 $layout = 'col-two'; 49 } elseif ( 'col-one-no-subsection' === $post->_lightning_design_setting['layout'] ) { 50 $layout = 'col-one-no-subsection'; 51 } elseif ( 'col-one' === $post->_lightning_design_setting['layout'] ) { 52 $layout = 'col-one'; 53 } 54 } 55 } 56 return $layout; 57 } 58 59 /** 27 60 * Lightning Is Layout One Column 28 61 * … … 36 69 37 70 $array = lightning_layout_target_array(); 71 72 $additional_post_types = get_post_types( 73 array( 74 'public' => true, 75 '_builtin' => false, 76 ), 77 'names' 78 ); 38 79 39 80 foreach ( $array as $key => $value ) { … … 61 102 } 62 103 } 104 } 105 if ( 'col-one' === lightning_layout_by_single() || 'col-one-no-subsection' === lightning_layout_by_single() ){ 106 $onecolumn = true; 63 107 } 64 108 // show_on_front 'posts' case … … 79 123 } 80 124 } 81 } 82 83 $additional_post_types = get_post_types( 84 array( 85 'public' => true, 86 '_builtin' => false, 87 ), 88 'names' 89 ); 90 91 /** 92 * アーカイブページの場合 93 */ 94 if ( is_archive() && ! is_search() && ! is_author() ) { 125 } else if ( is_archive() && ! is_search() && ! is_author() ) { 95 126 $current_post_type_info = lightning_get_post_type(); 96 127 $archive_post_types = array( 'post' ) + $additional_post_types; … … 102 133 } 103 134 } 104 } 105 106 if ( is_singular() ) { 107 global $post; 135 } else if ( is_singular() ) { 108 136 $single_post_types = array( 'post', 'page' ) + $additional_post_types; 109 137 foreach ( $single_post_types as $single_post_type ) { … … 114 142 } 115 143 } 116 if ( is_page() ) { 117 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 118 $template_onecolumn = array( 119 'page-onecolumn.php', 120 'page-lp.php', 121 ); 122 if ( in_array( $template, $template_onecolumn, true ) ) { 144 145 $lightning_layout_by_single = lightning_layout_by_single(); 146 if ( $lightning_layout_by_single ){ 147 if ( 'col-one' === $lightning_layout_by_single || 'col-one-no-subsection' === $lightning_layout_by_single ){ 123 148 $onecolumn = true; 124 } 125 } 126 if ( isset( $post->_lightning_design_setting['layout'] ) ) { 127 if ( 'col-two' === $post->_lightning_design_setting['layout'] ) { 149 } else { 128 150 $onecolumn = false; 129 } elseif ( 'col-one-no-subsection' === $post->_lightning_design_setting['layout'] ) {130 $onecolumn = true;131 } elseif ( 'col-one' === $post->_lightning_design_setting['layout'] ) {132 $onecolumn = true;133 151 } 134 152 } -
lightning/14.3.3/_g3/inc/layout-controller/functions-layout-controll.php
r147588 r148927 11 11 function lightning_layout_target_array() { 12 12 $array = array( 13 'error404' => array(13 'error404' => array( 14 14 'function' => 'is_404', 15 15 ), 16 'search' => array(16 'search' => array( 17 17 'function' => 'is_search', 18 18 ), 19 'archive-author' => array(19 'archive-author' => array( 20 20 'function' => 'is_archive', 21 21 ), … … 24 24 } 25 25 26 /** 27 * Lightning Is Layout One Column 28 * 29 * @since Lightning 9.0.0 30 * @return boolean 31 */ 32 function lightning_is_layout_onecolumn() { 33 $onecolumn = false; 34 $options = lightning_get_theme_options( 'lightning_theme_options' ); 35 global $wp_query; 36 37 $array = lightning_layout_target_array(); 38 39 foreach ( $array as $key => $value ) { 40 if ( call_user_func( $value['function'] ) ) { 41 if ( isset( $options['layout'][ $key ] ) ) { 42 if ( 'col-one' === $options['layout'][ $key ] || 'col-one-no-subsection' === $options['layout'][ $key ] ) { 43 $onecolumn = true; 44 } 45 } 46 } 47 } 48 49 // show_on_front 'page' case 50 if ( is_front_page() && ! is_home() ) { 51 if ( isset( $options['layout']['front-page'] ) ) { 52 if ( 'col-one' === $options['layout']['front-page'] || 'col-one-no-subsection' === $options['layout']['front-page'] ) { 53 $onecolumn = true; 54 } 55 } else { 56 $page_on_front_id = get_option( 'page_on_front' ); 57 if ( $page_on_front_id ) { 58 $template = get_post_meta( $page_on_front_id, '_wp_page_template', true ); 59 if ( 'page-onecolumn.php' === $template || 'page-lp.php' === $template ) { 60 $onecolumn = true; 61 } 62 } 63 } 64 // show_on_front 'posts' case 65 } elseif ( is_front_page() && is_home() ) { 66 if ( isset( $options['layout']['front-page'] ) ) { 67 if ( 'col-one' === $options['layout']['front-page'] || 'col-one-no-subsection' === $options['layout']['front-page'] ) { 68 $onecolumn = true; 69 } elseif ( isset( $options['layout']['archive-post'] ) ) { 70 if ( 'col-one' === $options['layout']['archive-post'] || 'col-one-no-subsection' === $options['layout']['archive-post'] ) { 71 $onecolumn = true; 72 } 73 } 74 } 75 } elseif ( ! is_front_page() && is_home() ) { 76 if ( isset( $options['layout']['archive-post'] ) ) { 77 if ( 'col-one' === $options['layout']['archive-post'] || 'col-one-no-subsection' === $options['layout']['archive-post'] ) { 78 $onecolumn = true; 79 } 80 } 81 } 82 83 $additional_post_types = get_post_types( 84 array( 85 'public' => true, 86 '_builtin' => false, 87 ), 88 'names' 89 ); 90 91 /** 92 * アーカイブページの場合 93 */ 94 if ( is_archive() && ! is_search() && ! is_author() ) { 95 $current_post_type_info = VK_Helpers::get_post_type_info(); 96 $archive_post_types = array( 'post' ) + $additional_post_types; 97 foreach ( $archive_post_types as $archive_post_type ) { 98 if ( isset( $options['layout'][ 'archive-' . $archive_post_type ] ) && $current_post_type_info['slug'] === $archive_post_type ) { 99 if ( 'col-one' === $options['layout'][ 'archive-' . $archive_post_type ] || 'col-one-no-subsection' === $options['layout'][ 'archive-' . $archive_post_type ] ) { 100 $onecolumn = true; 101 } 102 } 103 } 104 } 105 26 27 /** 28 * lightning_layout_by_single 29 * 30 * @since Lightning 14.3.3 31 * @return false / col-two / col-one / col-one-no-subsection 32 */ 33 function lightning_layout_by_single() { 34 $layout = false; 106 35 if ( is_singular() ) { 107 36 global $post; 108 $single_post_types = array( 'post', 'page' ) + $additional_post_types;109 foreach ( $single_post_types as $single_post_type ) {110 if ( isset( $options['layout'][ 'single-' . $single_post_type ] ) && get_post_type() === $single_post_type ) {111 if ( 'col-one' === $options['layout'][ 'single-' . $single_post_type ] || 'col-one-no-subsection' === $options['layout'][ 'single-' . $single_post_type ] ) {112 $onecolumn = true;113 }114 }115 }116 37 if ( is_page() ) { 117 38 $template = get_post_meta( $post->ID, '_wp_page_template', true ); … … 121 42 ); 122 43 if ( in_array( $template, $template_onecolumn, true ) ) { 44 $layout = 'col-one'; 45 } 46 } 47 if ( isset( $post->_lightning_design_setting['layout'] ) ) { 48 if ( 'col-two' === $post->_lightning_design_setting['layout'] ) { 49 $layout = 'col-two'; 50 } elseif ( 'col-one-no-subsection' === $post->_lightning_design_setting['layout'] ) { 51 $layout = 'col-one-no-subsection'; 52 } elseif ( 'col-one' === $post->_lightning_design_setting['layout'] ) { 53 $layout = 'col-one'; 54 } 55 } 56 } 57 return $layout; 58 } 59 60 /** 61 * Lightning Is Layout One Column 62 * 63 * @since Lightning 9.0.0 64 * @return boolean 65 */ 66 function lightning_is_layout_onecolumn() { 67 $onecolumn = false; 68 $options = lightning_get_theme_options( 'lightning_theme_options' ); 69 global $wp_query; 70 71 $additional_post_types = get_post_types( 72 array( 73 'public' => true, 74 '_builtin' => false, 75 ), 76 'names' 77 ); 78 79 $array = lightning_layout_target_array(); 80 81 foreach ( $array as $key => $value ) { 82 if ( call_user_func( $value['function'] ) ) { 83 if ( isset( $options['layout'][ $key ] ) ) { 84 if ( 'col-one' === $options['layout'][ $key ] || 'col-one-no-subsection' === $options['layout'][ $key ] ) { 85 $onecolumn = true; 86 } 87 } 88 } 89 } 90 91 // show_on_front 'page' case 92 if ( is_front_page() && ! is_home() ) { 93 if ( isset( $options['layout']['front-page'] ) ) { 94 if ( 'col-one' === $options['layout']['front-page'] || 'col-one-no-subsection' === $options['layout']['front-page'] ) { 95 $onecolumn = true; 96 } 97 } 98 if ( 'col-one' === lightning_layout_by_single() || 'col-one-no-subsection' === lightning_layout_by_single() ) { 99 $onecolumn = true; 100 } 101 // show_on_front 'posts' case 102 } elseif ( is_front_page() && is_home() ) { 103 if ( isset( $options['layout']['front-page'] ) ) { 104 if ( 'col-one' === $options['layout']['front-page'] || 'col-one-no-subsection' === $options['layout']['front-page'] ) { 105 $onecolumn = true; 106 } elseif ( isset( $options['layout']['archive-post'] ) ) { 107 if ( 'col-one' === $options['layout']['archive-post'] || 'col-one-no-subsection' === $options['layout']['archive-post'] ) { 108 $onecolumn = true; 109 } 110 } 111 } 112 } elseif ( ! is_front_page() && is_home() ) { 113 if ( isset( $options['layout']['archive-post'] ) ) { 114 if ( 'col-one' === $options['layout']['archive-post'] || 'col-one-no-subsection' === $options['layout']['archive-post'] ) { 115 $onecolumn = true; 116 } 117 } 118 } elseif ( is_archive() && ! is_search() && ! is_author() ) { 119 $current_post_type_info = VK_Helpers::get_post_type_info(); 120 $archive_post_types = array( 'post' ) + $additional_post_types; 121 foreach ( $archive_post_types as $archive_post_type ) { 122 if ( isset( $options['layout'][ 'archive-' . $archive_post_type ] ) && $current_post_type_info['slug'] === $archive_post_type ) { 123 if ( 'col-one' === $options['layout'][ 'archive-' . $archive_post_type ] || 'col-one-no-subsection' === $options['layout'][ 'archive-' . $archive_post_type ] ) { 124 $onecolumn = true; 125 } 126 } 127 } 128 } elseif ( is_singular() ) { 129 global $post; 130 $single_post_types = array( 'post', 'page' ) + $additional_post_types; 131 foreach ( $single_post_types as $single_post_type ) { 132 if ( isset( $options['layout'][ 'single-' . $single_post_type ] ) && get_post_type() === $single_post_type ) { 133 if ( 'col-one' === $options['layout'][ 'single-' . $single_post_type ] || 'col-one-no-subsection' === $options['layout'][ 'single-' . $single_post_type ] ) { 134 $onecolumn = true; 135 } 136 } 137 } 138 if ( is_page() ) { 139 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 140 $template_onecolumn = array( 141 'page-onecolumn.php', 142 'page-lp.php', 143 ); 144 if ( in_array( $template, $template_onecolumn, true ) ) { 123 145 $onecolumn = true; 124 146 } … … 169 191 // break and hidden. 170 192 if ( is_front_page() && ! is_home() ) { 171 193 172 194 if ( isset( $options['layout']['front-page'] ) && 'col-one-no-subsection' === $options['layout']['front-page'] ) { 173 195 $return = false; … … 185 207 } 186 208 } 187 188 209 } elseif ( is_front_page() && is_home() ) { 189 210 if ( isset( $options['layout']['front-page'] ) && 'col-one-no-subsection' === $options['layout']['front-page'] ) { … … 198 219 } elseif ( is_archive() && ! is_search() && ! is_author() ) { 199 220 $current_post_type_info = VK_Helpers::get_post_type_info(); 200 $archive_post_types = array( 'post' ) + $additional_post_types;221 $archive_post_types = array( 'post' ) + $additional_post_types; 201 222 foreach ( $archive_post_types as $archive_post_type ) { 202 223 -
lightning/14.3.3/readme.txt
r148627 r148927 3 3 Lightning WordPress theme is licensed under the GPL. 4 4 Tested up to: 5.7.2 5 Stable tag: 14.3. 25 Stable tag: 14.3.3 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 40 40 == Changelog == 41 42 v14.3.3 43 [ Bug fix ] Fix front page column layout 41 44 42 45 v14.3.2 -
lightning/14.3.3/style.css
r148627 r148927 6 6 Author: Vektor,Inc. 7 7 Author URI: https://www.vektor-inc.co.jp 8 Version: 14.3. 28 Version: 14.3.3 9 9 Requires at least: 5.3 10 10 Tested up to: 5.7.0
Note: See TracChangeset for help on using the changeset viewer.