有谁能告诉我这个php片段有什么问题?我正在尝试将GD Star Rating整合到我的wordpress评论中,并从http://www.placementedge.com/blog/gd-star-rating-comment-integration-with-wordpress-3-0/#comment-2952获得此代码 - 谢谢!
<?php
$form_args = array(
'title_reply_to' => __('Reply to %s'), // SHOWS SYNTAX ERROR
'title_reply' => __('Post a Review'), // SHOWS SYNTAX ERROR
'comment_field' => wp_gdsr_comment_integrate_multi_rating($multi_set_id = 1,
$template_id = 0, $value = 0, $stars_set = "oxygen", $stars_size = 24,
$stars_set_ie6 = "oxygen", $echo = false).'<p class="comment-
form-comment"><label for="comment">My
Review</label><br /><textarea id="comment" name="comment" aria-required="true"></textarea></p>',
'comment_notes_after' => __(''));
comment_form( $form_args );
?>
答案 0 :(得分:1)
您需要在代码中将=>
更改为=>
。
<?php
$form_args = array(
'title_reply_to' => __('Reply to %s'), // SHOWS SYNTAX ERROR
'title_reply' => __('Post a Review'), // SHOWS SYNTAX ERROR
'comment_field' => wp_gdsr_comment_integrate_multi_rating($multi_set_id = 1,
$template_id = 0, $value = 0, $stars_set = "oxygen", $stars_size = 24,
$stars_set_ie6 = "oxygen", $echo = false).'<p class="comment-
form-comment"><label for="comment">My
Review</label><br /><textarea id="comment" name=&
quot;comment" aria-required="true"></textarea></p>',
'comment_notes_after' => __(''));
comment_form( $form_args );
答案 1 :(得分:1)
用&gt;替换>
它不在引号''
'title_reply_to' => __('Reply to %s'),
'title_reply' => __('Post a Review'),
答案 2 :(得分:1)
<?php
$form_args = array(
'title_reply_to' => __('Reply to %s'), // SHOWS SYNTAX ERROR
'title_reply' => __('Post a Review'), // SHOWS SYNTAX ERROR
'comment_field' => wp_gdsr_comment_integrate_multi_rating($multi_set_id = 1,
$template_id = 0, $value = 0, $stars_set = "oxygen", $stars_size = 24,
$stars_set_ie6 = "oxygen", $echo = false).'<p class="comment-
form-comment"><label for="comment">My
Review</label><br /><textarea id="comment" name=&
quot;comment" aria-required="true"></textarea></p>',
'comment_notes_after' => __(''));
comment_form( $form_args );
答案 3 :(得分:0)
将所有>
替换为>
它是PHP,而不是HTML。