中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

如何制作前臺用戶登錄/注冊功能

2018-11-02    來源:學做網(wǎng)站論壇

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

使用Wordpress程序建好網(wǎng)站,默認情況下是不帶有前臺登錄/注冊功能,我們可以通過自己寫代碼去制作前臺登錄/注冊功能。

下面是學做網(wǎng)站論壇講解如何制作網(wǎng)站前臺用戶登錄/注冊功能視頻教程。

下面學做網(wǎng)站論壇就來介紹一下WordPress純代碼制作前臺登錄/注冊功能方法。(如果你對Wordpress程序不了解,可以先學習一下wordpress教程)
Wordpress前臺登錄/注冊功能

方法/步驟

  1. 下載Wordpress前臺登錄/注冊功能模板文件,下載WP用戶注冊登錄模板;
  2. 將下載下來的WP用戶注冊登錄模板壓縮包進行解壓,得出二個文件和一個images文件夾。如下圖:
    dl
  3. 將這三個文件,全部上傳到自己正在使用的模板文件目錄下;
  4. 進行網(wǎng)站后臺,點擊左側(cè)菜單的【頁面】-【新建頁面】,分別新建二個頁面,一個標題為用戶登錄,一個標題為用戶注冊。內(nèi)容可以不寫。如下圖:
    wordpress用戶注冊 wordpress用戶登錄
  5. 使用以下的代碼,放在自己網(wǎng)站上需要顯示登錄/注冊按鈕的位置,一般是放在header.php頭部模板里!鞠嚓P(guān)教程:wordpress模板制作教程】
    
    
    <style>.top-userr{width:1001px;margin:10px auto 0;padding:10px;box-sizing:border-box;background:#fff;text-align:right;border-bottom:1px solid #f4f4f4}.top-userr a.register{display:inline-block;margin-right:10px;width:90px;height:35px;line-height:35px;text-align:center;background:green;color:#fff}.top-userr a.register:hover{text-decoration:none;}</style>
    <div class="top-userr">
    <?php if (!(current_user_can('level_0'))){ ?>
    <a href="<?php echo get_option('home'); ?>/reg" class="register" rel="nofollow" >注冊</a><a class="register" href="<?php echo get_option('home'); ?>/login" rel="nofollow" >登錄</a>
    <?php } else { global $user_identity, $user_level; ?>
    歡迎您, <strong><?php echo $user_identity ?></strong>!
    <a class="log" href="<?php bloginfo('siteurl');?>/wp-admin/profile.php" target="_blank" rel="nofollow">[會員中心]</a>
    <a class="log" href="<?php echo wp_logout_url( get_permalink() ); ?>" rel="nofollow" >[安全退出]</a>

    <?php }?>
    </div>
  6. 這樣,Wordpress前臺登錄/注冊功能就制作好了。代碼會自動判斷當前用戶是否登錄,顯示按鈕或會員中心。

標簽: isp 安全 代碼 制作網(wǎng)站

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:wordpress判斷第一篇文章應(yīng)用不同的樣式

下一篇:wordpress網(wǎng)站被黑惡意攻擊解決方法