Community Forums › Forums › Archived Forums › Design Tips and Tricks › Primary Sidebar on One-page only
- This topic has 7 replies, 5 voices, and was last updated 10 years, 10 months ago by
Brad Dalton.
-
AuthorPosts
-
May 10, 2014 at 4:24 am #104408
mark_s
MemberHi guys
I have a design need I can't find an elegant solution to.
I'm using the Genesis Sample theme and want every single page to have full-width content, except one, which will have a primary sidebar. So we're talking home, about, contact are all full-width, my blog page has a sidebar.
I've tried Genesis Simple Sidebars etc. but can't seem to be able to select anything but the default page setting in the New Page tab.
Any ideas?
May 10, 2014 at 6:24 am #104412Susan
ModeratorSet your default setting to be full width, and then on your blog page, set your layout to be content > sidebar.
If you're not seeing layout setting on the new page at all, select the "screen options" at the top of the page.
If you are seeing layout settings, but it only gives you the option to choose full width layout, then make sure that the option for other layouts has not been disabled in your functions.php file. (The sample theme does not have it disabled...)
May 10, 2014 at 5:20 pm #104479mark_s
MemberThanks Susan
I have checked my functions.php files and it is not disabled.
Different layouts in "Layout Settings" still un-selectable. It will only use default.
Is there some code and a Custom Body Class I can use (I've seen something suggested around this, mostly to turn them off from being default)? Or can I somehow enable a Sidebar page under Page Attributes > Template dropdown?
Many thanks
MarkMay 11, 2014 at 11:12 am #104547emasai
ParticipantTry this tut by Sridhar
http://sridharkatakam.com/apply-layout-genesis-conditionally/
Need Website Customization or a Responsive CSS fix? Contact Me
Lynne emasai.comMay 11, 2014 at 4:26 pm #104561essaysnark
ParticipantThis tutorial might also be helpful:
http://dreamwhisperdesigns.com/genesis-tutorials/load-sidebar-specific-pages/
It sounds like either your sidebar isn't registered properly, and/or you haven't placed anything in it in the Widgets area (some themes suppress the sidebar when it's empty; not sure if the default Genesis theme does that or not).
May 11, 2014 at 6:49 pm #104570mark_s
MemberThanks guys. Forgive my inexperience, but if I wanted to add a sidebar to my blog page only, http://www.example.com/blog/ then I would add the following code to my theme functions.php file. Hesitant to change functions.php without asking the pros first!
-------------------------
add_action( 'genesis_meta', 'sk_force_layout' );
function sk_force_layout() {if ( is_singular('blog' ) ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
}}
May 15, 2014 at 1:37 am #105243mark_s
MemberPlease no-one use the code above I don't think it's correct. I was wondering if someone could look at this before I put it in my functions.php file to check it is correct?
//* Force content-sidebar layout on blog page only add_filter( 'genesis_pre_get_option_site_layout', 'content_sidebar_layout_blog_page' ); function content_sidebar_layout_blog_page( $opt ) { if ( is_page( 'Blog' ) ) { $opt = 'content-sidebar'; return $opt; } }
Basically, I think this assigns a function to a new term 'content_sidebar_layout_blog_page' which makes the layout 'content-sidebar' to which I assign this functions to the page titled Blog -> is_page( 'Blog' ).
Makes sense but don't want to white screen my site!
May 15, 2014 at 2:06 am #105251Brad Dalton
ParticipantTry this http://wpsites.net/web-design/change-layout-genesis/
Another option is simply to edit the page and choose the sidebar content layout.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.