• Resolved danielle_r

    (@danielle_r)


    Hi all,

    I’m using a child theme to the twentytwelve theme. My client wants to use multiple galleries in one post/page. I would like to customise the look of all the galleries throughout the site, not just gallery-1 or gallery-2. If I modify the img tag in the CSS it gets overruled by, for example, gallery-1 img.
    Is there a way to change the look of all the galleries, preferably by using CSS only?

    Thanks very much in advance for your help, best, d

Viewing 9 replies - 1 through 9 (of 9 total)
  • Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

    Thread Starter danielle_r

    (@danielle_r)

    OK, sorry about that. This is an example page demonstrating the problem: https://annemariemaes.net/projects/another-project/

    Why not just use the .gallery class?

    Thread Starter danielle_r

    (@danielle_r)

    I’ve tried:

    .gallery .gallery-icon img {
        border: 0 none;
        height: auto;
        max-width: 100%;
        padding: 5%;
    }

    But this gets overruled by:

    #gallery-1 img {
        border: 2px solid #CFCFCF;
    }

    And I want to get rid of the borders…

    Try adding
    add_filter( 'use_default_gallery_style', '__return_false' );
    to your child theme’s setup function in functions.php. This will remove all of the gallery CSS in the page and allow you to style galleries via the theme’s stylesheet.

    Thread Starter danielle_r

    (@danielle_r)

    Thanks esmi,

    My child theme is called accessible-onetwo. It doesn’t have a functions.php but I’ve created one for also some other purpose. In this file I’ve tried to create a function called setup(): nothing happens
    accessible-onetwo_setup() error for the – sign.
    twentytwelve_setup() error function is already declared
    accessible_onetwo_setup(): nothing happens

    Do you have any suggestions on how to make this work? Thanks, d

    Try:

    function my_theme_setup() {
    add_filter( 'use_default_gallery_style', '__return_false' );
    }
    add_action( 'after_setup_theme', 'my_theme_setup' );
    Thread Starter danielle_r

    (@danielle_r)

    Thanks esmi,

    That worked ?? I now have plain thumbnails. By tweaking the CSS I’ve put them in rows instead of all in one long column.

    Have a nice weekend, best, d

    Glad to hear that you managed to get this sorted. ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘customising a numbered gallery’ is closed to new replies.