意外编辑的wordpress functions.php - 非常感谢! [英] Accidentally edited wordpress functions.php - Help much appreciated!

查看:68
本文介绍了意外编辑的wordpress functions.php - 非常感谢!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我犯了一个巨大的菜鸟错误,当我在wordpress主题的functions.php文件的末尾粘贴一些代码时,我在wordpress'wp-includes'functions.php上这样做了。



我在语法/解析错误后删除了代码,说明在functions.php上有意外的文件结束



我不能为我的生活记住那个文件是如何结束的,不知道该怎么做 - 我所知道的是我在wordpress网站上做不了什么。



我的functions.php结尾如下:

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:

	<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.

推荐答案

name; ??>';
}

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





非常感谢任何有时间提供帮助的人。



Thank you so much for anyone who gives the time to assist.


看起来你缺少一个必需的php标签。应该是:



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

    <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

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


这篇关于意外编辑的wordpress functions.php - 非常感谢!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