1

I've been working through a wordpress tutorial using MAMP and everything was working fine for a couple days, till I tried to work on it today.

When I go to localhost:8888/mywebsite.com, it shows my web page, but at the top where the wordpress dash would be it shows:

function register_my_menu() { register_nav_menu('header-menu',__( 'Header Menu' )); } add_action( 'init', 'register_my_menu' );

And when I go to localhost:8888/mywebsite.com/wp-admin, it shows the same code again.

I'm fairly new to this, so I assume I'm just being stupid and not seeing something. I'm guessing theres something going on with my functions.php? Just not sure as I haven't changed anything.

Any help is much appreciated. Thanks!

Axel
  • 3,331
  • 11
  • 35
  • 58
Austinmdem
  • 109
  • 1
  • 6

1 Answers1

0

Many of my students also forget to add opening php tag when working with functions.php

So, make sure that your functions.php file begins with this:

<?php

function register_my_menu() {
    register_nav_menu('header-menu',__( 'Header Menu' ));
} 
add_action( 'init', 'register_my_menu' );
Misha Rudrastyh
  • 866
  • 10
  • 16
  • Thanks. Yea, I was missing the tag and for the white screen of death, something was corrupt in the custom theme I was building. – Austinmdem Nov 06 '17 at 20:16