Site logo

Archived topic

OL Start Value Being Ignored?

5 replies · Started by Lewis on September 1, 2022

Viewing posts 1–6 of 6

I had a similar issue which was rectified recently but it seems to has caused other issues. I want to have the following:

1, 2, 3, IMAGE, 4, 5, 6

I set the start value for the second list as 4 but it is being ignored for some reason. Here is my current code:

.entry-content .list-container {
    counter-reset: my-awesome-counter;
}
.entry-content ol {
    list-style: none;
    margin-left: 1px;
}
.entry-content ol li::before {
    content: counter(my-awesome-counter) ") ";
    margin-right: 2px;
    font-size: 19px;
    font-weight: 600;
}
.entry-content ol li {
    margin-bottom: 40px;
    margin-top: 45px;
    counter-increment: my-awesome-counter;
    overflow: hidden;
}

I can fix the current situation by tweaking the start to this:

.entry-content .list-container, .entry-content {
    counter-reset: my-awesome-counter;
}

However, this then ruins other lists I may have on the page (some pages have more than one list that should each start at 1.

Hi there,

Not sure if I fully understand - I can't see how this can be a GP issue as it has no control over how <ol> works.

Is this issue only happening when using GP?

Looks to be a GeneratePress issue. If I quickly switch to default Wordpress things seem ok.

I did have this issue a while back and it was fixed with a tweak to the code but it seems to have come back and no idea why.

If I tweak that bit of code outlined above then it works for that one container but also continues the numbers in future lists. So I can manipulate the OL Tags in the GeneratePress CSS so assume there must be a setting in there somewhere

I do not see any element with the class list-container on your attached page.

So make sure you've added a container with this class that wraps the ol element.

Have stripped out a load of the OL CSS styling and this seems to have fixed it. Thanks anyways!

Glad it's working now.

This archived topic is closed to new replies.