Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support classname #64

Open
gralance opened this issue Mar 22, 2020 · 1 comment
Open

Please support classname #64

gralance opened this issue Mar 22, 2020 · 1 comment

Comments

@gralance
Copy link

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.

@gralance
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants