wp_enqueue_scripts leads to error

I was using a genesis child theme so had to edit my order_tracking() function a little. get_template_directory_uri() gives the URL to the current child theme, combining that with the javascript filename did the trick. Here’s what got it working: function order_tracking() { global $post; if ( $post->ID == 19851 ) { wp_enqueue_script(‘ordertracking’, get_template_directory_uri(). “/ordertracking.js”, array(‘jquery’) … Read more

Second transition_post_status hook fired instead of the first

You can user if..else condition to combine both function into one hook. add_action( ‘transition_post_status’, ‘groupqueue_to_groupcpt_and_groupcpt_to_bannedcpt’, 10, 3); function groupqueue_to_groupcpt_and_groupcpt_to_bannedcpt($new_status, $old_status, $post){ //Move to Group Post Type if (‘publish’ === $new_status && ‘groupq’ === $post->post_type ) { wp_update_post(array( ‘ID’ => $post->ID, ‘post_type’ => ‘group’ ), true ); } else if ( ‘banned’ === $new_status && (‘groupq’ … Read more