Home Forums WoodMart support forum Can’t add custom fonts woff and woff2

Can’t add custom fonts woff and woff2

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #699653

    Ves
    Participant

    The line in wp-config doesn’t do anything – define( ‘ALLOW_UNFILTERED_UPLOADS’, true );

    The snippet also doesn’t change anything:
    function allow_woff_woff2_uploads( $mimes ) {
    if ( ! is_array( $mimes ) ) {
    $mimes = [];
    }
    $mimes[‘woff’] = ‘font/woff’;
    $mimes[‘woff2’] = ‘font/woff2’;
    return $mimes;
    }
    add_filter( ‘upload_mimes’, ‘allow_woff_woff2_uploads’, 10, 1 );

    – the fonts aren’t visible in the Woodmart theme. As I understand it, loading is blocked at the hosting settings level… But the hosting company replied that they don’t block custom mime types, so I should check the cache, but caching isn’t enabled at the site level yet.

    I tried adding this solution – https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ – upload custom fonts via FTP in upload/fonts folder and setting up the @font-face rules in Woodmart Custom CSS page – it still doesn’t work. Woodmart doesn’t see the custom font, and that’s it…

    I also have a request for this topic in the future – to add support for EOT, SVG, OTF font format, because different browsers, especially older ones, need support for these formats. For example, the Bricks Builder theme and Oxygen Builder support this…

    #699891

    Ves
    Participant

    Access

    #699901

    Artem Temos
    Keymaster

    Hi Ves,

    Let’s set up the font via the built‑in Custom Fonts feature so it appears in the Typography dropdowns.

    Please follow this tutorial step by step:
    https://xtemos.com/docs-topic/how-to-upload-custom-fonts/

    Key points:
    – Prepare WOFF and WOFF2 files for each weight/style you need (you can convert TTF/OTF to WOFF/WOFF2 if needed).
    – Upload the files to Media Library.
    – Go to Dashboard -> Theme Settings -> Typography -> Custom fonts -> Add new.
    – Use a unique Font | Name (do not reuse Google font names).
    – For each weight/style, select the corresponding WOFF and WOFF2 from the Media Library.
    – Save settings, then reload the Theme Settings page. After that the font will be available in Theme Settings -> Typography groups for assignment.

    Notes:
    – Fonts added only via @font-face in Custom CSS won’t appear in the Typography dropdowns. They must be added through Theme Settings -> Typography -> Custom fonts.
    – After saving, refresh the page to populate the font list.

    If this still doesn’t work:
    – Keep all plugins turned off.
    – Please send:
    – Screenshots of your Custom fonts setup (Theme Settings -> Typography -> Custom fonts).
    – A screenshot showing the font files in Media Library (with the file details panel visible).

    Kind Regards

    #700052

    Ves
    Participant

    Not allowed

    Attachments:
    You must be logged in to view attached files.
    #700056

    Ves
    Participant

    All plugins are disabled

    Attachments:
    You must be logged in to view attached files.
    #700066

    Artem Temos
    Keymaster

    Please send us your FTP access so we can check if you have correctly added the constant to wp-config.php file, which allows these files.

    Kind Regards

    #700077

    Ves
    Participant

    Added. Maybe MIMe blocks by Imunify360 on hosting… Needed to ask hosting support…

    #700078

    Artem Temos
    Keymaster

    We don’t see the ALLOW_UNFILTERED_UPLOADS constant added to the wp-config.php file. Please add it and test how it works.

    #700106

    Ves
    Participant

    Exist…

    Attachments:
    You must be logged in to view attached files.
    #700118

    Artem Temos
    Keymaster

    It implies that we’re examining different files. The folder structure via FTP is distinct, so either I or you are checking the wrong file.

    #700120

    Ves
    Participant

    Please, attach a screenshot of your structure.

    #700121

    Ves
    Participant

    Path

    #700141

    Artem Temos
    Keymaster
    #700154

    Ves
    Participant

    Sorry, wrong path.. I’m attached screen of full path

    Attachments:
    You must be logged in to view attached files.
    #700162

    Artem Temos
    Keymaster

    Thank you. But even that wp-config.php file doesn’t contain this constant’s code.

    #700240

    Ves
    Participant

    Please, attach the screenshot of your structure.

Viewing 16 posts - 1 through 16 (of 16 total)