2016-11-07 106 views
0

我正嘗試在wordpress上創建我的第一個主題爲零。 我加入Disqus插件來管理帖子的評論。如何在wordpress中調用插件?

這是在頁面中調用插件的標準功能嗎?

我目前的職位網頁看起來是這樣的:

<?php 
get_header('post'); 
//get_template_part('single-post-content'); 
?> 
<div id="slide1"> 

    <div class="article_content"> 
     <h2 style="margin-bottom: 50px;"><?php the_title(); ?></h2> 
     <div class="content"> 
     <?php the_post(); the_content(); ?> 
     </div> 
    </div> 
</div> 
    <?php get_template_part('post_footer'); ?> 

我想顯示評論框下每個樁 你會怎麼做它開始由零?

回答

0

你不需要調用插件的功能。

要顯示評論,您應該在您的模板中調用comments_template函數,並在您的主題文件夾中添加comments.php。

在comments.php中,您應該調用comment_form來顯示默認的WordPress表單。

在您激活Disqus插件後,該插件將用一些操作和過濾器替換默認的WP評論表單。

你可以參考默認的WordPress主題知道如何顯示評論。 代碼在twentysixteen/single.phptwentysixteen/comments.php

更新
如果插件(Disqus WordPress的)無法正常工作,您可以手動在您安裝的主題頁1。請參閱https://help.disqus.com/customer/en/portal/articles/1183281-manually-install-disqus-on-wordpress

+0

我已經嘗試調用comment_form,但它不起作用 – user7031185

+0

您是否調用了comments_template? – ucheng

+0

如果我使用標準的WordPress主題,它工作正常。問題是我創建的主題必須有一些我缺少的東西 – user7031185

相關問題