wordpress - How do I dynamically add some piece of php code to an exact position in page before it is returned to the browser? -
i need add piece of code right before wp_head();
call using php because code has execute server side. hooking code wp_head();
not work. need add right before. here php code added.
gravity_form_enqueue_scripts(1,true);
here code needs inserted:
<?php /* add javascript pages comment form * support sites threaded comments (when in use). */ if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /* have wp_head() before closing </head> * tag of theme, or break many plugins, * use hook add elements <head> such * styles, scripts, , meta tags. */ gravity_form_enqueue_scripts(1,true); wp_head(); ?>
the code should not show on return browser. how add php snippet exact location dynamically?
i needed :
add_action('wp', 'gforms_add_before_wp_head');
not
add_action('wp_head', 'gforms_add_before_wp_head');
i turns out needed find right hook add_action to.
Comments
Post a Comment