• Resolved rely28

    (@rely28)


    Hi, since the new jetpack 3.0 the tiled gallery size are limited to 500px despite having this in my theme function.php

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

    In my case 1140 is the full width which include a sidebar so the post itself is 790px wide. Before the update the resize was ok and the gallery just took the right space but now it’s only 500px…

    https://wordpress.org/plugins/jetpack/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Could you post your site URL here, so I can have a look?

    If you want it to remain private, you can also contact us via this contact form:
    http://jetpack.me/contact-support/

    Thread Starter rely28

    (@rely28)

    I’m having the same problem, but only since I upgraded to 3.9.1.

    Also, I’m not using Jetpack, but a plugin called “Tiled Galleries Without Jetpack.”

    This would lead me to believe that it’s something with WordPress 3.9.1 and not the plugins. Because I can’t find anything to adjust in my theme or the plugin code that will change it.

    @traumkommode: It is considered impolite to interrupt another poster’s ongoing thread unless you are posting a solution or suggestion. As per the Forum Welcome, please post your own topic.

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    @rely28: The site is loading really slow for me and what I can see has a lot of other errors.

    Could you try disabling all other plugins and see if the problem remains? If not, then activate one plugin at a time until it stops working as expected; the last plugin activated either is the source of the issue or is in conflict with something else.

    @traumkommode: In addition to esmi’s advice, since we only wrote the Jetpack code, it might be wise to submit a thread to the “Tiled Galleries without Jetpack” author. He/she might be using Jetpack’s code or might have created their own solution.

    Thread Starter rely28

    (@rely28)

    I’m aware of the website being slow… I’m also working on it… (even if I tend to believe my server is not really efficient)

    I tried deactivating all the plugin, the problem seems to be from Jetpack itself, or at least a compability with my theme but I really don’t see why…

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Could you try this code, changing out the number for your preferred width?

    https://gist.github.com/kraftbj/bdc19f483c03e8815694

    Thread Starter rely28

    (@rely28)

    Great ! It does work ! But is there a way to add 2 possibilities ? Because for now I can basically set one width which I’ve set for a page with sidebar but what if I want a full wdith gallery ?

    Thanks

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Sure—there are different ways of doing it based on how your theme is coded. If the full-width template is a separate page template, you could add the same code in that template, changing the value. May want to change the priority too (e.g. add_filter('jetpack_content_width', 'bk_set_jetpack_width_full', 11); to ensure that it takes priority over the initial one.

    If you do that, be sure to change the function name bk_set_jetpack_width to something else for the second instance so an error isn’t created for having two functions with the same name and update it in the add_filter call.

    Cheers!

    Thread Starter rely28

    (@rely28)

    In my theme I just got an option to show a sidebar (or two) or not (which in that case become a ful width page) there is basically no separate template so I guess I have to go with the priority function, unfortunately I’m not good enough in coding to clearly understand what I have to add, in the line you put, what the number 11 stand for ?

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Somewhere in your theme’s template, there is likely some if statements that pull from that sidebar setting and determine something different to happen (a change in classes for the CSS to pick up on, etc).

    Wherever your theme’s templates pull that option is likely the best spot for code like this.

    More about add_filter is at the Codex: http://codex.wordpress.org/Function_Reference/add_filter

    Basically, the 11 is the priority number of that particular filter. Without a number, it defaults to 10. Something at priority level 1 is filtered first, something at a higher number later.

    So, for example, how Jetpack’s Sharing buttons at the end of a post work via an add_filter('the_content', "sharing_display', 19)
    If you wanted to do something to the_content and have it happen before the Sharing buttons are added, you’d want to be sure to do it at a number lower than 18. If you want to do something later, you want a number higher.

    In our code above, the initial code that I suggested for functions.php doesn’t have a number, so it defaults to 10. In your case, since you have something special that you want to apply only in certain cases, we want be completely sure that the full-width number is used instead in those specific cases. To do that, we add priority level 11.

    Thread Starter rely28

    (@rely28)

    Ok well thanks a lot, I’ll ask support from the theme team, i’ve found the right php file but not sure where to insert the code, I mark this topic as resolved.

    Cheers !

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Gallery Width limited to 500px’ is closed to new replies.