{"id":86,"date":"2012-09-13T12:17:04","date_gmt":"2012-09-13T12:17:04","guid":{"rendered":"http:\/\/www.jacksowden.co.uk\/blog\/?p=86"},"modified":"2012-09-13T23:27:50","modified_gmt":"2012-09-13T23:27:50","slug":"add-your-blog-custom-style-sheet-to-wordpress-text-tinymce-editor","status":"publish","type":"post","link":"https:\/\/www.jacksowden.co.uk\/blog\/add-your-blog-custom-style-sheet-to-wordpress-text-tinymce-editor\/","title":{"rendered":"Add your blog \/ custom style sheet to WordPress text \/ tinymce editor"},"content":{"rendered":"<p>For a while now I have wondered how easy it would be to add a custom style sheet to the WordPress text \/ tinymce editor. It sometimes seems hard for clients to relate to their main site when editing text via WordPress as the styles are so different.<\/p>\n<p>After a bit of Googling I found the following code which if placed inside the functions.php file of your theme, add a custom style sheet to the editor.<\/p>\n<p>{code type=php}<br \/>\nif ( ! function_exists(&#8216;tdav_css&#8217;) ) {<\/p>\n<p>function tdav_css($wp) { $wp .= &#8216;,&#8217; . get_bloginfo(&#8216;stylesheet_url&#8217;); return $wp; }<\/p>\n<p>}<\/p>\n<p>add_filter( &#8216;mce_css&#8217;, &#8216;tdav_css&#8217; );<\/p>\n<p>{\/code}<\/p>\n<p>I found this code at the following link <a href=\"http:\/\/wordpress.org\/support\/topic\/how-do-i-add-custom-stylesheets-to-tinymce\">http:\/\/wordpress.org\/support\/topic\/how-do-i-add-custom-stylesheets-to-tinymce<\/a> and it worked for me in WordPress Version 3.4.2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while now I have wondered how easy it would be to add a custom style sheet to the WordPress text \/ tinymce editor. It sometimes seems hard for clients to relate to their main site when editing text via WordPress as the styles are so different. After a bit of Googling I found [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":107,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,24],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-wordpress-2"],"_links":{"self":[{"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":22,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions\/96"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/media\/107"}],"wp:attachment":[{"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jacksowden.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}