WordPress WordPress Theme Development WordPress Header and Footer Templates Porting existing headers and footers into WordPress

Nicole Wu
Nicole Wu
1,864 Points

css not showing there is a fatal error.


function wpt_theme_style() {

wp_enqueue_style( 'foundation_css', get_template_directory_uri() . '/css/foundations.css' );
wp_enqueue_style( 'normalize_css', get_template_directory_uri() . '/css/normalize.css' );
wp_enqueue_style( 'normalize_css', 'http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic' );
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );

} add_action( 'wp_enqueue_scripts', 'wpt_theme_styles');

function wpt_theme_js () {

wp_enqueue_script( 'modernizr_js', get_template_directory_uri() . '/js/modernizr.js','','', false ); 
wp_enqueue_script( 'foundation_js', get_template_directory_uri() . '/js/foundation.js', aray('jquery'),'', true );
wp_enqueue_script( 'main.js', get_template_directory_uri() . '/js/app.js', array('jquery', 'foundation_js'),'', true);  

} add_action( 'wp_enqueue_scripts', 'wpt_theme_js');


<!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title><?php wp_title(); ?></title> <?php wp_head(); ?>


<body> <header class="row no-max pad main"> <h1><a class='current' href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1> <a href="" class="nav-toggle"><span></span>Menu</a> <nav> <h1 class="open"><a class='current' href="</?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1> <ul class="no-bullet"> <li class="current parent"><a class='current' href="index.html">Portfolio</a> <ul class="sub-menu"> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> </ul> </li> <li class="parent"><a href="blog.html">Blog</a> <ul class="sub-menu"> <li><a href="single-post.html">Single Post</a></li> <li><a href="author.html">Author Page</a></li> </ul> </li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header>

1 Answer

Konrad Traczyk
Konrad Traczyk
22,281 Points

Hello Nicole,

  1. In wpt_theme_style() function you've repeated "normalize_css", that causes to overwrite first definition of stylesheet, you're missing normalize.css in your project.
  2. In wpt_theme_js() you've mistyped array keyword which probably caused fatal error, you've got "aray('jquery')" in second line.
  3. In this unformatted html I spotted that you're using <title><?php wp_title(); ?></title>, which is bad way of doing this, you should've put "add_theme_support('title-tag');" into your theme function.php file.

Hope that helps, Konrad