Hello everyone,
I have a small problem with loading jQuery and JS scripts on wordpress.
I got this menu made with jQuery that works perfectly well on a basic html page.
Problem is i can't get the files to load as they should. I've looked around the web for jQuery tutorials for WP and i followed they're code but still nothing seems to work :\.
So far i got the css for the menu working, but still no animation happening as it should..so jQuery isnt loading or the custom menu script isnt loading, or both :|
i hope somebody here can give me a tip on how to fix this problem, thanks in advance :)
btw u can see the site at http://www.miguelfreitas.pro.tc/
Here's the code i put on the header.php file on my theme:
<!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">
<title>
<?php if (is_home()) { echo bloginfo('name');
} elseif (is_404()) {
echo '404 Not Found';
} elseif (is_category()) {
echo 'Category:'; wp_title('');
} elseif (is_search()) {
echo 'Search Results';
} elseif ( is_day() || is_month() || is_year() ) {
echo 'Archives:'; wp_title('');
} else {
echo wp_title('');
}
?>
</title>
<meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<meta name="description" content="<?php bloginfo('description') ?>" />
<?php if(is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php }?>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>
<script type="text/javascript"
src="<?php bloginfo("template_url"); ?>/style/js/menu.js"></script>
</head>
<body>
<ul id="topnav">
<li><a href="#">Home</a></li>
<li><a href="#">About me</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Lab</a></li>
<li><a href="#">Contacts</a></li>
</ul>
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<p><?php bloginfo('description'); ?></p>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>