• Hi!

    I was trying to follow some steps to insert an adsense code in funcions.php here : https://acolita.com/insertar-adsense-dentro-entrada-pagina-wordpress/#comment-14143

    and I might have done something wrong because now my page is down!

    When I try to see what I could have done wrong, the guy was saying to write the code after a “endif”. I didnt’t find it so I wrote “endif” and pasted the adsense code after.

    So I wrote exactly this in functions.php :

    endif;
    
    function showads() {
    return '<div>I WROTE MY ADSENSE CODE HERE</div>';
    }
    add_shortcode('adsense', 'showads');

    Afterwards I saved and the page was down, so I came back to the previous page, deleted the code I wrote and saved again.

    https://pimpambuzz.com/

    Do you know what I could do?

    Thanks!

    PS: I am a beginner in wordrpress so I don’t know how to code (I know, it was a bad idea…)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    The endif; statement that you have inserted in the functions.php file is creating the problem.

    Since you are beginner (as you mentioned), I am not going into details, just remove that line of code (only the endif statement and not the adsense function).

    Let me know if that works!

    Shreyans

    There is still something wrong in the file. Can you reload the original theme files?

    David_G

    (@questas_admin)

    You will need to use FTP or your c-panel file manager to access the functions.php file in your theme and remove the code you added. Or you can download the theme files from WP and upload the functions.php file to restore it to original.

    The best way to make changes like this to a theme is to use a child theme, so your tweaks won’t be overwritten when updating the theme. Here are some guides in case you haven’t made one before:
    https://codex.www.ads-software.com/Child_Themes
    https://op111.net/53/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Broke my site in functions.php’ is closed to new replies.