Site logo

Archived topic

How to Change the Width of both sidebars and content on a single page

7 replies · Started by Janeen on December 30, 2017

Viewing posts 1–8 of 8

I am using Sidebar/Content/Sidebar. Can someone please tell me the best way to make both sidebars smaller and the main content section larger on a single page? I have been searching everywhere and I can't find either a css code or where in layout I can do this without effecting the whole site. Thank you!

Hi Leo, Thank you for your time and response. I did come across this answer while searching on my own but unfortunately it makes no sense to me. I don't know how to use PHP filters and then when I clicked on "how to use PHP filters" it talked about downloading a Code Snippets plug-in - which still didn't clearly explain how to use PHP filters with the plug-in. All it did was scare me about how easily I could screw up my site if I did it wrong.

I did want to change both sidebars to make them smaller and I want to make the main content space larger on one single page. I did come across a simple css code in the forum that explained how to do one sidebar - I was just hoping for a simple css code that included the code for sidebar - content - sidebar - where all I had to do was change the percentages and put it on the bottom of that page in the Simple CSS box.

Sorry - as you can tell I am somewhat of a novice who has unfortunately broken my websites in the past and am now a little shy when messing with functions.php. Thanks! Sincerely Janeen

Which single page would you like to adjust that?

Hi thanks again for your time for getting back to me. I want to literally change the main page Newmandelaeffects.com. I simply want to make that page that shows latest posts larger in the center and make both sidebars smaller. Thank you again! Sincerely, Janeen

For front page, your code would be:

add_filter( 'generate_right_sidebar_width','lh_home_page_custom_right_sidebar_width' );
function lh_home_page_custom_right_sidebar_width( $width ) {
        // If we're on the home page
	if ( is_front_page() ) {
		return 20;
	}
	
        // Return the default
	return $width;
}
add_filter( 'generate_left_sidebar_width','lh_home_page_custom_left_sidebar_width' );
function lh_home_page_custom_left_sidebar_width( $width ) {
        // If we're on the home page
	if ( is_front_page() ) {
		return 20;
	}
	
        // Return the default
	return $width;
}

You should only need to edit the return number. Then copying and pasting into Code Snippets should work.

Dear Leo,

Thank you so much!!!

No problem :)

This archived topic is closed to new replies.