Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP语法错误意外';}';_Php - Fatal编程技术网

PHP语法错误意外';}';

PHP语法错误意外';}';,php,Php,这里是PHP新手。我得到以下错误: 分析错误:语法错误,在。。。在线1 下面是代码,我很难找到这个简单的错误。有人能帮忙吗?这个文件是wordpress论文主题中的一个文件,用PHP编写 <?php // Using hooks is absolutely the smartest, most bulletproof way to implement things like plugins, // custom design elements, and ads. You can add

这里是PHP新手。我得到以下错误:

分析错误:语法错误,在。。。在线1

下面是代码,我很难找到这个简单的错误。有人能帮忙吗?这个文件是wordpress论文主题中的一个文件,用PHP编写

<?php

// Using hooks is absolutely the smartest, most bulletproof way to implement things like plugins,
// custom design elements, and ads. You can add your hook calls below, and they should take the
// following form:
// add_action('thesis_hook_name', 'function_name');
// The function you name above will run at the location of the specified hook. The example
// hook below demonstrates how you can insert Thesis' default recent posts widget above
// the content in Sidebar 1:
// add_action('thesis_hook_before_sidebar_1', 'thesis_widget_recent_posts');

// Delete this line, including the dashes to the left, and add your hooks in its place.

/**
 * function custom_bookmark_links() - outputs an HTML list of bookmarking links
 * NOTE: This only works when called from inside the WordPress loop!
 * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
 *
 * @since 1.0
 * @global object $post
*/

function custom_bookmark_links() {
    global $post;
?>
<ul class="bookmark_links">
    <li><a rel="nofollow" href="http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
</ul>
<?php
}

