-
AuthorPosts
-
November 10, 2014 at 12:06 am #348540
I uploaded a new fontello icon font using the enfold admin form, and the icons do not render in the admin. For example, trying to make an icon list, the new icons just show up as squares/symbols. Using firebug, I determined the cause…
We use HTTPS in admin and certain areas of the site. The enfold font upload sets an absolute HTTP url path for the new font in the @font-face CSS.
This is true even though I uploaded while on HTTPS in the admin. This seems to me to be a bug. How can I address this?
Thanks
November 10, 2014 at 1:07 am #348574I’ve spent a bit of time looking into this. It was in fact due to the way the URL paths are obtained/created in enfold font class. The below seems to have fixed the problem as it is now working for me. Issue was from the use of the baseurl value output from wp_upload_dir()
enfold/config-templatebuilder/avia-template-builder/php/font-manager-class.php
Line 20-21:
$this->paths['fonturl'] = trailingslashit($this->paths['baseurl']).$this->paths['fonts']; $this->paths['tempurl'] = trailingslashit($this->paths['baseurl']).trailingslashit($this->paths['temp']);
Line 386:
$url = trailingslashit($upload_dir['baseurl']);
Replacements:
Line 20-21:
$this->paths['fonturl'] = trailingslashit(content_url('/uploads')).$this->paths['fonts']; $this->paths['tempurl'] = trailingslashit(content_url('/uploads')).trailingslashit($this->paths['temp']);
Line 386:
$url = trailingslashit(content_url('/uploads'));
That fixed the problems for me.
@Kriesi team – wp_upload_dir() not ideal here to generate the urls as apparently the protocol is not accounted for.I used content_url()
The content_url template tag retrieves the url to the content area for the current site with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise. http://codex.wordpress.org/Function_Reference/content_url
- This reply was modified 10 years ago by klear.
November 10, 2014 at 5:32 pm #348886Hey!
Sorry for the late reply klear and thanks for posting your solution. I’ll go ahead and add this to our bug list for our devs to take a look.
Best regards,
ElliottJanuary 15, 2015 at 2:11 pm #380007Hey!
Wordpress got a function called is_ssl() that I have used to create a fix. the problem with your solution is that it assumes that the files are always directly saved to the uploads folder which is usually not the case.
I think my solution should work for you even if you update and lose your modifications. If thats not the case please let us know with a reference to this thread :)
Regards,
Kriesi -
AuthorPosts
- The topic ‘Fontello in Admin’ is closed to new replies.