How to link external JavaScript files?

From my point of view, this should be working. Maybe you can post your custom.js file here. It could be possible that this file has a syntax error or something similar. You could also test if the built-in jquery is working out of the box by adding a simple jquery-command in your header.php.

Some hints:

  1. The action-hook template_redirect is used to include the file only on the front-page (so i can remeber). If you want to load the script after the theme is loaded, you can use the after_setup_theme action-hook.

  2. You don’t have to enqueue your jquery file manually, if you set jquery as a dependancy of your custom.js, like you did. The file will automatically be loaded from WordPress before your custom.js is attached.

  3. Do you have added the jQuery.noConflict(); at the beginning of your custom.js?

Some working example:

functions.php

function twentyten_custom_scripts() {
    if ( !is_admin() ) // instruction to only load if it is not the admin area
    { 
        wp_register_script('custom_script', get_bloginfo('template_directory') . '/scripts/custom.js', array('jquery') );
        wp_enqueue_script('custom_script');
    }
}
add_action('after_setup_theme', 'twentyten_custom_scripts');

custom.js

jQuery.noConflict();

jQuery(document).ready(function() {
    // do your stuff e.g.
    jQuery("a[rel^='prettyPhoto']").prettyPhoto();
});