WordPress.org

Ready to get started?Download WordPress

Forums

How to remove border on gallery images??? (22 posts)

  1. perzk
    Member
    Posted 4 years ago #

    I figured out how to post full-size images using the built in gallery, but i cannot get rid of the white border around the images (see http://blog.zangenberg.net/ ). All the answers I can find only pertains to posting regular single images and has no effect on the gallery images.

    Does anyone know wich file contains the code that adds the border to the "thumbnails" in the gallery?!?

  2. Peter Boosten
    Member
    Posted 4 years ago #

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

    Remove the border statement. It's in your header file (probably header.php).

    Peter

  3. perzk
    Member
    Posted 4 years ago #

    I searched all the header.php files, but none of them seems to contain the mentioned statement :/

  4. okaay
    Member
    Posted 4 years ago #

    Check your gallery plugin folder and hunt the css down.

  5. perzk
    Member
    Posted 4 years ago #

    I am sorry, but i have no gallery folder??

  6. perzk
    Member
    Posted 4 years ago #

    I am using the standard WP gallery and a theme called "pixeled".

    In the style.css in the pixeled folder it says:

    a img {
    border: none;
    }

  7. Peter Boosten
    Member
    Posted 4 years ago #

    okaay was talking about a plugin. Search [webroot]/wp-content/plugins for that particular css

    Peter

  8. perzk
    Member
    Posted 4 years ago #

    In my wp-content/plugins folder there is:

    hello.php
    index.php
    and a folder: akismet

  9. Peter Boosten
    Member
    Posted 4 years ago #

    So no plugin that could cause this :-)

    And in your index.php?
    Search for this:

    <style type='text/css'>
    			#gallery-1 {
    				margin: auto;
    			}
    			#gallery-1 .gallery-item {
    				float: left;
    				margin-top: 10px;
    				text-align: center;
    				width: 100%;			}
    			#gallery-1 img {
    				border: 2px solid #cfcfcf;
    			}
    			#gallery-1 .gallery-caption {
    				margin-left: 0;
    			}
    		</style>

    Peter

  10. perzk
    Member
    Posted 4 years ago #

    If you mean the index.php in the plugin folder it only contains:

    <?php
    // Silence is golden.
    ?>

  11. Peter Boosten
    Member
    Posted 4 years ago #

    nope, the index.php in your theme directory (sorry, should have mentioned that).

    Peter

  12. perzk
    Member
    Posted 4 years ago #

    ..\themes\pixeled\index.php contains:

    <?php get_header(); ?>

    <div id="main">

    <div id="contentwrapper">

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="topPost">
    <h2 class="topTitle">"><?php the_title(); ?></h2>
    <p class="topMeta">af <?php the_author_posts_link(); ?> den <?php the_time('j F, Y') ?>, under <?php the_category(', '); ?></p>
    <div class="topContent"><?php the_content('(læs mere...)'); ?></div>
    <span class="topComments"><?php comments_popup_link('Skriv en kommentar', '1 Kommentar', '% Kommentarer'); ?></span>
    <span class="topTags"><?php the_tags(':', ', ', ''); ?></span>
    <span class="topMore">">mere...</span>
    <div class="cleared"></div>
    </div> <!-- Closes topPost -->

    <?php endwhile; ?>

    <?php else : ?>

    <div class="topPost">
    <h2 class="topTitle">">Intet fundet</h2>
    <div class="topContent"><p>Desværre, men det du leder efter findes ikke. Du kan søge igen her...</p></div>
    </div> <!-- Closes topPost -->

    <?php endif; ?>

    <div id="nextprevious">
    <div class="alignleft"><?php posts_nav_link('','','« Tidligere artikler') ?></div>
    <div class="alignright"><?php posts_nav_link('','Nyere artikler »','') ?></div>
    <div class="cleared"></div>
    </div>
    </div> <!-- Closes contentwrapper-->

    <?php get_sidebar(); ?>
    <div class="cleared"></div>

    </div><!-- Closes Main -->

    <?php get_footer(); ?>

  13. Peter Boosten
    Member
    Posted 4 years ago #

    oke, next file to look in is functions.php

    Peter

  14. perzk
    Member
    Posted 4 years ago #

    searched it for "img" "gallery" and "border". No valid entries found :(

    Could it be embedded in some java file or something?

  15. perzk
    Member
    Posted 4 years ago #

    Bummer I thought this would be an easy fix :(

  16. Peter Boosten
    Member
    Posted 4 years ago #

    One thing is for sure: it has to come from somewhere. Since you don't have any plugins, search your entire theme folder for "border: 2px solid #cfcfcf"

    Peter

  17. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    you could try and force it by adding at the end of the style.css:

    #gallery-1 img {
    border: none!important;
    }

    not sure if it will work, but worth a try ;-)

  18. esmi
    Forum Moderator
    Posted 4 years ago #

    It's the default css inserted by the gallery shortcode from wp-includes/media.php.

    #contentwrapper .gallery .gallery-item img {border:none !important;}

    might remove it for all galleries.

  19. perzk
    Member
    Posted 4 years ago #

    YES!!!! In the media.php file I found a gallery section with the line:

    border: 2px solid #cfcfcf;

    wich I changed to:

    border: 0px solid #cfcfcf;

    And now it works as wanted! Thank you all very much for sticking with me on this I really appreciate it! :)

  20. jamesphough
    Member
    Posted 4 years ago #

    Thank you so much for this! Every time I install my WP update I have to refer back to this discussion to remove the re-appeared grey border.

    Much love.

  21. Aiverlyn
    Member
    Posted 4 years ago #

    I so love this help!! Thanks all!

  22. lisavollrath
    Member
    Posted 3 years ago #

    Yep, every time I update to a new version of WP, I have to hunt down this fix. Oh, how I HATE editing core files!

Topic Closed

This topic has been closed to new replies.

About this Topic