instantpage/instant.page

Please support classname

Opened this issue · 1 comments

For Wordpress user, it's hard to set data-instant in the a tag without changing code.
if the Wordpress plugin could let user set customized classnames, It makes easier for Wordpress user.

e.g.:
<a href="somewhere" class="data-instant">Link</a>
<a href="somewhere" class="my-custom-instant-class">Link</a>

In my use case, I just want to add the data-instant flag on links in WooCommerce's product link
and the links on navigation bar, but exclude the MyAccount and the Cart pages since there are dynamic page.

Figured out a workaround.
Install a plugin that let you put custom script code in the footer

Use the following code snippet

[].forEach.call(document.getElementsByClassName('your-class-name') , x => x.dataset.instant = 1)

You can change the 'your-class-name' to the classname you want, or put a selector syntax in it.