enter image description here

Currently I have the following code.

<li class="track clearfix" data-index="0" data-file="/some-mp3-file.mp3" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
    <span class="track-data">
      <span class="name" itemprop="name">Holding On</span>
    </span>
    <ul class="actions">
         <li><a href="downloadlinkhere.com" target="_blank">Download</a></li>
    </ul>
</li>

<li class="track clearfix" data-index="0" data-file="/some-mp3-file.mp3" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
    <span class="track-data">
      <span class="name" itemprop="name">Holding On</span>
    </span>
    <ul class="actions">
         <li><a href="downloadlinkhere.com" target="_blank">Download</a></li>
    </ul>
</li>

Alright the above code returns the following look with my current style sheet using this CSS.

Sorry for the poorly drawn circles.

ol.tracklist li.track span.track-data:before {
    content: counter(tracklist) ".";
    margin: 0px 5px 10px 0px;
    font-size: 19px;
    font-family: "ProximaNova-Bold",Sans-Serif;
    float: left;
    display: block;
}

the issue I’m having currently is that I need to count the numbers of each post here as the data-index portion also and I can’t seem to figure out how to do this properly.

I’m using WordPress and everything will be included in a loop, pulling content from a meta table structure.

Read more here: PHP Counter that does the same thing as CSS Counter?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: