Add OG meta tags to wp head

Well You can also try by adding action inside. function after_submission( $entry, $form ) { $name = $entry[2]; $item = $entry[5]; insert_og_in_head( $name, $item ); add_action( “wp_head”, “insert_og_in_head” ); } add_action( “gform_after_submission”, “after_submission”, 10, 2 ); function insert_og_in_head( $name = NULL, $item = NULL) { global $post; if ( !is_page( 6 ) ) //if it … Read more

output specific location in the header

Okay, here is a working example of what you (might) want to do. Put the following in your functions.php: add_action(‘wp_head’, ‘my_jquery_code’, 999999999); function my_jquery_code() { $jquery_code = <<<JQUERY <script> // jQuery code goes here… </script> JQUERY; echo $jquery_code.PHP_EOL; } // function my_jquery_code

Unable to apply selective loading

Try this. It dequeues the style and script set in ‘init’. add_action( ‘template_redirect’, ‘remove_wizzylike’ ); function remove_wizzylike() { if ( ! is_single() ) add_action( ‘wp_head’, ‘remove_wizy’, 5 ); } function remove_wizy() { remove_action( ‘wp_head’, ‘wizylike_head’ ); // Enqueued in wizylike_init() wp_dequeue_style( ‘wizylike’ ); wp_dequeue_script( ‘wizylike’ ); }

“Warning: count()” printing in Page templates

Turns out the problem was Jetpack. I looked through the <head> to see where in the stack it was breaking and it was right in the middle of the Jetpack plugin code. Looks like it’s being worked on here: https://github.com/Automattic/jetpack/issues/8156 under “PHP warnings.” Since Jetpack isn’t necessary for my dev server on this project, I … Read more