How to remove WordPress lightbox gallery images border

This problem was posted in WordPress support forum 6 years ago and it is still relevant to this day. I may not be the only one facing this problem.

Since I encountered it and I should share solutions with other WordPress blogger out there.

A user with an ID of esmi comes up with a solution.

He suggested we edit the core file inside the folder  /wp-includes/ and look for media.php file.

Open that file with text editor and go to line 1091 (refer codes below):

#{$selector} img {
    border: 2px solid #cfcfcf;
}

From here you can change the border size or set it to 0.

#{$selector} img {
    border: 0 none;
}

Keep note the file will revert back to its default state after next WordPress core files updates.

See Also:  My first Wordpress theme

So you have to go back and edit the file if you want to change the border value again.

If you don’t want to do that, there is another way to this without the hassle editing the file by forcing it in your theme stylesheet. Just add:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Next Post

MSN - Bing Rewards

Sun Dec 6 , 2015
Note: This offer may not be available in your region Earn credits on MSN to redeem for rewards. Bing Rewards members will be able to earn Bing Rewards credits by reading select MSN news, sports, and entertainment stories or watching videos. It is important to note that not all content […]
msn secondary