Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:54:46+00:00 2026-06-14T08:54:46+00:00

==ISSUES HAVE BEEN SOLVED== I am trying to follow the steps within this tutorial//

  • 0

==ISSUES HAVE BEEN SOLVED==

I am trying to follow the steps within this tutorial//

http://tatiyants.com/how-to-use-wordpress-custom-post-types-to-add-events-to-your-site/

But I’ve come across a Fatal Error after step 2.


Fatal error: Call to undefined function format_date() in /functions.php on line 134

Error Line//
echo format_date($custom["event_date"][0]) . '<br /><em>' .

Content currently in Functions.php//
http://pastebin.com/FvqvE187

What exactly is the issue?
&How can I fix this?

EDIT//

Added
function format_date($unixtime) {
return date("F", $unixtime)." ".date("d", $unixtime).", ".date("Y", $unixtime);
}

to my functions.php to fix the Fatal Error another issue occurred.

Before the error, in the post edit screen there was a Event Detail Metabox. But after this change the box isn’t there any more. It allowed me to add Locations and Times ect. Now I have no way to add this extra information.
It’s clear the new code caused this but why?

EDIT2//

The answer to my 1st edit was simply adding the rest of the code (input boxes ect)
After adding the rest of the code this error pops up within the Event Detail metabox.

Fatal error: Call to undefined function format_date() in /functions.php on line 172

This is line 172//

$ret = '<p><label>Date: </label><input type="text" name="event_date" value="' . format_date(get_event_field("event_date")) . '" /><em>(mm/dd/yyy)</em>';

EDIT3//

All I had to do was remove format_date from line 172 and also remove one of the parentheses at the end. Doing that enables the Event Details again 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:54:47+00:00Added an answer on June 14, 2026 at 8:54 am

    Answer for the 1st Fatal Error//

    Fatal error: Call to undefined function format_date() in /functions.php on line 134

    Adding

    function format_date($unixtime) {
    return date("F", $unixtime)." ".date("d", $unixtime).", ".date("Y", $unixtime);
    }

    at the top of this code//

    function events_custom_columns($column){
    global $post;
    $custom = get_post_custom();
    
    switch ($column) {
    case "event_date":
            echo format_date($custom["event_date"][0]) . '<br /><em>' .
            $custom["event_start_time"][0] . ' - ' .
            $custom["event_end_time"][0] . '</em>';
            break;
    
    case "event_location":
            echo $custom["event_location"][0];
            break;
    
    case "event_city":
            echo $custom["event_city"][0];
            break;
    }
    }
    

    NOTE:// For some reason I am not sure of adding the code to the bottom didn’t work for me.

    Next Edit//
    Answer to this Fatal Error//

    Fatal error: Call to undefined function format_date() in /functions.php on line 172

    on this line//

    $ret = '<p><label>Date: </label><input type="text" name="event_date" value="' . format_date(get_event_field("event_date")) . '" /><em>(mm/dd/yyy)</em>';

    Simply remove format_date text and ONE parentheses from (event_date")).

    Now the Event Details are available 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been handed this project that has a large number of issues with
I have been using this code, but have been running into some memory issues:
I have been trying to get up to speed on Named Pipes this week.
I have been trying desperately to fix this issue where my ListView items are
I have been trying to fix this problem for hours. My app keeps crashing
Hey most of my issue has been solved but i have little problem This
I'm trying to (and have solved) a problem with 16 byte alignment issues with
I have been trying to solve this issue for a day now and have
Possible Duplicate: Database Deployment issues I followed the steps in this video: http://www.asp.net/iis/videos/developing-and-deploying-in-a-shared-hosting I
I have been trying for hours to find a way to solve the issue,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.