mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

How to show only one image per comic using archive template? #360

Closed AxleArtz closed 3 years ago

AxleArtz commented 3 years ago

So I'm trying to make a gallery page with the Webcomic archive, but some comics have multiple images and I only want the first image to show. Is there a way to set it so that it will only show one image per comic?

sailorptah commented 3 years ago

Looks like the PHP to do it was covered here:

https://github.com/mgsisk/webcomic/issues/325

I swear there was a previous support question that got the exact code to do it in CSS, but now I can't find the thread :/

So I haven't tested this, but you should be able to do it with "display:none" applied to every image except the first one:

https://techstacker.com/select-all-elements-except-first-child-selector/

AxleArtz commented 3 years ago

@sailorptah, Thank you! The CSS worked for what I needed.