dshanske / syndication-links

Add and Display Syndication Links in WordPress
https://wordpress.org/plugins/syndication-links/
GNU General Public License v2.0
30 stars 13 forks source link

Stop using ID attribute for div with links, switch to CLASS instead #143

Closed kuz-z-zma closed 3 years ago

kuz-z-zma commented 3 years ago

List of links comes wrapped in div with id attribute "syndication-links", like so: <div id="syndication-links"><ul class="relsyn"><li>link1</li><li>link2</li></ul></div>

An issue: per html standard:

The HTML id attribute is used to specify a unique id for an HTML element. You cannot have more than one element with the same id in an HTML document.

And using it for individual posts is fine, it remains unique, but with option "Show on Front Page, Archive Pages, and Search Results" ENABLED we get multiple divs with the same ID on home page if several posts have been syndicated, which leads to website failing validation.

Using <div CLASS="syndication-links"><ul class="relsyn"><li>link1</li><li>link2</li></ul></div> will fix this issue and requires just a simple change to css.