BIG Problem to load my wordpress site :( Wordpress don' work

Hi athemes, I have a big problem and hopefully you will help me to recover my site.

From now, when I try to access to my website from wordpress panel, I receive the error message below :

Parse error: syntax error, unexpected ‘<’ in /home3/nassim/public_html/wp-content/themes/west/functions.php on line 386

Why this problem ? because I have made a copy/past of some codes (The events Calendar website) into the function.php. Please find here the link of the code which cause me this huge problem : https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/

I thought I was following the steps as they described it :confused:

I’m using HostGator as a hosting provider.

My website link : www.pharmaxiom.com

Hopefully you will help me to recover my site :frowning:

Thank you in advance. KR, Nassim

Hello there,

Did you copy the whole code?

If you add some code into the functions.php file, you don’t need to include <?php as seen on the first line. You only need the code below:


// Singular
add_filter( 'tribe_event_label_singular', 'event_display_name' );
function event_display_name() {
	return 'Meeting';
}
add_filter( 'tribe_event_label_singular_lowercase', 'event_display_name_lowercase' );
function event_display_name_lowercase() {
	return 'meeting';
}

// Plural
add_filter( 'tribe_event_label_plural', 'event_display_name_plural' );
function event_display_name_plural() {
	return 'Meetings';
}
add_filter( 'tribe_event_label_plural_lowercase', 'event_display_name_plural_lowercase' );
function event_display_name_plural_lowercase() {
	return 'meetings';
}

Just for information, editing the main theme’s functions.php file isn’t a good practice. I strongly recommend you do that in the child theme mode.

https://codex.wordpress.org/Child_Themes

There are other alternative for adding some functionalities to your site without touching the functions.php file. You can use a functionality plugin like Code Snippets.

Regards,
Kharis

Hi Kharis, thank you for your feedback.

Unfortunately, I have copied the entire code including <? Php </ em>.

I know now that it’s not a good idea to edit the main theme’s functions.php :frowning:

So, in my situation, how I can retrieve the access to my site?

Kind regards, Nassim

Hello there,

You need to access the functions.php file from either FTP or cPanel’s file manager, and then download it to your drive, edit it locally on your PC, then upload.

Regards,
Kharis

OUF !! It works. Definitely, I’ll never edit the main theme’s functions.php file ! Thanks again Kharis for your support.

Kindest regards, Nassim

My pleasure!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis