• Hello. When I view the text widget into the widgets editor it is in a plain serif font. I want to be able to load a custom css file for how the widgets appear in the admin view. I have got this working for post/pages in admin but the textarea widget is using an iframe and therefore isn’t loading my admin-view.css file.

    Is this possible?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You would need to to add JavaScript or jQuery that inserts the necessary stylesheet link tag into the head section of the iframe element. Browser security would prevent this with external iframe sources, but it should still work for iframe sources within the same domain.

    The other hindrance is the widget iframe element itself is also inserted via script, and naturally you cannot add a link tag to something that does not yet exist in the DOM. Your script would need to be contingent upon some event to ensure it does not run until the iframe has been inserted. I’m unsure how to accomplish this last bit.

Viewing 1 replies (of 1 total)

The topic ‘Adding custom CSS file for wordpress text widget in admin area’ is closed to new replies.