2012-12-20 173 views
1

任何人都可以告訴我這個php代碼段有什麼問題嗎?我正在嘗試將GD Star Rating整合到我的wordpress評論中,並從http://www.placementedge.com/blog/gd-star-rating-comment-integration-with-wordpress-3-0/#comment-2952獲得此代碼 - 謝謝!php代碼語法錯誤

<?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); 
?> 

回答

1

你需要在你的代碼改變=&gt;=>

<?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 = &quot;oxygen&quot;, $stars_size = 24, 
$stars_set_ie6 = &quot;oxygen&quot;, $echo = false).'&lt;p class=&quot;comment- 
form-comment&quot;&gt;&lt;label for=&quot;comment&quot;&gt;My 
Review&lt;/label&gt;&lt;br /&gt;&lt;textarea id=&quot;comment&quot; name=& 
quot;comment&quot; aria-required=&quot;true&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;', 
'comment_notes_after' => __('')); 
comment_form($form_args); 
+0

謝謝大家,我抄了這個(和第一回復)這工作這麼感謝我有點笨沒關係。 – user1684099

0

更換所有&gt;通過>

這是PHP,而不是HTML。

1

替換&gt;與>它是不是在引號'

'title_reply_to' => __('Reply to %s'), 
'title_reply' => __('Post a Review'), 
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).'&lt;p class="comment- 
form-comment">&lt;label for="comment">My 
Review&lt;/label>&lt;br />&lt;textarea id="comment" name=& 
quot;comment" aria-required="true">&lt;/textarea>&lt;/p>', 
'comment_notes_after' => __('')); 
comment_form($form_args); 
+0

我已經更改了引號tooo –