get_page() Parameters Optional?
-
I am trying to use get_page() in a page template file to grab the slug, like so:
$slug = get_page()->post_name;
but I am getting the warning:
PHP Warning: Missing argument 1 for get_page(), called in .../profiles-page.php on line 24 and defined in .../wp-includes/post.php on line 3110
According to the Codex page, any parameters are optional. Anybody have any ideas about why I am getting this error?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_page() Parameters Optional?’ is closed to new replies.