Jetpack by WordPress.com
[resolved] Where Does Tiled Gallery Get Width Size from? (8 posts)

  1. jlomaga
    Posted 3 years ago #

    I'm workign on a new theme and I'm having an issue with the tiled galleries. The content area is 600px but for some reason Tiled galleries max out at 500px leaving a white space on the right of them. I don't have this issue in the default WP themes, so I'm guessing there is something in the theme's css causing this. I've already tried copying twenty twelve's gallery css and that didn't help. Checking the page source I see the width of the gallery at 500px. Any help would be great.


  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Contributor

    Posted 3 years ago #

    Tiled Galleries are built to fit your theme's content width. You can define a specific $content_width value by adding the following code to your theme's functions.php file:

    if ( ! isset( $content_width ) )
        $content_width = 800;
  3. jlomaga
    Posted 2 years ago #

    Perfect! thanks

  4. mkstvns
    Posted 2 years ago #

    Hi guys,

    Apologies if this is a stupid question, coding's not my strong suit (it's more like a paper bag I wear and hope it doesn't rain).

    Whereabouts in the theme's functions.php file do I put this code?

    I pasted it at the bottom of Standard Theme's functions.php, and all it did was display the above line of code at the top of my blog.

    See; http://imgur.com/i0CydD6

    Would appreciate a tip!

    Blog: http://www.doshio.com/2013/02/03/20-random-v3/ (I've since removed the code until a solution is found)

  5. mkstvns
    Posted 2 years ago #

    Actually, wait, I found the following section;

    http://i.imgur.com/VtOZ2Ns.jpg - changed the width from 540 to 620, as you can see here. However, the Jetpack gallery at http://www.doshio.com/2013/02/03/20-random-v3/#more-1005 doesn't appear to have changed in width.

  6. Jeremy Herve
    Jetpack Mechanic
    Plugin Contributor

    Posted 2 years ago #

    The $content_width value might be set somewhere else in your theme; could you search for other instances of $content_width in your theme files?


  7. digitalbum
    Posted 2 years ago #

    Soooo, I haven't found a solution to the width. My tiled-gallery for the Lamoon theme is set at 500px even though in Theme Functions.php the code is:
    if (!isset($content_width)) $content_width = 900;

    I don't have any other image gallery plugins installed.

    When I inspect element, it says: data-original-width="500"

    Every other theme I've tried, that number matches the $content_width number in the functions.php file.

    So I have no idea.

    here's the page: http://digitalblueberries.com/products/

  8. Jeremy Herve
    Jetpack Mechanic
    Plugin Contributor

    Posted 2 years ago #

    Could you check for other instances of $content_width in your theme, just to make sure that the value isn't already defined somewhere else?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.