I’m trying to add a custom font I found squirreled to my TinyMCE editor in WordPress.
I got the Font family dropdown to show up, but I can’t seem to get my own custom font into there.
I’m trying to add a custom font I found squirreled to my TinyMCE editor in WordPress.
I got the Font family dropdown to show up, but I can’t seem to get my own custom font into there.
You must be logged in to post a comment.
You can load CSS. In TinyMCE settings:
Than
custom_content.css
should contain@font-face
like:There are my setups in my Plugin (not in theme). This worked with WordPress 4.9
First, you need put you custom fonts to a folder. And linked them in a custom css file, you need to call full path in CSS. I my case, i put all my fonts in a folder
luc-nham/css/fonts
, then i call theme in CSS file.Note, in my case, my custom CSS file put into css folder and named custom_fonts.css, it will be use late.
Then you need some funtions in your main plugin file like below: