Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 866 Vote(s) - 3.41 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I allow a single Wordpress site to accept my .ttf file upload?

#1
I'm using the Font Organizer plugin for Wordpress. It has a nice option to upload a font, which I have saved to my computer. I just need to somehow get Wordpress to accept it so I can use it here:

[![enter image description here][1]][1]

However, I'm getting an error: `Error uploading the file: Sorry, this file type is not permitted for security reasons.`

How do I let Wordpress temporarily allow this? Also, is this method even going to work out? The end goal is for it to show up on the drop down list in the image above because I need to change the font of the header text. I can do any programming stuff needed.


[1]:
Reply

#2
There is [plugins][1] that allow you to whitelist certain mime types.

Also the `add_filter` hook can be used to extend the default allowed mime types from a theme or plugin.


*P.S.: You really shouldn't use ttf for web use, since it's uncompressed. Use woff, woff2 or eot instead.*


[1]:

[To see links please register here]

Reply

#3
You can allow uploading the .ttf font on your site, by adding a simple filter code on function.php file.

Below is the code for .ttf font only

add_filter('upload_mimes', 'add_custom_upload_mimes');
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes['ttf'] = 'application/x-font-ttf';
return $existing_mimes;
}



You can add more MIME type in the function to allow to upload those file.
Reply

#4
Unfortunately for me neither the code snippet for **functions.php** or the plugin worked.

I had to temporarily add the following code to **wp-config.php**:

define('ALLOW_UNFILTERED_UPLOADS', true);

And then of course deleted it as soon as I had uploaded the font.

(However in future I will attempt to use compressed font versions as suggested in the bottom two answers).
Reply

#5
You can use a code snippet to add support for certain mime types, or use a plugin to enable that feature. Or you could avoid the issue at all by converting the file to a compressed version, for example using an online converter like

[To see links please register here]


This was the first one I run into while trying to solve your very same problem; it's not the best or the fastest or anything: it just works.

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through