Update 1.17 Error


#1

Hello guys!
All worked perfectly with Rocked Pro so far, but today I tried to update to the new version of the theme- After the update - the website was gone and it said:

Fatal error: Cannot declare class Rocked_Employees, because the name is already in use in /home/.sites/285/site890/web/wp-content/themes/rocked-pro/widgets/fp-employees.php on line 175

I am using a child theme - don’t know it that is important! I was able to get the site up and running again, because I luckily saved the ‘old’ theme folder that I now replaced via ftp upload.
Can you please help me how I would be able to use the updated version of Rocked Pro!

Thank you in advance,
Gladys


#2

Hello there,

Did it happen when your child theme was active? Please check your child theme’s files and see if there’s a duplication of the fp-employees.php file.

If possible, pleas share your child theme (zip package) to Google Drive and share it with my email kharisblank@gmail.com, to allow me inspecting it. Probably there’s something I can do to correct it.

Regards,
Kharis


#3

Dear Kharis,

yes the error occurred while the child was active. I am using a modified
fp-employees.php and a modified fp-news.php enclosed in the widgets folder
in the child. I’d like to keep the changes after the update - is that
possible? Thank you very much for your help!!

Best,
Gladys

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virenfrei.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Mag.* Amely E. Haslauer*
Werbeagentur Amely Haslauer
Erzabt-Klotzstrasse 8 | 5020 Salzburg | +43 (0)664 8212862 |
werbemeisterei@gmail.com
www.werbemeisterei.at


#4

Hello there,

I would like to apologize in advance for the long delay.

In your functions.php file of child theme, add this code:

    function rocked_child_widgets_init() {
    	register_widget( 'Custom_Rocked_Employees' );
    }
    add_action( 'widgets_init', 'rocked_child_widgets_init' );

In the fp-employees.php file, replace this code block:

    class Rocked_Employees extends WP_Widget {

        function rocked_employees() { 

with:

    class Custom_Rocked_Employees extends WP_Widget {

        function __construct() {

Set a unique name for your new widget by replacing $name value in this line:

    parent::__construct(false, $name = __('Rocked FP: Employees', 'rocked'), $widget_ops);

to:

   parent::__construct(false, $name = __('Rocked FP: Custom Employees', 'rocked'), $widget_ops);

In the page builder, you can search for “Rocked FP: Custom Employees”.

Regards,
Kharis


#5

Dear Kharis,

Thank you so much! That worked like a charm! I did the same thing for my
updated news widget! You are a wizard!!!

Have a wonderful day,
all the best,
Gladys

Mag.* Amely E. Haslauer*
Werbeagentur Amely Haslauer
Erzabt-Klotzstrasse 8 | 5020 Salzburg | +43 (0)664 8212862 |
werbemeisterei@gmail.com
www.werbemeisterei.at


#6

You’re welcome!

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