Make WordPress Themes

Changeset 148927

Timestamp:
06/04/2021 03:34:59 PM (4 years ago)
Author:
themedropbox
Message:

New version of Lightning - 14.3.3

Location:
lightning/14.3.3
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • lightning/14.3.3/_g2/inc/layout-controller/functions-layout-controll.php

    r147588 r148927  
    2525
    2626/**
     27 * lightning_layout_by_single
     28 *
     29 *  @since Lightning 14.3.3
     30 *  @return false / col-two / col-one / col-one-no-subsection
     31 */
     32function 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/**
    2760 * Lightning Is Layout One Column
    2861 *
     
    3669
    3770    $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    );
    3879
    3980    foreach ( $array as $key => $value ) {
     
    61102                }
    62103            }
     104        }
     105        if ( 'col-one' === lightning_layout_by_single() || 'col-one-no-subsection' === lightning_layout_by_single() ){
     106            $onecolumn = true;
    63107        }
    64108    // show_on_front 'posts' case
     
    79123            }
    80124        }
    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() ) {
    95126        $current_post_type_info = lightning_get_post_type();
    96127        $archive_post_types = array( 'post' ) + $additional_post_types;
     
    102133            }
    103134        }
    104     }
    105 
    106     if ( is_singular() ) {
    107         global $post;
     135    } else if ( is_singular() ) {
    108136        $single_post_types = array( 'post', 'page' ) + $additional_post_types;
    109137        foreach ( $single_post_types as $single_post_type ) {
     
    114142            }
    115143        }
    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 ){
    123148                $onecolumn = true;
    124             }
    125         }
    126         if ( isset( $post->_lightning_design_setting['layout'] ) ) {
    127             if ( 'col-two' === $post->_lightning_design_setting['layout'] ) {
     149            } else {
    128150                $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;
    133151            }
    134152        }
  • lightning/14.3.3/_g3/inc/layout-controller/functions-layout-controll.php

    r147588 r148927  
    1111function lightning_layout_target_array() {
    1212    $array = array(
    13         'error404' => array(
     13        'error404'       => array(
    1414            'function' => 'is_404',
    1515        ),
    16         'search'   => array(
     16        'search'         => array(
    1717            'function' => 'is_search',
    1818        ),
    19         'archive-author'   => array(
     19        'archive-author' => array(
    2020            'function' => 'is_archive',
    2121        ),
     
    2424}
    2525
    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 */
     33function lightning_layout_by_single() {
     34    $layout = false;
    10635    if ( is_singular() ) {
    10736        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         }
    11637        if ( is_page() ) {
    11738            $template           = get_post_meta( $post->ID, '_wp_page_template', true );
     
    12142            );
    12243            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 */
     66function 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 ) ) {
    123145                $onecolumn = true;
    124146            }
     
    169191    // break and hidden.
    170192    if ( is_front_page() && ! is_home() ) {
    171        
     193
    172194        if ( isset( $options['layout']['front-page'] ) && 'col-one-no-subsection' === $options['layout']['front-page'] ) {
    173195            $return = false;
     
    185207            }
    186208        }
    187 
    188209    } elseif ( is_front_page() && is_home() ) {
    189210        if ( isset( $options['layout']['front-page'] ) && 'col-one-no-subsection' === $options['layout']['front-page'] ) {
     
    198219    } elseif ( is_archive() && ! is_search() && ! is_author() ) {
    199220        $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;
    201222        foreach ( $archive_post_types as $archive_post_type ) {
    202223
  • lightning/14.3.3/readme.txt

    r148627 r148927  
    33Lightning WordPress theme is licensed under the GPL.
    44Tested up to: 5.7.2
    5 Stable tag: 14.3.2
     5Stable tag: 14.3.3
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3939
    4040== Changelog ==
     41
     42v14.3.3
     43[ Bug fix ] Fix front page column layout
    4144
    4245v14.3.2
  • lightning/14.3.3/style.css

    r148627 r148927  
    66Author: Vektor,Inc.
    77Author URI: https://www.vektor-inc.co.jp
    8 Version: 14.3.2
     8Version: 14.3.3
    99Requires at least: 5.3
    1010Tested up to: 5.7.0
Note: See TracChangeset for help on using the changeset viewer.