0

after adding this to functions.php, i get an error (white page), i have the open tag php and a closing.

<?php

add_theme_support('menus');


function my-theme_add_scripts() {
    wp_enqueue_script( 'google-map', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array(), '3', true );
    wp_enqueue_script( 'google-map-init', get_template_directory_uri() . '/js/google-maps.js', array('google-map', 'jquery'), '0.1', true );
}

add_action( 'wp_enqueue_scripts', 'my-theme_add_scripts' );

?>
Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
Kieselerd
  • 65
  • 1
  • 6
  • possible duplicate of [PHP's white screen of death](http://stackoverflow.com/questions/1475297/phps-white-screen-of-death) – Lorenz Meyer Mar 16 '15 at 17:30
  • Change `my-theme...` to `my_theme...`, you'll get a `Parse error: syntax error, unexpected '-', expecting ( ...` error. – jeroen Mar 16 '15 at 17:31
  • rename your function my-theme_add_scripts to someone else.... – Amrinder Singh Mar 16 '15 at 17:31
  • Blank pages ALWAYS means **Syntax** error. Add `error_reporting(E_ALL); ini_set('display_errors', 1);` at the top of your file to see any possible error and show us. – bcesars Mar 16 '15 at 17:35

1 Answers1

0

try function my_theme_add_scripts() instead of function my-theme_add_scripts(). You can't use - in your function names.

manniL
  • 7,157
  • 7
  • 46
  • 72