WordPress.org

Ready to get started?Download WordPress

Forums

News Theme - Messed Up Code Distorts Page (7 posts)

  1. vsp5014
    Member
    Posted 1 year ago #

    So last night I was adding some code (an AdSense unit) to Theme Editor and after updating the file the code distorted the page.

    Even after I deleted the code and updated the file once again, it did not revert to the original version. I downloaded the theme code files and replaced them in the Theme Editor, but this did not work. I'm no expert but it doesn't make much sense to me, since the original code is all there.

    Please help? Here is the website - http://www.nicolas-cage.org

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You still have major problems:

    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.nicolas-cage.org%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    Try replacing the header.php file with new copy via FTP (download the theme to your local computer first). If you've changed any other theme files -- replace those as well -- you need to be using a Child Theme to make any changes to the theme. Otherwise all your changes will be lost when the theme is updated.

    So go back and make a child theme now -- and move any changes to it.

    http://codex.wordpress.org/Child_Themes

  3. vsp5014
    Member
    Posted 1 year ago #

    Thank you for the insights.

    I actually didn't make any changes to the code other than the code I added then deleted (so all the validation problems must be present in the original theme file?).

    I replaced the header.php file via FTP. Should be done in "wp-admin" or "wp-content" in my directory? I tried both and neither worked.

    Then, to create a Child theme I uploaded the style.css News theme file to the directory. Once again tried both wp-admin and wp-content and neither fixed the issues. Are there any further changes I need to make in the WP Theme editor? Not sure if this successfully created a Child Theme or not (but site issues remain).

    Thanks for your help and patience as I realize I'm not the most adept at this! Please any further help would be great

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    (so all the validation problems must be present in the original theme file?)

    No, at least some of those errors (i.e. missing head and body tags) are definitely not in the original theme files.

    The new, unchanged header.php file should go in the theme folder (news):
    wp-content -> themes -> news -> header.php

    It should replace the old one that is messed up.

    You need to carefully read and follow the instructions for creating a child theme. You do not have one currently on your site. You may want to just delete the news theme you have and reinstall it -- as you may well have other files messed up. In that case, don't worry about replacing the header.php file.

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    But if you are going to delete the news theme, first switch to another theme temporarily (i.e. twentyeleven or twentytwelve).

  6. vsp5014
    Member
    Posted 1 year ago #

    Hmmm thanks once again but I'm still having problems.

    I switched to another theme, completely deleted "News" and then re-installed and activated. Unfortunately, still having the same issue. I've tried different themes, and all of them have the same problems....

  7. vsp5014
    Member
    Posted 1 year ago #

    Anyone else?

    Really not sure what to do here. I've tried uninstalling and activating several different themes through WP-Admin but the same problems remain. Since every theme is using different code, maybe it's not a code problem at all?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags