0

I recently installed ACF Date and Time Picker plugin, and according to the installation guidelines, I copied the acf-date_time_picker folder that comes along with it inside my themes directory, alongside the functions.php file. Also, as per the installation guidelines, I copied the following code snippet inside my functions.php file:

<?php add_action('acf/register_fields', 'my_register_fields');

function my_register_fields()
{
    include_once('acf-date_time_picker/acf-date_time_picker.php');
}  ?>

The basic idea behind doing this was to include the acf-date_time_picker.php file inside my functions.php file. And since that file is included inside the acf-date_time_picker folder which is alongside functions.php file, I included the path to be included as

'acf-date_time_picker/acf-date_time_picker.php'

However, this is the error I'm encountering:

failed to open stream: No such file or directory in /opt/lampp/htdocs/wordpress/wp-content/themes/twentyfifteen/functions.php

What seems to be the problem here?

EDIT:

Including screenshots for better understanding of my directory paths:

enter image description here

enter image description here

Manas Chaturvedi
  • 5,210
  • 18
  • 52
  • 104

2 Answers2

0

Go to Admin->Appearance->Editor and select a different theme from the dropdown on the right. Edit its functions.php and see if you find any of the bad code there.

Arshid KV
  • 9,631
  • 3
  • 35
  • 36
0

You're using underscores _ instead of dashes - in the folder name

include_once('acf-date_time_picker/acf-date_time_picker.php');

The folder name I'm seeing in the first screenshot is acf-date-time-picker

So try:

include_once('acf-date-time-picker/acf-date_time_picker.php');
heytools
  • 764
  • 3
  • 16