Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active December 18, 2015 00:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/5696850 to your computer and use it in GitHub Desktop.
Save jdevalk/5696850 to your computer and use it in GitHub Desktop.
Pushes the WordPress SEO metabox below the ACF metabox. Put the code below in your theme's functions.php or in your functionality plugin:
<?php
/**
* Adds a bit of JS that moves the meta box for WP SEO below the ACF box.
*/
function move_yoast_seo_below_acf_js() {
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
if ( $('.acf_postbox').length > 0 && $('#wpseo_meta').length > 0 ) {
$('.acf_postbox').insertBefore($('#wpseo_meta'));
}
});
</script>
<?php
}
add_action( 'admin_footer', 'move_yoast_seo_below_acf_js' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment