[Support request] Caption styling broken after update to WordPress 5.3

Home Forums Support Caption styling broken after update to WordPress 5.3

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1063537
    Steven

    Hi

    Immediately following the last update to WordPress, the styling of the captions on my site broke. I am currently using Generatepress Pro with Elementor Pro, but the problem persists whether I have elemector installed or not. I have tried clearing my cache, disabling all plugins, etc and still no change. I tried installing some other themes (Hello, Astra, Ocean WP) and the caption styling seems fine with those. Any ideas?

    (I have disabled my caching plugin)

    #1063589
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It seems Gutenberg moved their caption CSS into the optional additional stylesheet that isn’t loaded by default.

    Give this function a shot:

    add_action( 'after_setup_theme', function() {
        add_theme_support( 'wp-block-styles' );
    } );

    Let me know 🙂

    #1063649
    Steven

    Thanks Tom. That looks much better!

    #1063712
    Shrawan

    Hi Tom, where do I insert the code that you have mentioned above? Sorry I’m a bit new to this and would need guidance.

    #1063776
    David
    Staff
    Customer Support
    #1064298
    Shrawan

    Hello David,

    I’m not for installing any new plugins like Simple CSS, so if you can tell me exactly where I need to paste this code in the “Additional CSS” tab of the “Customize” option, I would be glad. I’d request you to give me the exact location where I need to paste the code which Tom has mentioned above –

    add_action( ‘after_setup_theme’, function() {
    add_theme_support( ‘wp-block-styles’ );
    } );

    #1064302
    Leo
    Staff
    Customer Support

    That code is PHP so it cannot be in the Additional CSS field in the customizer.

    It would need to be one of these methods:
    https://docs.generatepress.com/article/adding-php/

    Code Snippets plugin is the easiest way and should have minimal impact on your site.

    If not then Child theme’s function.php is the only other solution.

    #1064311
    Shrawan

    Hello Leo, can I place that text anywhere in the functions.php file from within the WordPress ‘Theme Editor’ option?

    #1064316
    Leo
    Staff
    Customer Support

    No. It’s not a good idea to add any code to the theme’s core files.

    It will get erased during updates.

    #1064634
    Shrawan

    Thank you, this issue is resolved. In the subject of captions, can you please provide me a simple way to increase the size of the image caption site-wide? I wish to increase the size of all image captions (past and future) by 1 size.

    #1064966
    Leo
    Staff
    Customer Support

    Please open a new topic for your question as it’s not related to the original post/topic and this is not your topic.

    I’m happy to provide the code once you do 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.