Make WordPress Core

#57920 closed defect (bug) (duplicate)

Multiple Default Themes: Ordered List Type Overwritten

Reported by: zoonini's profile zoonini Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: css Cc:

Description

In several default themes, the ordered list type is always displayed as numerical (aka decimal), even when you set it to another type, such as alphabetical.

To replicate:

  1. Activate Twenty Fifteen
  2. Add a List block OR a Classic block
  3. Switch the block to code view and add type="a" as an attribute on the ol element, so the opening tag looks like this: <ol type="a">
  4. Save the page and view on the front end

Result:

It displays as a numerical list, like:

  1. item
  2. item
  3. item

This seems to be coming from this CSS in each of the affected themes:

ol {
  list-style: decimal;
}

Expected:

It should display as whatever list type was set. For example, if type="a" was set on the block, the list should display alphabetical, like:

  1. item
  2. item
  3. item

Other affected themes

I able to replicate this in the following default themes:

  • Twenty Ten
  • Twenty Eleven
  • Twenty Twelve
  • Twenty Fourteen
  • Twenty Fifteen
  • Twenty Sixteen
  • Twenty Seventeen
  • Twenty Nineteen
  • Twenty Twenty
  • Twenty Twenty-One

The following default themes did not have the issue:

  • Twenty Thirteen
  • Twenty Twenty-Two
  • Twenty Twenty-Three

Reported in this support-forum thread:

https://wordpress.org/support/topic/ordered-list-type-attribute-not-displayed-properly/

I provided two possible workarounds to the user there, one involving custom CSS, and the other involving adding inline CSS on the ol element.

Change History (6)

#1 @sabernhardt
15 months ago

Related/duplicate: #44777

#2 @shawfactor
15 months ago

This should be fixed with a high priority, good themes should not be overriding/removing key web functionality and core themes should be (and mostly are) good themes that follow standards and behave well

#3 @jakariaistauk
15 months ago

Hi @zoonini ,
Thanks for the ticket. but I found some CSS for the list. for a different type of list, we need to write in a different structure. I found some CSS for different list styles. we can follow this structure for the rest of the themes or write a new one. Waiting for other's opinions about the CSS style

  1. Twenty-Ten
    ol {
    	list-style: decimal;
    }
    ol ol {
    	list-style: upper-alpha;
    }
    ol ol ol {
    	list-style: lower-roman;
    }
    ol ol ol ol {
    	list-style: lower-alpha;
    }
    
  1. Twenty Eleven
    ol {
    	list-style-type: decimal;
    }
    ol ol {
    	list-style: upper-alpha;
    }
    ol ol ol {
    	list-style: lower-roman;
    }
    ol ol ol ol {
    	list-style: lower-alpha;
    }
    

#4 @zoonini
15 months ago

@jakariaistauk Yep, I know there are various CSS workarounds – if you visit the support thread I linked above, you'll see that I provided several to the user reporting this issue.

@sabernhardt Great spot of the duplicate, I couldn't find it when searching. :)

#5 @zoonini
15 months ago

@jakariaistauk Just to be clear, this ticket wouldn't be to assign a particular list style for each nested level, which is what your proposed CSS does. It's about respecting the user's choice of list type, and not disregarding it. See ticket #44777 for more.

#6 @sabernhardt
15 months ago

  • Focuses css added
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I'm closing this to keep the conversation on #44777.

Note: See TracTickets for help on using tickets.