How to change the content width using php?

Yes, often the best way is as you describe. In your template file add something like this: <div class=”container-wrap se-366024″> Then in your style.css (or any other enqueued stylesheet) .se-366024 { width:960px; } If you are wanting to set a max width across the site you may want to look into the $content_width global supported … Read more

Mobile view: how to remove right/left margin from the specific widgets?

You just need to add media queries for mobile screens. Add CSS in the stylesheet. if you want globally add this: @media only screen and (max-width: 600px) { #pl-2040 #panel-2040-4-0-0, #pl-2040 #panel-2040-5-0-0 { margin: 0; } } If you want to implement only on the homepage try this: @media only screen and (max-width: 600px) { … Read more

Is it possible to create a conditional for content_width?

As of now there is no direct way to conditionally set content_width.But we can do this using template_redirect hook and changing the global content_width.This is done in Twenty Fourteen Theme.Following is the code. /** * Adjust content_width value for image attachment template. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_content_width() { if ( is_attachment() … Read more