From 2530b7c45bf278c777393259299fcd08cc51e526 Mon Sep 17 00:00:00 2001 From: Divya Narhe Date: Mon, 24 Jun 2024 19:03:53 +0530 Subject: [PATCH 1/4] Fixed post layout --- core/includes/hooks.php | 191 ++++++++++++++++------------- core/includes/post-custom-meta.php | 12 +- sidebar.php | 41 ++++--- 3 files changed, 140 insertions(+), 104 deletions(-) diff --git a/core/includes/hooks.php b/core/includes/hooks.php index bfd06a333..f3733301a 100644 --- a/core/includes/hooks.php +++ b/core/includes/hooks.php @@ -303,13 +303,38 @@ function responsive_theme_options() { * Responsive_wrapper_class */ function responsive_wrapper_classes() { + global $post; + $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false ); + $layout = ( isset( $custom['_responsive_layout'][0] ) ? $custom['_responsive_layout'][0] : 'default' ); + error_log( 'Layout in hook =>' . print_r( $layout, true ) ); ?> +
-
- - + +
+ +
+ +
+ + + +
+
+ '; @@ -319,36 +344,36 @@ function responsive_wrapper_classes() { } } -/** - * Responsive_wrapper_class - */ + /** + * Responsive_wrapper_class + */ function responsive_wrapper_classes_close() { ?>
-
- '; - } + '; + } } -/** - * [responsive_woocommerce_wrapper_end description] - */ + /** + * [responsive_woocommerce_wrapper_end description] + */ function responsive_woocommerce_wrapper_end() { echo '
'; get_sidebar(); @@ -356,11 +381,11 @@ function responsive_woocommerce_wrapper_end() { } -/** - * [responsive_woocommerce_before_shop_loop description] - * - * @return void [description]. - */ + /** + * [responsive_woocommerce_before_shop_loop description] + * + * @return void [description]. + */ function responsive_woocommerce_archive_description() { ?>
@@ -368,11 +393,11 @@ function responsive_woocommerce_archive_description() {
@@ -380,12 +405,12 @@ function responsive_woocommerce_after_single_product_summary() { post_type ) { @@ -397,12 +422,12 @@ function responsive_sensei_read_more_text( $text ) { return $text; } -/** - * Returns excerpt length - * - * @param integer $length Length of excerpt. - * @return integer Length of excerpt. - */ + /** + * Returns excerpt length + * + * @param integer $length Length of excerpt. + * @return integer Length of excerpt. + */ function responsive_sensei_custom_excerpt_length( $length ) { global $post; if ( 'course' === $post->post_type ) { @@ -414,11 +439,11 @@ function responsive_sensei_custom_excerpt_length( $length ) { return $length; } -/** - * [responsive_theme_wrapper_start description] - * - * @return void [description]. - */ + /** + * [responsive_theme_wrapper_start description] + * + * @return void [description]. + */ function responsive_theme_wrapper_start() { ?>
@@ -428,11 +453,11 @@ function responsive_theme_wrapper_start() { '; if ( is_single() ) { @@ -441,31 +466,31 @@ function responsive_theme_wrapper_end() { echo '
'; } -/** - * [responsive_open_container description] - * - * @return void [description] - */ + /** + * [responsive_open_container description] + * + * @return void [description] + */ function responsive_open_container() { echo '
'; } -/** - * [responsive_close_container description] - * - * @return void [description] - */ + /** + * [responsive_close_container description] + * + * @return void [description] + */ function responsive_close_container() { echo '
'; } -/** - * Classes - */ -/** - * Add No-JS Class. - * If we're missing JavaScript support, the HTML element will have a no-js class. - */ + /** + * Classes + */ + /** + * Add No-JS Class. + * If we're missing JavaScript support, the HTML element will have a no-js class. + */ function responsive_no_js_class() { ?> @@ -474,9 +499,9 @@ function responsive_no_js_class() { } -/** - * Change the custom logo URL - */ + /** + * Change the custom logo URL + */ function responsive_custom_logo_link() { // The logo. @@ -514,27 +539,27 @@ function responsive_custom_logo_link() { return $html; } -/** - * Responsive child theme custom header - * - * @see header.php - */ + /** + * Responsive child theme custom header + * + * @see header.php + */ function responsive_custom_header() { do_action( 'responsive_custom_header' ); } -/** - * Responsive child theme custom footer - * - * @see footer.php - */ + /** + * Responsive child theme custom footer + * + * @see footer.php + */ function responsive_custom_footer() { do_action( 'responsive_custom_footer' ); } -/** - * Single Blog Related Posts Entry - */ + /** + * Single Blog Related Posts Entry + */ function responsive_single_blog_related_posts_entry() { do_action( 'responsive_single_blog_related_posts_entry' ); -} \ No newline at end of file +} diff --git a/core/includes/post-custom-meta.php b/core/includes/post-custom-meta.php index 2250d6470..9e6561067 100644 --- a/core/includes/post-custom-meta.php +++ b/core/includes/post-custom-meta.php @@ -137,9 +137,6 @@ function responsive_get_valid_layouts() { 'content-sidebar-page' => __( 'Content/Sidebar', 'responsive' ), 'sidebar-content-page' => __( 'Sidebar/Content', 'responsive' ), 'full-width-page' => __( 'Full Width Page (no sidebar)', 'responsive' ), - 'blog-2-col' => __( 'Blog 2 Column', 'responsive' ), - 'blog-3-col' => __( 'Blog 3 Column', 'responsive' ), - 'blog-4-col' => __( 'Blog 4 Column', 'responsive' ), ); return apply_filters( 'responsive_valid_layouts', $layouts ); @@ -194,7 +191,7 @@ function responsive_layout_meta_box() { $valid_layouts = responsive_get_valid_layouts(); ?>

- $name ) { ?> @@ -203,6 +200,13 @@ function responsive_layout_meta_box() {

+ ?> ID ) ? get_post_custom( $post->ID ) : false ); + $layout = ( isset( $custom['_responsive_layout'][0] ) ? $custom['_responsive_layout'][0] : 'default' ); + if ( 'full-width-page' === $layout ) { + ?> +