WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Change Width of Tiled Gallery Using css (4 posts)

  1. mbh66
    Member
    Posted 1 year ago #

    Hi there,

    I'd like to change the width of a Jetpack tiled gallery using css. I have read this post about changing the width in functions.php: http://jetpack.me/2013/01/04/galleries/#comment-10121

    However, my theme does currently set a width:
    http://betterquestions.co/wp-content/thesis/skins/classic/css.css
    .columns > .content { width: 640px; float: left; }

    What classes and coding should I use in Custom CSS to, for example, change the width of the gallery to 630? Here is the gallery page:
    http://betterquestions.co/gallery/

    Many thanks!
    Michael

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    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.

  3. AMEEKER
    Member
    Posted 1 year ago #

    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?

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic