Site logo

Archived topic

Broken search botton and social icons

7 replies · Started by Ian on October 10, 2015

Viewing posts 1–8 of 8

Hi Tom,
We installed your premium theme and lightbox social icons just two days ago. We really like everything but we keep having problems with the search botton on the navigation bar and the social icons in any widget area that we have tried, they appear broken every time we load our website on a PC or laptop, it doesn't happen on mobile version. The problem disappears as soon as we click on any other page or on the header. Can you help us? Our coding knowledge is close to zero I'm afraid...

Hi there,

Can you link me to your site so I can take a look?

Thanks!

Something with font-awesome not getting loaded.

Might be either a plugin that overwrites the font awesome code.

Might be the permalinks ?

As a general tip, your permalinks look like this :

http://gortbrackorganicfarm.com/online/?page_id=47

Go to WP Dash, Settings, Permalinks, and set it to Article Name, it will look better for the search engines.

You then need to fix every link that you've posted to every page, if you posted a link to

http://gortbrackorganicfarm.com/online/?page_id=47

change that link to http://gortbrackorganicfarm.com/online/page-or-article-name

It's due to Cross Site Scripting. Here is one of the errors:

Font from origin 'http://gortbrackorganicfarm.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.gortbrackorganicfarm.com' is therefore not allowed access. The response had HTTP status code 404.

GET http://gortbrackorganicfarm.com/online/wp-content/themes/generatepress/fonts/fontawesome-webfont.woff2?v=4.4.0

Your home page is being served from http://www.gortbrackorganicfarm.com/online/ but the font is being loaded from http://gortbrackorganicfarm.com/online/. Check Settings > General Settings and see if Wordpress Address (URL) and Site Address (URL) are the same. Additional reference from the Codex: https://codex.wordpress.org/Changing_The_Site_URL

First, my apologies. The problem is due to a Cross-Origin Resource Sharing restriction, not Cross Site Scripting as I originally posted. Sorry for the confusion.

From what I can find there are several different ways to approach this. I haven't tested any of these proposed solutions so no guarentees:

Here is a block of code you could add to your .htaccess file:

<IfModule mod_headers.c>
    <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

Here is another post discussing the .htaccess modification:
http://www.webcodegeeks.com/web-servers/cors-and-how-to-enable-it-in-apache-web-server/

You could also copy header.php to a child theme and modify it:
http://bowdenweb.com/wp/2011/05/how-to-enable-cors-in-wordpress.html

This thread on GitHub discusses adding a function to enable CORS:
https://github.com/WP-API/WP-API/issues/144

Or you might just try a plugin:
https://wordpress.org/plugins/wp-cors/

Thank you very much to the forum participants for taking time to reply. I might have to get a web developer to look at how to implement some of your suggestions. This website was migrated from wordpress.com to .org some years ago but it looks like it wasn't done properly.
It would be great if you could give me a reply as well Tom!
Thanks
Barbara

It looks like you have some sort of redirection going on. When I go to your site and watch the title in my browser tab, it changes from "Your Page Title" to something else while loading.

I would guess this issue is coming from that redirection.

If you don't know where it's coming from, give your hosting/server a shout and they should be able to tell you.

This archived topic is closed to new replies.