Call javascript functions from each page
I would create a custom field containing the function to be called, for example called ‘function_to_call’. In the templatefile add the code $function_to_call = get_post_meta( get_the_ID(), ‘function_to_call’, true ); if ( $function_to_call != “” ) { echo ‘ jQuery(document).ready(function($){ ‘ . $function_to_call . ‘() }); ‘; } Doing this only outputs the function if you … Read more