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

Home Forums Support [Resolved] How to Change the Width of both sidebars and content on a single page

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

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #459806
    Janeen

    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!

    GP Premium 1.5.6
    #459885
    Leo
    Staff
    Customer Support
    #475152
    Janeen

    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

    #475337
    Leo
    Staff
    Customer Support

    Which single page would you like to adjust that?

    #475667
    Janeen

    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

    #475745
    Leo
    Staff
    Customer Support

    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.

    #476274
    Janeen

    Dear Leo,

    Thank you so much!!!

    #476634
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.