Community Forums › Forums › Archived Forums › Design Tips and Tricks › Altitude Pro blog & full width layout Issue with sidebar
- This topic has 10 replies, 2 voices, and was last updated 9 years, 10 months ago by
keithalpichi.
-
AuthorPosts
-
May 7, 2015 at 9:22 pm #150843
keithalpichi
MemberHello,
I like the full width layout that I have currently set for my site on the front page and all other pages. However, I'd like to have the content/sidebar layout ONLY applied to the blog page (different from the full width content layout in the Altitude Pro demo).
I have the default layout settings set to "full width content". My front page is static with my posts set to "blog". When I go into editing the "blog" page I don't get the choice to select the layout.
There's only one solution I could think of, to set the default to content/sidebar and readjust each individual page to full width. There has to be a way around this.
How do I set all pages as full width but set the blog page as content/sidebar?
Thank you in advance.
Keith(ps. my site is currently in maintenance mode as I am editing it.)
http://www.keithalpichi.comMay 7, 2015 at 11:24 pm #150847Christoph
MemberHi,
if I understand you correctly, you have set a page named "blog" as "post page" under Settings - Reading - Front page displays, correct?
In this case, you can use the following code from Brad Dalton.
I only adjusted if (is_archive()) to if(is_home())/** Force full width layout on all archive pages*/ add_filter( 'genesis_pre_get_option_site_layout', 'full_width_layout_archives' ); /** * @author Brad Dalton * @link http://wpsites.net/web-design/change-layout-genesis/ */ function full_width_layout_archives( $opt ) { if ( is_home() ) { $opt = 'full-width-content'; return $opt; } }
May 8, 2015 at 9:05 am #150953keithalpichi
MemberHi Christoph,
Yes correct. The posts page is set to "blog."
I have little knowledge in code so where do I place this code and do I edit the @author and @link with my details?
May 8, 2015 at 12:36 pm #150982Christoph
MemberHi,
you can add the code at the bottom of functions.php.
@author and @link give attribution to the source/author of the code.
May 8, 2015 at 10:14 pm #151102keithalpichi
MemberOk. It doesn't do anything. Blog is still in content only (no sidebar) content.
May 8, 2015 at 10:19 pm #151105Christoph
MemberOk,
use this code instead:
/** Force content-sidebar layout on blog page*/ add_filter( 'genesis_pre_get_option_site_layout', 'content_sidebar_layout_blog' ); /** * @author Brad Dalton * @link http://wpsites.net/web-design/change-layout-genesis/ */ function content_sidebar_layout_blog( $opt ) { if ( is_home() ) { $opt = 'content-sidebar'; return $opt; } }
May 8, 2015 at 10:44 pm #151152keithalpichi
MemberIt works, thanks Christoph. Do you know the code to get the sidebar on single posts as well?
May 8, 2015 at 10:50 pm #151161Christoph
MemberTry this:
/** Force content-sidebar layout on blog page*/ add_filter( 'genesis_pre_get_option_site_layout', 'content_sidebar_layout_blog' ); /** * @author Brad Dalton * @link http://wpsites.net/web-design/change-layout-genesis/ */ function content_sidebar_layout_blog( $opt ) { if ( is_home() || is_single () ) { $opt = 'content-sidebar'; return $opt; }
}
May 9, 2015 at 10:02 am #151248keithalpichi
MemberI'm getting a white screen and fatal error:
Fatal error: Cannot redeclare content_sidebar_layout_blog() (previously declared in /home/content/p3pnexwpnas02_data01/50/2068650/html/wp-content/themes/altitude-pro/functions.php:245) in /home/content/p3pnexwpnas02_data01/50/2068650/html/wp-content/themes/altitude-pro/functions.php on line 262
How can I get to the theme editor?
May 9, 2015 at 10:09 am #151255Christoph
MemberHi,
you have to login to your cPanel and use the file manager or use FTP to get to the functions.php.
The functions.php is in /wp-content/themes/altitude-pro/You cannot keep the old code in the file, you have to replace it.
May 9, 2015 at 10:51 am #151275keithalpichi
MemberGot it! I just restored my site through Godaddy.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.