Home › Forums › Backend Issues (wp-admin) › Visual editor breaks when applying post-category rule + moving the editor › Reply To: Visual editor breaks when applying post-category rule + moving the editor
Hi @ituk
It seems the document
selector is the one that causes the issue. Could you please try to add the following code to your functions.php file?
add_action('acf/input/admin_head', 'my_acf_move_content_editor');
function my_acf_move_content_editor() {
?>
<script type="text/javascript">
(function($) {
$(document).ready(function(){
if( $("#in-category-1").is(':checked') ){
$('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
}
$('#in-category-1').on("change", function(){
if( $(this).is(':checked') ){
$('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
} else {
$('#post-body-content').append( $('#postdivrich') );
}
});
});
})(jQuery);
</script>
<style type="text/css">
.acf-field #wp-content-editor-tools {
background: transparent;
padding-top: 0;
}
</style>
<?php
}
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.