• I have some custom code I wrote for wordpress that requires a different version of jQuery. In order to not have a collision with the standard WP functionality, I only want to load some javascript for my page only. In the sites header.php, I have this code

    ...
    <?php
    if ( !is_admin() ){
    wp_deregister_script('jquery');
    wp_enqueue_script('jquery-1.7.2',get_template_directory_uri() . '/js/jquery-1.7.2.min.js');
    wp_enqueue_script('jquery-ui-1.8.20', get_template_directory_uri() . '/js/jquery-ui-1.8.20.custom.min.js', array('jquery-1.7.2'));
    }
    ?>
    <?php wp_head(); ?>
    ...

    is_admin() helps but I need something like :

    if ( !is_admin() && is_page(‘MyPage.php’))

    Is there any type of call that can tell what page you are going to while constructing the HEAD portion of the page?

  • The topic ‘WP API call to determine the page you are loading when setting up the header’ is closed to new replies.