WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having some issues with a couple of plugins which use jQuery/JS i.e. cookie control and a picasa photo gallery.

The theme I am using is quite basic and comes with no sliders etc with moving parts and therefore maybe HAD no need for for jQuery/JS so may not be included in the theme.

I have tested the exact same setup on a more advanced theme with sliders etc and these work as planned.

Below is the code for the header.php file:

<?php if (wp_loaded() === true) { ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0  Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" /><![endif]-->
<link rel="shortcut icon" type="image/x-icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" />
<link rel="shortcut icon" type="image/png" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.png" />
<?php if(WP_VERSION < 3.0): ?>
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', THEME_NS), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', THEME_NS), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
<?php endif; ?>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
remove_action('wp_head', 'wp_generator');
if ( is_singular() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
wp_head(); ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
</head><?php } ?>
<body <?php if(function_exists('body_class')) body_class(); ?>>
<div id="art-main">
<div class="cleared reset-box"></div>
<div class="art-nav">
    <div class="art-nav-l"></div>
    <div class="art-nav-r"></div>
    <div class="art-nav-outer">
    <div class="art-nav-wrapper">
    <div class="art-nav-inner">
        echo theme_get_menu(array(
                'source' => theme_get_option('theme_menu_source'),
                'depth' => theme_get_option('theme_menu_depth'),
                'menu' => 'primary-menu',
                'class' => 'art-hmenu'  
<div class="cleared reset-box"></div>
<div class="art-sheet">
    <div class="art-sheet-body">
        <div class="art-header">
            <div class="art-logo">
            <?php if(theme_get_option('theme_header_show_headline')): ?>
            <h1 class="art-logo-name"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
            <?php endif; ?>
            <?php if(theme_get_option('theme_header_show_slogan')): ?>
                <h2 class="art-logo-text"><?php bloginfo('description'); ?></h2>
            <?php endif; ?>
        <div class="cleared reset-box"></div>

I need to find a way of making these plugins work by including these libraries? I assume.

Surely it is just a case of adding the inclusion of said libraries to this header file? I assume the wordpress platform have built in libraries?


While searching for the problem Dreamweaver reported a syntax error in a huge line of code located in functions.php. I am not sure what it is but I imagine its likely to be the reason for my problem. Hopefully this is some sort of JavaScript or jQuery library that I can source from the the JavaScript or jQuery site and simply paste that code over the top?

Here is a little snippet of what the code looks like:

share|improve this question

migrated from webmasters.stackexchange.com Mar 26 '13 at 4:15

This question came from our site for pro webmasters.

up vote 0 down vote accepted

Not entirely sure what you're asking but you have to include and register scripts and then enqueue what you require like:-

<?php wp_enqueue_script('jquery'); ?>

(Place immediately before <?php wp_head(); ?>).

Which is included with Wordpress incidentally.

You can read more on wp_enqueue_script for more information on how to use this in your theme.


An example of registering javascript in theme's functions.php

function load_scripts() {
    wp_register_script( 'jquery-slider', get_template_directory_uri() . '/js/jquery.slider.js', array('jquery'), '2.0', true );
share|improve this answer
Hi thanks for your response. Basically I need to include jQuery and JavaScript (i think). My skills with things like this arent fantastic. The code you have provided is already included in the code above. – Paul Armstrong Mar 25 '13 at 16:58
Then those libraries are included. What isn't working exactly? Your themes functions file would need to register the necessary javascript (I've edited my answer to show an example of this). – Geoff Jackson Mar 25 '13 at 17:18
I think the problem lies with a syntax error in the functions.php file that Dreamweaver reported. Although I am not sure what the code is I have updated a small snippet of it to my original answer in the hope its a JavaScript or jQuery library which I can download from the JS or jQuery website and simply paste that code over the broken code. – Paul Mar 27 '13 at 9:16
That code has been encrypted so means nothing... So you've either got a theme which has been injected with something malicious or the developer does not want you to edit what is there. Either way, it doesn't look good and is likely nothing to do with what you think it is. – zigojacko Mar 27 '13 at 10:45
haha great! thanks for your help man! – Paul Mar 27 '13 at 10:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.