functions.php and conditional tags

functions.php is part of the loading process and way too early for conditional tags to work reliably. Any conditional logic should be hooked to and executed no earlier than template_redirect hook. For scripts on front-end wp_enqueue_scripts is appropriate hook.

Numbering lines of code with the tag?

To get syntax highlighting with line numbering, you’ll need to use a plugin like SyntaxHighlighter Evolved. In fact, looking at the source of that second link, it appears that they are using SyntaxHighlighter Evolved themselves.

Enqueue script on every page except one

Try giving your function its own parameters and do a template_redirect, something like this: <?php function mypage_scripts() { if ( !is_admin() ) { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js’, true, ‘1.6.2’, false); wp_enqueue_script(‘jquery’); /* My Script */ function contact_form_script() { if ( !is_page(‘contact’) ) { wp_enqueue_script(‘myscript’, get_bloginfo(‘template_url’) . ‘/js/myscript.js’, array(‘jquery’), ‘1.1’, false); } } add_action( ‘template_redirect’, ‘contact_form_script’ ); … Read more

is_page() or is_single not working

The problem is probably because wp_print_scripts is too late to deregister scripts as this is when they are outputted to the template. You should consider using wp_enqueue_scripts or wp_register_script instead. This question may help: wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused