• Hello,
    I’m trying to create an ordered list of headlines using the following code:

    <ol>
    <h2><li>Headline1</li></h2>
    <h2><li>Headline2</li></h2>
    </ol>

    After a switch from text editor to visual editor and back to text editor, the code gets changed to this:

    <ul>
    	<li>Headline1</li>
    </ul>
    <ul>
    	<li>Headline2</li>
    </ul>

    Am I doing anything wrong here? How can an ordered list of headlines be created in wordpress?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Am I doing anything wrong here?

    Yes. Your markup is invalid. It should be:

    <ol>
    <li><h2>Headline1</h2></li>
    <li><h2>Headline2</h2></li>
    </ol>

    All those H2 tags on the same page might not look good for SEO?

    What about

    <ol>
    <li class="headline">Headline1</li>
    <li class="headline">Headline1</li>
    </ol>

    and then style in your style.css
    li.headline {font-family:XYZ;font-size:ABC;etc etc etc;}

    Thread Starter Nopalot

    (@nopalot)

    @esmi, thanks for the clarification. Using

    <ol>
    <li><h2>Headline1</h2></li>
    <li><h2>Headline2</h2></li>
    </ol>

    Makes the numbers at the left side of the headlines look different than the headlines. I was trying to get the same style for both, the headlines and the numbers.

    I’ll try Pete’s approach next.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to create an ordered list of headlines?’ is closed to new replies.