Fatal error after trying to rename Portfolio

Home Forums Haste Theme Fatal error after trying to rename Portfolio

Home Forums Haste Theme Fatal error after trying to rename Portfolio

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • oliver_sept
    Participant

    Hi, I tried to rename Portfolio section.

    And so I went to /wp-content/themes/haste/inc/api/portfolio.php

    In this file i changed

    public function get_title() {
    return esc_attr__( ‘Portfolio’, ‘haste’ );
    }

    to

    public function get_title() {
    return esc_attr__( ‘Case Studies’, ‘haste’ );
    }

    And now the whole website doesn’t work, even after I changed it back.

    <b>Fatal error</b>: Uncaught Error: Class ‘Elementor\Widget_Base’ not found in /data/web/virtuals/320233/virtual/www/wp-content/themes/haste/inc/api/portfolio.php:17 Stack trace: #0 /data/web/virtuals/320233/virtual/www/wp-content/themes/haste/inc/init.php(91): require_once() #1 /data/web/virtuals/320233/virtual/www/wp-content/themes/haste/functions.php(6): require_once(‘/data/web/virtu…’) #2 /data/web/virtuals/320233/virtual/www/wp-settings.php(591): include(‘/data/web/virtu…’) #3 /data/web/virtuals/320233/virtual/www/wp-config.php(96): require_once(‘/data/web/virtu…’) #4 /data/web/virtuals/320233/virtual/www/wp-load.php(50): require_once(‘/data/web/virtu…’) #5 /data/web/virtuals/320233/virtual/www/wp-blog-header.php(13): require_once(‘/data/web/virtu…’) #6 /data/web/virtuals/320233/virtual/www/index.php(17): require(‘/data/web/virtu…’) #7 {main} thrown in <b>/data/web/virtuals/320233/virtual/www/wp-content/themes/haste/inc/api/portfolio.php</b> on line <b>17</b>

    It shows me this error. Please How Can I Fix This. I’ll sell my soul for the solution.

    • This topic was modified 10 months, 1 week ago by oliver_sept.

    Shufflehound
    Moderator

    Hello,

     

    I’m sorry to hear that you’re having trouble with your WordPress website. As you’ve experienced, directly modifying theme files can sometimes lead to complications or even cause your site to stop functioning. Fortunately, using a tool like the Loco Translate WordPress plugin can help avoid such issues by providing a safer way to make text changes.

     

    Here’s a step-by-step guide on how to rename the “Portfolio” section to “Case Studies” using Loco Translate:

    1. Install Loco Translate Plugin: In your WordPress admin, navigate to Plugins > Add New. In the search box, type “Loco Translate”. Click “Install Now” next to the Loco Translate plugin, and then activate it.
    2. Select Your Theme: Now, go to Loco Translate > Themes. Here, you’ll see a list of all the themes installed on your site. Select your active theme (in this case, “Haste”).
    3. Edit Strings: After selecting the theme, click on “Edit template”. In the list of strings, look for the ‘Portfolio’ string. Note that this may require browsing through several pages of strings, or you can use the “Filter Translation” search box to locate it quicker.
    4. Translate the String: Once you’ve found the ‘Portfolio’ string, click on it to select it. In the text box at the bottom of the page, replace ‘Portfolio’ with ‘Case Studies’.
    5. Save Your Changes: After making the changes, click “Save” to apply them. The ‘Portfolio’ section on your site should now display as ‘Case Studies’.

     

    Please remember, it’s generally best to avoid modifying theme or plugin files directly. Such changes can easily be overwritten during updates, and as you’ve seen, they can sometimes cause your site to malfunction. Using a translation plugin like Loco Translate can provide a safer, more sustainable way to customize your site’s text.

     

    I hope this helps! Let me know if you have any further questions.

     

    Best regards,

    Shufflehound team

    • This reply was modified 10 months, 1 week ago by Shufflehound.

    oliver_sept
    Participant

    Thank you very much, I will do that. But how can I make my website working again? This is the weird part. When I change it back to what it was in the file it’s still broken.

    And changing

    public function get_title() {
    return esc_attr__( ‘Case Studies’, ‘haste’ );
    }

    back to

    And changing

    public function get_title() {
    return esc_attr__( ‘Portfolio’, ‘haste’ );
    }

    doesn’t really help. Do you have any ideas please?

    Shufflehound
    Moderator

    Hi there,

     

    Could you please give it a shot and download the latest version from Themeforest, then proceed with a fresh theme installation? By doing so, we can ensure that the theme files have been completely reset.

     

    Let us know if that works.

     

    Best regards,

    Shufflehound team

    oliver_sept
    Participant

    Unfortunately I can’t. There are months of work already running on the website. I wouldn’t want to bother you if I could 🫣

    Shufflehound
    Moderator

    Hello,

     

    Usually, theme files don’t contain any data and it is safe to update to newer versions. Only if you have created custom modifications to the theme itself then it could be an issue. But that is not recommended and should be done via a child theme, so you can receive future security and feature updates.

     

    Best regards,

    Shufflehound team

Viewing 6 posts - 1 through 6 (of 6 total)