Site logo

Archived topic

hide subsequent featured images

3 replies · Started by anand on February 19, 2020

Viewing posts 1–4 of 4

how to disable or hide featured images in subsequent posts - when using ajax load more to show posts one below the other.(show in the first post... not show in 2,3.. posts)

tried this css
.page-header-image-single:nth-of-type(1n+2) {
display: none;
}

but no help.

Hi there,

unfortunately nth-of-type and the other pseudo selectors don't apply to CSS classes.

However, if we look at your HTML each article is displayed within a alm-reveal wrapper - creating a list of common elements with that class and we can target them like so:

.alm-reveal:nth-child(2n+1) .page-header-image-single {
    display: none;
}

I am not sure the formula is correct for your requirements but give that a short to start with

Thanks a lot...

but this code worked for me

.alm-reveal:nth-child(1n+2) .page-header-image-single {
    display: none;
}

Yeah i wasn't sure that formula was correct :)

Glad to be of help

This archived topic is closed to new replies.