久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      WordPress實現(xiàn)登錄可見評論模塊

      下面由WordPress教程欄目給大家介紹WordPress實現(xiàn)登錄可見評論模塊的方法,希望對需要的朋友有所幫助!

      WordPress實現(xiàn)登錄可見評論模塊

      WordPress正常可以設(shè)置登錄發(fā)表評論,但不登錄也可以正??吹搅粞栽u論內(nèi)容,最近有用戶說接到通知個人備案的網(wǎng)站不允許有評論互動功能,雖然我沒接到過通知,但可以簡單修改一下模板,讓主題評論模塊只有在登錄的狀態(tài)下可見。

      WordPress 登錄可見評論模塊WordPress 登錄可見評論模塊

      這里我們要用到WordPress判斷是否登錄的函數(shù):is_user_logged_in()

      用判斷函數(shù)把評論模塊包裹起來就行了。

      以WordPress默認主題Twenty Seventeen為例,打開主題正文模板文件single.php,找到類似的:

      if ( comments_open() || get_comments_number() ) : comments_template(); endif;

      修改為:

      if ( is_user_logged_in()){ if ( comments_open() || get_comments_number() ) : comments_template(); endif; }

      之后,只有登錄的狀態(tài)下才能看見評論模塊及評論內(nèi)容。

      其它主題方法類似,比如:

      <?php if ( is_user_logged_in()){ ?> <?php if ( comments_open() || get_comments_number() ) : ?> <?php comments_template( '', true ); ?> <?php endif; ?> <?php } ?>

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號