Home › Forums › Backend Issues (wp-admin) › Tips for making custom form fields look good in admin? › Reply To: Tips for making custom form fields look good in admin?
Hi @preserved
You can add HTML to any WP page by hooking into the ‘admin_footer’ action, checking that the url is correct for the page you want, and then injecting extra HTML into the page. Here’s a idea of the code:
add_action('admin_footer', 'my_admin_footer');
function my_admin_footer() {
// vars
$page = 'acf-options-cwl-settings';
// bail early if not correct page
if( empty($_GET['page']) || $_GET['page'] !== $page ) {
return;
}
?>
<div id="my-html">
<p>test</p>
</div>
<script type="text/javascript">
(function($) {
// move #my-html
$('#post-body-content').append( $('#my-html') );
})(jQuery);
</script>
<?php
}
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.