dqst96444 2014-05-24 10:58
浏览 33

如何自定义wordpress主题,使其具有登录部分

I need to add my own webpages to a wordpress theme that are totally independent of the theme. I have seen how to do something like this here using adam's answer

How to add a PHP page to WordPress?

However how would i go about making certain pages require a login? If the user is logged it it says "hi joe, go to your area" and if you arent logged in it says "login here"

The login area can look like a separate section and just be independent php pages. However in the existing pages where would I check login status? I would store this in a session variable probably

I assume this type of thing would be theme dependent but I'm just investigating if it is possible. I am guessing I would have to modify the header file to show a specific message based on session variables.

If anyone has an idea for a better approach or a plugin that does this that would be mucch appreciated

Thanks as ever for your help

  • 写回答

2条回答 默认 最新

  • duandushang5148 2014-05-24 11:02
    关注

    Try at your custom page-

     <?php if ( is_user_logged_in() ) { ... } ?> 
    
    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP