Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Urgent layout problems Reply To: Urgent layout problems

#164390
broomhandle
Participant

Back again!

I added this code to functions.php:

/**
 * Adjust content width in certain contexts.
 *
 * Adjusts content_width value for full-width and single image attachment
 * templates, and when there are no active widgets in the sidebar.
 *
 * @since Twenty Twelve 1.0
 *
 * @return void
 */
function minimalizine_content_width() {
        if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
                global $content_width;
                $content_width = 720;
        }
}
add_action( 'template_redirect', 'minimalizine_content_width' );

I think modifying that a bit could make it useful, so that for full width pages tiled galleries are 720, while for blog posts they’re 520.

But that additional container or w/e you said is still there taking away the 5px on the right side. If you notice, when this page loads, it’s full 720px, but once it’s finished, it switches to 715px: http://www.peterchamberlaincann.co.uk/portfolio/british-art-show-7-a-journey-through-plymouth/

That code has also had an effect on the YouTube videos, they now fit to 720 which looks awful!

Thinking about it, I would be just as happy with being able to center the tiled galleries instead. The gallery on the “British Art Show 7” is pretty big, it’s a bit extreme!