4, 'columns' => array( array( 'index' => 1, 'span' => 3, ), array( 'index' => 2, 'span' => 3, ), array( 'index' => 3, 'span' => 3, ), array( 'index' => 4, 'span' => 3, ), ), ) ); } /** * Create a "default" value for the blog layout */ public static function get_blog_default() { return wp_json_encode( array( 'columnsCount' => 2, 'columns' => array( 1 => array( 'index' => 1, 'span' => 8, ), 2 => array( 'index' => 2, 'span' => 4, ), ), ) ); } /** * Get blog layout * * @param string $option Option to retrieve in the backend * * @return array|mixed|object|string */ public static function get_layout( $option = '' ) { $layout = empty( $option ) ? get_theme_mod( 'medzone_lite_layout', false ) : get_theme_mod( $option, false ); if ( ! $layout ) { $layout = MedZone_Lite_Helper::get_blog_default(); } if ( ! is_array( $layout ) ) { $layout = json_decode( $layout, true ); } $layout['type'] = 'right-sidebar'; $layout['columns']['content'] = isset( $layout['columns'][1] ) ? $layout['columns'][1] : null; $layout['columns']['sidebar'] = isset( $layout['columns'][2] ) ? $layout['columns'][2] : null; unset( $layout['columns'][1] ); unset( $layout['columns'][2] ); if ( $layout['columns']['content']['span'] < $layout['columns']['sidebar']['span'] ) { $layout['type'] = 'left-sidebar'; $temp = $layout['columns']['content']['span']; $layout['columns']['content']['span'] = $layout['columns']['sidebar']['span']; $layout['columns']['sidebar']['span'] = $temp; } if ( 1 === $layout['columnsCount'] ) { $layout['type'] = 'fullwidth'; } return $layout; } /** * Get the footer layout * * @return array|mixed|object|string */ public static function get_footer_layout() { $footer_layout = get_theme_mod( 'medzone_lite_footer_columns', false ); if ( ! $footer_layout ) { $footer_layout = MedZone_Lite_Helper::get_footer_default(); } if ( ! is_array( $footer_layout ) ) { $footer_layout = json_decode( $footer_layout, true ); } return $footer_layout; } /** * Render the post meta * * @param string $element Element that we need to render in the frontend. */ public static function posted_on( $element = 'default' ) { $comments = wp_count_comments( get_the_ID() ); switch ( $element ) { case 'author': $html = '
'; echo wp_kses_post( $html ); break; case 'category': $html = '