/*** HEADER AD WIDGET***/
register_sidebars(1,
array(
'name' => 'HeaderAd',
'before_widget' => '<li id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
function header_widget() { ?>
<div id="header_widget_1">
<ul class="sidebar_list">
<?php thesis_default_widget(3); ?>
</ul>
</div>
<?php }

add_action('thesis_hook_header', 'header_widget', '1');
/***  HEADER WIDGET END***/

/*remove footer attribution*/
remove_action('thesis_hook_footer', 'thesis_attribution');

function seth_godin_stuff_1 () {
if (is_single()) {
?>
<p class="alert" style="text-align:center;">Interested in a free 25+ eBook on the 7 Wastes? Please <a href="http://www.shmula.com/7-wastes-of-lean/">DOWNLOAD HERE</a>.</p>
<?php
}
}

add_action('thesis_hook_before_post', 'seth_godin_stuff_1', '1');

function single_post_ads() {
if (is_single()) { ?>
<BR>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td rowspan="2"><script type="text/javascript" src="http://forms.aweber.com/form/06/1421749706.js"></script></td>
<td><a target="new" href="http://amzn.to/ddLMpa"><img class="alignnone size-full wp-image-4151" title="the-toyota-way-ad-unit" src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2010/08/the-toyota-way-ad-unit.jpg" alt="" width="102" height="157" /></a></td>
<td><a target="new" href="http://amzn.to/9epSyC"><img class="alignnone size-full wp-image-4152" title="the-toyota-way-fieldbook-ad-unit" src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2010/08/the-toyota-way-fieldbook-ad-unit.jpg" alt="" width="111" height="158" /></a></td>
<td><a target="new" href="http://amzn.to/ac4i1v"><img class="alignnone size-full wp-image-4149" title="the-toyota-culture-ad-unit" src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2010/08/the-toyota-culture-ad-unit.jpg" alt="" width="98" height="161" /></a></td>
</tr>
<tr><td colspan="5"><div align="center"><h5>This post was written by <a href="http://www.shmula.com/about-peter-abilla/" rel="author">Pete Abilla</a></h5>
</div></td></tr>
</tbody>
</table>
</div>
<?php }
}

add_action('thesis_hook_after_post', 'single_post_ads');

remove_action('thesis_hook_after_post', 'thesis_post_tags');


/*social bookmarks right header*/
function thesis_header_ad() {
?>
<div id="banner_ad">
<div align="center">
<a rel="nofollow" href="http://www.linkedin.com/in/shmula">
<img src="http://www.shmula.com/wp-content/uploads/image/social-icons/linkedin.jpg"
height="68" width="68" border="0" alt="" /></a>&nbsp; <a rel="nofollow" href="http://twitter.com/shmula">
<img src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2011/04/Twitter.png" height="70" width="70" border="0"
alt="follow shmula on twitter" /></a>&nbsp; <a rel="nofollow"
href="http://www.facebook.com/shmula">
<img src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2011/04/FaceBook.png"
height="70" width="70" border="0" alt="" /></a>&nbsp;<a href="http://feeds.feedburner.com/shmula/dfYo">
<img src="http://www.shmula.com/http://www.shmula.com/wp-content/uploads/Image/2011/04/Feed.png"
height="70" width="70" border="0" alt="" /></a>&nbsp; <a href="http://forms.aweber.com/form/77/1324894377.htm">
<img src="http://www.shmula.com/wp-content/uploads/image/social-icons/Email.gif"
height="70" width="70" border="0" alt="" /></a>
</div>
</div>
<?php
}//end of php block

/* BEGIN Custom Widgetized Footer */
if (function_exists('register_sidebar')) {      

register_sidebar(array('name' => 'Footer Widget ', 'id' => 'footer-widget-', 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));}

function widgetized_footer() { ?><div id="widgetized_wrapper"> <?php 

  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Widget') ) : ?> 
    <?php endif; ?>
    </div>
  <?php 
}

remove_action('thesis_hook_footer', 'thesis_attribution');add_action('thesis_hook_footer', 'widgetized_footer');
/* END Custom Widgetized Footer *//*footer widget*/

/*custom popular posts thumbnails*/
function pop_posts_with_thumbs() { ?>
    <li class="widget popular_posts">
        <h3>POPULAR POSTS</h3>
        <ul>
        <? $args = array('posts_per_page' => 28, 'orderby' => 'comment_count', 'category__in' => array(131,16,29,17,281,651,120,193,650,135,147,9,508,64,613,654,655));
        global $post;
        $popular = get_posts($args);
        foreach($popular as $post) {
            setup_postdata($post); ?>
            <li>
                <a href="<?php the_permalink(); ?>" title="Permalink to <?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail('thumb'); } ?><?php the_title(); ?>
                </a>
            </li>
            <!--[if lte IE 6]>
                <div class="clear"></div>
            <![endif]-->
        <? } ?>
        </ul>
    </li>
<? }
add_action('thesis_hook_after_sidebar_1', 'pop_posts_with_thumbs');

/*thumbnail functions*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 610, 9999, true );
add_image_size( 'teaser', 150, 150, true );
add_image_size( 'thumb', 50, 50, true );

/*link rel for next/prev*/
add_action('wp_head', 'index_rel_link'); // Relational link for site index
add_action('wp_head', 'start_post_rel_link'); // Relational link for first post
add_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // Relational links for adjacent posts
add_action('wp_head', 'parent_post_rel_link'); // Relational link for parent item

首先,确保标记仅位于文件的开头和结尾。这个代码有点乱。这就是您在模板中找到它的方式吗?

我添加了缺少的函数。现在,此代码正在运行:


到底是什么问题。基本上,您的PHP代码没有语法错误。第1行显示的错误不在此代码片段中。因为它是Wordpress,所以您可能会在另一个文件中更改主题的其他部分,它会显示错误。或者您在服务器中有一些部分上载的文件

我希望您知道这是意大利面代码。您使用的是哪种编辑器?它支持语法检查吗?你得到了什么样的信息;或者您正在使用记事本?顺便说一句,搜索
http://www.shmula.com/http://www.shmula.com/
,我想您会惊讶于它在代码中的出现频率。错误消息还应该包含一个文件路径。请仔细检查您是否已经发布了问题文件的内容。第1行没有},您发布的代码中也没有对eval()的调用。@tereško:WordPress都是关于意大利面代码的。是的,模板已经是这样了。我添加了一些函数,但在调试时删除了这些函数,但仍然出现错误,因此根本原因不是我添加的。有什么想法吗?