Wordpress自定义帖子登录页面

时间:2017-11-12 17:24:13

标签: wordpress login themes

  

请参考wordpress登录后的一些插件。   我有3页网站主页,关于和工作正常和工作安全,我想显示工作安全页面,如果用户登录有电子邮件/我可以生成的虚拟ID。   无法找到此登录模块的插件。   带有自定义页面的自定义菜单

enter image description here

使用此脚本我可以创建菜单但无法重定向单独的页面

function my_wp_nav_menu_args($ args =''){

if(is_user_logged_in()){

$args['menu'] = 'logged-in';

}其他{

$args['menu'] = 'logged-out';

}

return $args;

}

add_filter('wp_nav_menu_args','my_wp_nav_menu_args');

1 个答案:

答案 0 :(得分:0)

如果用户已登录,则会重定向到“关于我们”页面

import re

def passwordchecker():

    print("***************************************************************")
    print("                       PASSWORD CHECKER                        ")
    print("***************************************************************")
    print("                                                               ")
    print("---------------------------------------------------------------")
    print("The password must be at least 8 characters, and a maximum of 24")
    print("---------------------------------------------------------------")
    print("The Password must contain at least 1 uppercase letter")
    print("---------------------------------------------------------------")
    print("The Password must contain at least 1 lowercase letter")
    print("---------------------------------------------------------------")
    print("The password must at least have 1 number in it")
    print("---------------------------------------------------------------")
    print('The password must have at least 1 symbol')
    print("Allowed Symbols: !, $, %, ^, &, *, (, ), _, -, +, =, ")
    print("---------------------------------------------------------------")

    incorrectpassword = True

    while incorrectpassword:
        password = input("Type in your password: ")
        if len(password) < 8:
            print("Your password must be at least 8 characters long")
        elif len(password) > 24:
            print("Your password must be maximum 24 characters long")
        elif not any(i.isdigit() for i in password):
            print("You need a number in your password")
        elif not any(i.isupper() for i in password):
            print("You need a capital letter in your password")
        elif not any(i.islower() for i in password):
            print("You need a lowercase letter in your password")
        elif re.search('[!, $, %, ^, &, *, (, ), _, -, +, =,]', password) is None:
            print("You need a symbol in your password")
        else:
            print("Your password has all the characters needed")
            incorrectpassword = False


def mainmenu():
    print("*******************************************************************")
    print("           Welcome to the Password Checker & Generator             ")
    print('*******************************************************************')
    print("-------------------------------------------------------------------")
    print("This program can be used to check a password to see if it is strong")
    print("-------------------------------------------------------------------")
    print("This Program can be used to generate strong passwords")
    print("-------------------------------------------------------------------")
    print("1. Password Checker")
    print("-------------------------------------------------------------------")
    print("2. Password Generator")
    print("-------------------------------------------------------------------")
    print("3. Exit")
    print("-------------------------------------------------------------------")
    print("*******************************************************************")
    while True:
        try:
            selection = int(input("Enter choice:  "))      # Making selection a variable
            if selection == 1:
                passwordchecker()
                break
            elif selection == 2:
                passwordgenerator()
                break
            elif selection == 3:
                exit()
                break
            else:
                print("Invalid Choice. Enter 1-3")
                mainmenu()

        except ValueError:
            print("Invalid Choice. Enter 1-3")
    exit()


mainmenu()
passwordchecker()
mainmenu()


def passwordgenerator():

    print("Work In Progress")