Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a massive rookie error and when I went to paste some code on the end of my wordpress theme's functions.php file, instead I did so on the wordpress 'wp-includes' functions.php.

I then deleted the code once I got a syntax/parse error saying there was an unexpected 'end of file' on functions.php

I can't for the life of me remember how that file ended and don't know what to do - all i know is i can't do anything on my wordpress site.

My functions.php ends like this:
PHP
	<script>
	( function() {
		var query = document.location.search;

		if ( query && query.indexOf( 'preview=true' ) !== -1 ) {
			window.name = '<?php echo $name; ??>';
		}

		if ( window.addEventListener ) {
			window.addEventListener( 'unload', function() { window.name = ''; }, false );
		}
	}());
	</script>
	}	
}


Thank you so much for anyone who gives the time to assist.
Posted
Updated 28-Sep-15 3:54am
v2
Comments
AnvilRanger 28-Sep-15 10:28am    
Thought about just downloading the same version of WordPress and replacing the file(s) that you changed? Of course this is assuming you have not modified those files from the base WordPress.

Looks like you are missing a needed php tag. Should be:

XML
    <script>
    ( function() {
        var query = document.location.search;

        if ( query && query.indexOf( 'preview=true' ) !== -1 ) {
            window.name = '<?php echo $name; ?>';
        }

        if ( window.addEventListener ) {
            window.addEventListener( 'unload', function() { window.name = ''; }, false );
        }
    }());
    </script>
    <?php
}
 
Share this answer
 
If you have not changed the file before to this, then just download WordPress again and replace the existing file with the new file in your WordPress.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900