Support » Plugin: Jetpack by WordPress.com » Change Width of Tiled Gallery Using css

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    The width set in CSS and the $content_width value are different. Since the Tiled Galleries (along with other media elements like embedded videos and pictures) use that $content_width to calculate the width of each picture in the gallery, you’ll want to make that change to your functions.php file.

    if ( ! isset( $content_width ) )
        $content_width = 630;

    If you cannot edit your theme’s functions.php file, you can add this code in a plugin.

    So if my theme does define the content width already:

    /** Sets Content Width */
    $content_width = apply_filters( 'content_width', 680, 680, 1020 );

    but I want to use a tiled gallery on a full width page (which would use the 1020 width), how can I force the gallery on that page to use the full width?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    You can take the example of Twenty Twelve to define different $content_width values depending on the page:
    http://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentytwelve/functions.php#L414

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Width of Tiled Gallery Using css’ is closed to new replies.