su_list, button icon do not show up
-
Hello,
After I updated plugin today, the icon of su_list and button do not show up anymore. How can I fix it?
Thank you,
Quan.The page I need help with: [log in to see the link]
-
Hello Quan,
just checked your page. I see icons are displayed. Please confirm.
Idk why it doesn’t show on my computer. I have tried different browsers but there are no icon https://imgur.com/a/ow5To7r
My bad. I haven’t noticed you use CDN. Icons are not displayed correctly because your browser cannot load font files from another domain (cdn.piviral.com).
Please enable CORS at your CDN server to fix the issue. Details are available here:
Why did icons work on the previous version?
Before version 5.2.0 Shortcodes Ultimate loaded icons CSS file from bootstrapcdn (//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css) and that server is configured to serve font files with correct headers.
Since 5.2.0 SU includes the icon stylesheet and font files. That means they are loaded from your server. This was made to prevent numerous conflicts with other plugins and to avoid an extra DNS-lookup.
So how can I fix it? I am using CloudFlare CDN for subdomain only.
It seems the CloudFlare support CORS headers if they are sent from your server. See their article:
First, you’ll need to add CORS headers at your own server. See my previous link:
https://stackoverflow.com/a/26393857
Then, you’ll need to purge CloudFlare cache:
https://support.cloudflare.com/hc/en-us/articles/203063414-Why-can-t-I-see-my-CORS-headers-
I think I found an easy way. There’s a plugin to enable CORS without touching the server config:
Even easier solution, probably. Could you try to add the following snippet to the end of the
functions.phpfile of your active theme?add_filter( 'allowed_http_origins', function( $allowed_origins ) { $allowed_origins[] = 'http://piviral.com'; $allowed_origins[] = 'https://piviral.com'; $allowed_origins[] = 'http://cdn.piviral.com'; $allowed_origins[] = 'https://cdn.piviral.com'; return array_unique( $allowed_origins ); } );* This will only work if your CDN is the same WordPress installation as the main site.
** Also, you’ll need to purge CloudFlare cache after editing the
functions.phpfile.I tried the second and third method but It still doesn’t work.
And the first method, I don’t understand so I’m not sure how to do it.
Does the problem will be solve if I use CDN for main domain and do not use subdomain?
Okay, I don’t use CDN for subdomain anymore.
It works now.
Thank you!
-
This reply was modified 7 years, 3 months ago by
minhquansk.
Resolved!
-
This reply was modified 7 years, 3 months ago by
The topic ‘su_list, button icon do not show up’ is closed to new replies.