add action wp_head not working

Pull the add_action() outside of the function, and put the conditional inside the callback. Also, if you’re printing a script directly, use wp_print_scripts instead of wp_head. You also have a syntax error. function testingone(){ if( get_option( ‘MyOptionName’ ) ) { ?> <script>var Script = GoesHere; </script> <?php } } add_action( ‘wp_print_scripts’,’testingone’ );

How do I alter the position of a Custom Post Type menu item within my plugin admin menu?

As the dashboard uses the menu_position 2, just use menu_position 1. so: $args = array( ‘label’ => __( ‘programmes’, ‘hiblio’ ), ‘description’ => __( ‘Programmes for application from partner organisations’, ‘hiblio’ ), ‘labels’ => $labels, ‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘comments’, ‘revisions’, ‘custom-fields’, ), ‘taxonomies’ => array( ‘programmes_categories’ ), ‘hierarchical’ => true, … Read more