2015-11-07 41 views
-1

我是下面創建此功能可以顯示有關用戶,日期,帖子瀏覽量,評論等一些崗位信息..但是當我的其他文件中調用函數得到我的錯誤說Parse error: syntax error, unexpected '.' in C:\wamp\www\ype\wp-content\themes\yallanpe\functions.php on line 118請如何我可以糾正這個錯誤使用withing變量字符串聲明功能

<?php 
function YPE_show_post_info(
$post_user, 
$post_tags, 
$post_date, 
$post_views, 
$post_comments 
) { 

$post_user  = '<span class="dashicons dashicons-admin-users"></span>&nbsp;&nbsp;'.the_author_posts_link();.'&nbsp;&nbsp;'; 
$post_tags  = '<span class="dashicons dashicons-tag"></span>'.the_category('&nbsp;/&nbsp;');.''; 
$post_date  = '<span class="dashicons dashicons-calendar-alt"></span>&nbsp;&nbsp;'.get_the_date(get_option('date_format'));.'&nbsp;&nbsp;'; 
$post_views = '<span class="dashicons dashicons-visibility"></span>&nbsp;&nbsp;'.getPostViews(get_the_ID());.'&nbsp;&nbsp;'; 
$post_comments = '<span class="dashicons dashicons-admin-comments"></span>&nbsp;&nbsp;'.comments_number('0','1','%');.''; 
?> 
<p class="text-muted"> 
    <?php 
     echo $post_user; 
     echo $post_tags; 
     echo $post_date; 
     echo $post_views; 
     echo $post_comments; 
    ?> 
</p> 
<?php 
} 
?> 
+2

哪一個是線118? – Nirnae

+0

'在管線118 $ post_user'我想,當我使用的字符串中的函數,但我不知道如何糾正這些錯誤 –

回答

0

那麼其受命進行.一個;

後試試這個代碼:

<?php 
function YPE_show_post_info(
$post_user, 
$post_tags, 
$post_date, 
$post_views, 
$post_comments 
) { 

$post_user  = '<span class="dashicons dashicons-admin-users"></span>&nbsp;&nbsp;'.the_author_posts_link().'&nbsp;&nbsp;'; 
$post_tags  = '<span class="dashicons dashicons-tag"></span>'.the_category('&nbsp;/&nbsp;').''; 
$post_date  = '<span class="dashicons dashicons-calendar-alt"></span>&nbsp;&nbsp;'.get_the_date(get_option('date_format')).'&nbsp;&nbsp;'; 
$post_views = '<span class="dashicons dashicons-visibility"></span>&nbsp;&nbsp;'.getPostViews(get_the_ID()).'&nbsp;&nbsp;'; 
$post_comments = '<span class="dashicons dashicons-admin-comments"></span>&nbsp;&nbsp;'.comments_number('0','1','%').''; 
?> 
<p class="text-muted"> 
    <?php 
     echo $post_user; 
     echo $post_tags; 
     echo $post_date; 
     echo $post_views; 
     echo $post_comments; 
    ?> 
</p> 
<?php 
} 
?> 
+0

謝謝你現在和我一起工作的錯誤occure –